compose redux State type
$ npm install babel-plugin-redux-state-compose
// @flow
import type { State as HogeState } from './Hoge/reducer'
export type State = {
hoge: HogeState,
}
App/reducer.js
// @flow
export type State = { app: string }
export const initialState: State = { app: 'app' }
// @flow
import type { State as AppState } from './App/reducer';
import type { State as HogeState } from './Hoge/reducer';
export type State = {
App: AppState;
Hoge: HogeState;
};
{
"plugins": [["redux-store-compose", {input: 'App/reducer.js'}]]
}
MIT © akameco