UNPKG

nedux-logger

Version:

the next redux state management

18 lines 617 B
"use strict"; // import { useState, useEffect } from 'react'; // import { Store } from 'nedux'; // import { Subscription } from 'rxjs'; // type DefaultState = { [key: string]: any }; // export const createStoreHook = < // T extends DefaultState = DefaultState, // K extends keyof T = keyof T // >( // store: Store<T, K>, // ) => (key: K) => { // // const [value, setter] = useState(); // // useEffect(() => { // // const subscription = store.subscribe(key, { next: setter }); // // return () => (subscription as Subscription).unsubscribe(); // // }, [key]); // }; //# sourceMappingURL=store.js.map