0.2.1 • Published 5 years ago

react-rinter v0.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

React Rinter

This package exports React components to do unicast or multicast subscriptions to a Rinter's Controller changes.

Usage

Single Consumer (unicast)

Add a Subscription element to the rendering tree, and pass the controller to it (usually done in the application root).

The children property is not a React element but a function that receives the current state and the controller (see Render Prop):

import { Subscription } from 'react-rinter';

// myController is a Rinter controller object

<Subscription controller={myController}>
  {(state, controller) => <div>{/* Do something to display state */}</div>}
</Subscription>;

Multiple Consumers (multicast)

License

MIT