react-pub-sub
Factory for creating prop and state propagation between 1:N React components.
Install
npm i -S react-pub-sub
How it works
**This library makes use of react-stamp to compose components and internally emits events for propagating props and state from a Pub component to 1 or more Sub components. Sub components receive the updates on pub
and sub
properties of their state object. To track differences between when a publisher may have propagated an event and when a subscriber last updated a related property, the pub and sub objects contain a time stamp for when they were last updated.
Usage
import React from 'react'import render from 'react-dom'import reactPubSub from 'react-pub-sub' const pubSub = /** Create factories to link publishers and subscribers based on prop or state changes of the pub component. */const createPub createSub = const Pub =