diff --git a/tutorial/05-redux-immutable-fetch.md b/tutorial/05-redux-immutable-fetch.md index 713fb5dbc40e0fd626839ae813642324ee1f371f..65bc2b2d8b0c39afe92f7eff9aa35af43df66a44 100644 --- a/tutorial/05-redux-immutable-fetch.md +++ b/tutorial/05-redux-immutable-fetch.md @@ -46,8 +46,6 @@ console.log(immutablePerson) - Run `yarn add immutable` -**Note**: Due to the implementation of ImmutableJS, Flow does not accept importing it with `import Immutable from 'immutable'`, so use this syntax instead: `import * as Immutable from 'immutable'`. Let's cross fingers for a [fix](https://github.com/facebook/immutable-js/issues/863) soon. - ## Redux > 💡 **[Redux](http://redux.js.org/)** is a library to handle the lifecycle of your application. It creates a *store*, which is the single source of truth of the state of your app at any given time. @@ -75,7 +73,8 @@ This file exposes an *action*, `SAY_HELLO`, and its *action creator*, `sayHello` ```js // @flow -import * as Immutable from 'immutable' +import Immutable from 'immutable' +import type { fromJS as Immut } from 'immutable' import { SAY_HELLO } from '../action/hello' @@ -83,7 +82,7 @@ const initialState = Immutable.fromJS({ message: 'Initial reducer message', }) -const helloReducer = (state: Object = initialState, action: { type: string, payload: any }) => { +const helloReducer = (state: Immut = initialState, action: { type: string, payload: any }) => { switch (action.type) { case SAY_HELLO: return state.set('message', action.payload) @@ -412,7 +411,8 @@ Let's handle these different actions in `src/client/reducer/hello.js`: ```js // @flow -import * as Immutable from 'immutable' +import Immutable from 'immutable' +import type { fromJS as Immut } from 'immutable' import { SAY_HELLO, @@ -426,7 +426,7 @@ const initialState = Immutable.fromJS({ messageAsync: 'Initial reducer message for async call', }) -const helloReducer = (state: Object = initialState, action: { type: string, payload: any }) => { +const helloReducer = (state: Immut = initialState, action: { type: string, payload: any }) => { switch (action.type) { case SAY_HELLO: return state.set('message', action.payload) diff --git a/tutorial/06-react-router-ssr-helmet.md b/tutorial/06-react-router-ssr-helmet.md index 539b54756b04acd607b430e498f54bb2cb3ab078..cb215abb1e86c4f5bfeb3f80756cf1906b60236e 100644 --- a/tutorial/06-react-router-ssr-helmet.md +++ b/tutorial/06-react-router-ssr-helmet.md @@ -303,7 +303,7 @@ Here is our controller. It would typically make business logic and database call ```js // @flow -import * as Immutable from 'immutable' +import Immutable from 'immutable' import { createStore, combineReducers, applyMiddleware } from 'redux' import thunkMiddleware from 'redux-thunk' @@ -408,7 +408,7 @@ export default renderApp - Edit `src/client/index.jsx` to use that preloaded state: ```js -import * as Immutable from 'immutable' +import Immutable from 'immutable' // [...] /* eslint-disable no-underscore-dangle */