Skip to content

Commit 94f7e53

Browse files
nik72619czalmoxisus
authored andcommitted
Updated documentation: SSR and typescript support (#692)
1 parent 879c115 commit 94f7e53

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ For a basic [Redux store](http://redux.js.org/docs/api/createStore.html) simply
4343
Note that [`preloadedState`](http://redux.js.org/docs/api/createStore.html) argument is optional in Redux's [`createStore`](http://redux.js.org/docs/api/createStore.html).
4444

4545
> For universal ("isomorphic") apps, prefix it with `typeof window !== 'undefined' &&`.
46+
```js
47+
const composeEnhancers = (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose;
48+
```
4649

4750
> For TypeScript use [`redux-devtools-extension` npm package](#13-use-redux-devtools-extension-package-from-npm), which contains all the definitions, or just use `(window as any)` (see [Recipes](/docs/Recipes.md#using-in-a-typescript-project) for an example).
51+
```js
52+
const composeEnhancers = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
53+
```
4854

4955
In case ESLint is configured to not allow using the underscore dangle, wrap it like so:
5056
```diff

0 commit comments

Comments
 (0)