Skip to content

Commit 1ae93ce

Browse files
committed
Update docs
1 parent f68f3e4 commit 1ae93ce

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,25 @@ class App extends React.Component {
6969
}
7070
```
7171

72-
You may prefer to wrap these components into channel specific pairs to avoid typos and other problems with the indirection involved with the channel strings:
72+
You may prefer to wrap these components into channel-specific pairs to avoid typos and other problems with the indirection involved with the channel strings:
7373

7474
```js
7575
// Broadcasts.js
76-
const CHANNEL = 'currentUser'
76+
import { Broadcast, Subscriber } from 'react-broadcast'
77+
78+
const CurrentUserChannel = 'currentUser'
7779

7880
export const CurrentUserBroadcast = (props) =>
79-
<Broadcast channel={CHANNEL} {...props} />
81+
<Broadcast {...props} channel={CurrentUserChannel}/>
8082

8183
export const CurrentUserSubscriber = (props) =>
82-
<Subscriber channel={CHANNEL} {...props} />
84+
<Subscriber {...props} channel={CurrentUserChannel}/>
8385

8486
// App.js
85-
import { CurrentUserBroadcast, CurrentUserSubscriber } from 'Broadcasts'
87+
import { CurrentUserBroadcast, CurrentUserSubscriber } from './Broadcasts'
8688

8789
<CurrentUserBroadcast value={user}/>
8890
<CurrentUserSubscriber>{user => ...}</CurrentUserSubscriber>
8991
```
9092

93+
That's it! Enjoy :)

0 commit comments

Comments
 (0)