All Projects → madou → React Peer

madou / React Peer

Licence: mit
Send data to someone else's browser as easy as setting state

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to React Peer

Ethereumjs Devp2p
Project is in active development and has been moved to the EthereumJS VM monorepo.
Stars: ✭ 119 (-37.7%)
Mutual labels:  p2p, peer-to-peer
Awesome Peer To Peer
A list of peer-to-peer resources.
Stars: ✭ 1,897 (+893.19%)
Mutual labels:  p2p, peer-to-peer
Syncthing Android
Wrapper of syncthing for Android.
Stars: ✭ 1,812 (+848.69%)
Mutual labels:  p2p, peer-to-peer
Unstoppable Wallet Ios
A secure and decentralized Bitcoin and other cryptocurrency wallet for iPhone. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 180 (-5.76%)
Mutual labels:  p2p, peer-to-peer
Gun
An open source cybersecurity protocol for syncing decentralized graph data.
Stars: ✭ 15,172 (+7843.46%)
Mutual labels:  p2p, peer-to-peer
Bitchatclient
Technitium Bit Chat, a secure, peer-to-peer, instant messenger!
Stars: ✭ 111 (-41.88%)
Mutual labels:  p2p, peer-to-peer
Pytorrent
Simple and functional BitTorrent client made in Python - Use for learning
Stars: ✭ 135 (-29.32%)
Mutual labels:  p2p, peer-to-peer
Amoeba
The Amoeba Project
Stars: ✭ 85 (-55.5%)
Mutual labels:  p2p, peer-to-peer
P2p Cdn Sdk Javascript
Free p2p cdn github javascript sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - 🚀 Vadootv 🚀
Stars: ✭ 158 (-17.28%)
Mutual labels:  p2p, peer-to-peer
Wt Tracker
High-performance WebTorrent tracker
Stars: ✭ 144 (-24.61%)
Mutual labels:  p2p, peer-to-peer
Syncthing
Open Source Continuous File Synchronization
Stars: ✭ 41,904 (+21839.27%)
Mutual labels:  p2p, peer-to-peer
Unstoppable Wallet Android
A secure and decentralized Bitcoin and other cryptocurrency wallet for Android phones. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 165 (-13.61%)
Mutual labels:  p2p, peer-to-peer
Airdcpp Webclient
Communal peer-to-peer file sharing application for file servers/NAS devices
Stars: ✭ 106 (-44.5%)
Mutual labels:  p2p, peer-to-peer
Livepeerjs
JavaScript tools and applications that interact with Livepeer's smart contracts and peer-to-peer network
Stars: ✭ 116 (-39.27%)
Mutual labels:  p2p, peer-to-peer
Figo
P2P file transfer utility
Stars: ✭ 88 (-53.93%)
Mutual labels:  p2p, peer-to-peer
Univoice
P2P VoIP in Unity
Stars: ✭ 128 (-32.98%)
Mutual labels:  p2p, peer-to-peer
Go2p
Simple to use but full configurable p2p framework
Stars: ✭ 80 (-58.12%)
Mutual labels:  p2p, peer-to-peer
Js Dag Service
Library for storing and replicating hash-linked data over the IPFS network.
Stars: ✭ 81 (-57.59%)
Mutual labels:  p2p, peer-to-peer
Ensichat
Project discontinued
Stars: ✭ 143 (-25.13%)
Mutual labels:  p2p, peer-to-peer
Pikachu Volleyball P2p Online
Pikachu Volleyball peer-to-peer online via WebRTC data channels
Stars: ✭ 160 (-16.23%)
Mutual labels:  p2p, peer-to-peer

react-peer

Build Status npm npm bundle size (minified + gzip) Dev Dependencies Dev Dependencies Dev Dependencies

Using the power of WebRTC and peerjs you can send data to someone else's browser as easy as using setState() ⚛🍐

Installation

Uses peerjs under the hood. Requires at least [email protected]^16.3.0 and [email protected]^16.3.0. Comes with TypeScript types out-of-the-box.

npm install react-peer react react-dom --save
yarn add react-peer react react-dom

Usage

usePeerState<TState>(initialState?: TState, opts?: { brokerId?: string }): [TState, Function, string, Peer.DataConnection[], PeerError | undefined];

⚠️ Make sure to use [email protected]^16.8.0 and [email protected]^16.8.0 if wanting to use hooks. Unsure what hooks are? Check out their introduction! ⚠️

Behaves as your regular useState() hook, but will eventually send data to any connected peers. Peers can connect to you using the brokerId that is eventually returned.

opts.brokerId is optionally used when you already have a broker id generated.

import { usePeerState } from 'react-peer';

const App = () => {
  const [state, setState, brokerId, connections, error] = usePeerState();

  setState({ message: 'hello' });
};

useReceivePeerState<TState>(peerBrokerId: string, opts?: { brokerId?: string }): [TState | undefined, boolean, PeerError | undefined];

⚠️ Make sure to use [email protected]^16.8.0 and [email protected]^16.8.0 if wanting to use hooks. Unsure what hooks are? Check out their introduction! ⚠️

Will receive peer state eventually from a peer identified using peerBrokerId.

opts.brokerId is optionally used when you already have a broker id generated.

import { useReceivePeerState } from 'react-peer';

const App = () => {
  const [state, isConnected, error] = useReceivePeerState('swjg3ls4bq000000');
};

<PeerStateProvider />

Useful if not yet using react hooks. When setting the value prop it will propagate it to all connected peers.

brokerId prop is optionally used when you already have a broker id generated.

import { PeerStateProvider } from 'react-peer';

<PeerStateProvider value={{ message: 'hello' }}>
  {({ brokerId, connections, error }) => <div />}
</PeerStateProvider>;

<ReceivePeerState />

Useful if not yet using react hooks. Will receive data from the peer broker.

brokerId prop is optionally used when you already have a broker id generated.

import { ReceivePeerState } from 'react-peer';

<ReceivePeerState peerBrokerId="swjg3ls4bq000000">
  {({ data, isConnected, error }) => <div />}
</ReceivePeerState>;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].