Skip to content

Commit

Permalink
Merge pull request #36 from jhen0409/patch-5
Browse files Browse the repository at this point in the history
Add devTools.updateStore
  • Loading branch information
zalmoxisus authored Aug 4, 2016
2 parents 904e55c + 5ff88a1 commit 5b43f5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ export default function configureStore(initialState) {
devTools()
);
// Note: passing enhancer as last argument requires redux@>=3.1.0
return createStore(reducer, initialState, enhancer);
const store = createStore(reducer, initialState, enhancer);
// devTools will ignores other enhancers & middlewares
// update the store after creating / changing:
devTools.updateStore(store);
return store;
}
```

Expand Down Expand Up @@ -77,15 +81,19 @@ Example:
```js
export default function configureStore(initialState) {
// Note: passing enhancer as last argument requires redux@>=3.1.0
return createStore(
const store = createStore(
rootReducer,
initialState,
devTools({
name: 'Android app', realtime: true,
hostname: 'localhost', port: 8000,
maxAge: 30, filters: { blacklist: ['EFFECT_RESOLVED'] }
})
})
);
// devTools will ignores other enhancers & middlewares
// update the store after creating / changing:
devTools.updateStore(store);
return store;
}
```

Expand Down
4 changes: 4 additions & 0 deletions src/devTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,7 @@ export default function devTools(options = {}) {
};
};
}

devTools.updateStore = (newStore) => {
store = newStore;
};

0 comments on commit 5b43f5e

Please sign in to comment.