Skip to content

Commit f68f3e4

Browse files
committed
Style tweaks
1 parent e491370 commit f68f3e4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,19 @@ class App extends React.Component {
7272
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
75+
// Broadcasts.js
7576
const CHANNEL = 'currentUser'
76-
const BroadcastCurrentUser = (props) =>
77+
78+
export const CurrentUserBroadcast = (props) =>
7779
<Broadcast channel={CHANNEL} {...props} />
7880

79-
const CurrentUserSubscriber = (props) =>
81+
export const CurrentUserSubscriber = (props) =>
8082
<Subscriber channel={CHANNEL} {...props} />
8183

82-
export { BroadcastCurrentUser, CurrentUserSubscriber }
84+
// App.js
85+
import { CurrentUserBroadcast, CurrentUserSubscriber } from 'Broadcasts'
8386

84-
// then use them across the app like so:
85-
<BroadcastCurrentUser value={user}/>
86-
<CurrentUserSubscriber>{(user) => ()}</CurrentUserSubscriber>
87+
<CurrentUserBroadcast value={user}/>
88+
<CurrentUserSubscriber>{user => ...}</CurrentUserSubscriber>
8789
```
8890

0 commit comments

Comments
 (0)