dispersive-react
Binding of dispersive for react components.
Install
This package has 2 peer dependancies : dispersive and react.
npm install dispersive react dispersive-react
Usage
import Store from 'dispersive';import React Component from 'react';import Watcher from 'dispersive-react'; const schema = name: '' price: 0; const products = Store; const Product = product <li ="product"> <div ="name">productname</div> <div ="price">productprice</div> </li>; const ProductList = products <ul> products </ul>; { return <Watcher => <ProductList = /> </Watcher> } ; ;
In this example, both the list and the product are observers.
So, if you type this:
products;
Then, the list will re-render.
And if you type this :
products;
Then, the only the concerned Product element will re-render.