Torrent store
Scalable, reduce-able & 'state' based store for (but not limited to) ReactJS, with node EventEmitter api.
/** * Map all nammed stores in * Hook componentWillUnmount (for react comp) or destroy to unBind them automatically * @static * @param object {React.Component|Store|...} target state aware object * @param keys */ static {...} /** * Constructor, will build a torrent store/reducer/remapper * * (state, keys, reducer, name) * (keys, reducer, name) * (keys, name) * (state, name) * * @param state * @param keys * @param reducer * @param name */ {...} /** * Apply reduce/remap on the private state & push the resulting "public" state to followers * @param cb */ {...} /** * Pull stores in the private state * @param stores */ {...} /** * Update the current private state & push it once the store is stable * @param pState * @param cb */ {...} /** * Replace the current private state & push it once the store is stable * @param pState * @param cb */ {...} /** * Overridable reducer / remapper (will call the constructor's reducer fn if there) * @param privateState * @param lastPublicState * @returns */ {...} /** * Un bind this store off the given component-key * @param obj * @param key * @returns {Array.<*>} */ {...} /** * Bind this store changes to the given component-key * @param obj {React.Component|Store|function) * @param key */ {...} /** * get a store-key pair for Store::map * @param * @returns {{store: Store, name: *}} */ {...} {...}