meteoredux
A small package that make Redux connected with Meteor, in Redux way. Inspired by Meteor React Packages.
Briefly, when the data you subscribed from Meteor changed :
- Meteor will notify a Tracker
- In Tracker, meteoredux dispatch an internal Action to Redux
- Redux call the meteoredux-wrapped Reducer
- In wrapped Reducer, meteoredux re-get the data then update it into Redux state
- You access the Redux State to get the updated data
Usage
1. Define your Meteor queries in Reducer
const initialState = {}; { } { return todos: Todos }todos reactiveData;
2. Connect your Redux store to Meteor
index.js
; Meteor; let combinedReducers = ;let store = ; ;
Do not connect to Meteor twice.
3. Done!
Retrieve your Meteor data in Redux's state just like something else.
let todos = storetodos;
Or when used multi reducers
let todos = storetodoReducerstodos;