2.0.0 • Published 3 years ago
atom-rdt v2.0.0
redux dev tools for js-atom v2
import atom from 'js-atom';
import atomReduxDevTools, { init } from 'atom-rdt';
const APP_VERSION = 1.0.1
// Optional config
init('logrocketApiKey', APP_VERSION);
// Setup
const store = createAtom({});
store.addWatch('rdt-watcher', atomReduxDevTools);
// Reducer
function myReducer(somethingNew) {
return store.swap(oldState => ({ ...oldState, somethingNew }), 'my-action-type');
}