Reactivate
Reactivate is a module that is a composition of many other useful modules:
Quick Links
General
Modules
Installation
npm install reactivate --save
Example Apps
Entry
Entry provides some convenience functions for working with entries. An entry is an array where the head is the key and the tail contains values (e.g.: ['/some/key', value1, value2, ...]).
; // Returns the array of values for an entryvar values = Entry; // Returns the key of an entryvar key = Entry;
Key
Key provides convenience functions for parsing and stringify'ing keys.
; // Converts string format into array formatvar keys = Key; // Converts array format into string formatvar key = Key;
Route
Route is the core of Rille and provides support for routing entries (key + values) to appropriate subscribers.
; // Create a routeconst route = ; // Subscribe to receive updates to a routeroute; // Subscribe to receive updates on a child route; // Subscribe to receive updates for all child of a route (a wildcard route); // Push a value(s) to a routeroute; // Push value(s) of any type to a routeroute; // Push value(s) to a child route;
Store
Store is a route that retains it's most recent entry.
; // Create a store just like a routeconst store = ; var child = ; // Subscribe to a store just like a routechild; // Push to a store just like a routechild; // Get the most recent entryvar entry = child;console; // Get the array of values for the most recent entryvar values = child;console; // Get a particular value from the most recent entryconsole;
Component
- Components are pre-wired to render whenever a Reactivate store receives data.
- Components are React components and still support the React features you've come to love.
;; const HelloReactivate = ; const Greeting = ; ;
Change Log
2.0.0
- Reactivate now uses "rille", "rille-react".
- Reactivate is now an all in one solution for people who like all things Rille and React.
1.5.8
- "History" is now more fittingly named "Log".
- "Log" is exposed as future functionality will utilize it directly (e.g. time machine support).
1.5.4
- Added "changeCount" to Store via history.
- Added "size" to Store via history.
- Added allowance for unlimited capacity when set to 0. Default to Store is still 1.
1.5.3
- Added "immutable" option to Store.
1.5.0
- Changed "setState" to "push" in preparation for new features.
- Changed "getState" to "value" in preparation for new features.
- Added "History" module to record pushes.
- Component now works through the "this.store" reference.
- Due to history, you can now iterate over store.values() as a stream.