Skip to content

Commit

Permalink
Added readme documentation to mobileMiddleware.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Nov 13, 2017
1 parent cd2f040 commit 56d9bbe
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions editor/utils/mobile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
mobileMiddleware
===========

`mobileMiddleware` is a very simple [redux middleware](https://redux.js.org/docs/advanced/Middleware.html) that sets the isSidebarOpened flag to false on REDUX_REHYDRATE payloads.
This useful to make isSidebarOpened false on mobile even if the value that was saved to local storage was true.
The middleware just needs to be added to the enhancers list:

```js
const enhancers = [
...
applyMiddleware( mobileMiddleware ),
];
...
const store = createStore( reducer, flowRight( enhancers ) );
```

0 comments on commit 56d9bbe

Please sign in to comment.