react-rinter

0.2.1 • Public • Published

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

Package Sidebar

Install

npm i react-rinter

Weekly Downloads

4

Version

0.2.1

License

MIT

Unpacked Size

16.4 kB

Total Files

31

Last publish

Collaborators

  • dfernandez79