0.3.6 • Published 6 years ago
babel-plugin-s2s-initial-state-creater v0.3.6
babel-plugin-s2s-initial-state-creater
s2s plugin: create initial-state from flow info
Install
$ npm install --save-dev babel-plugin-s2s-initial-state-creater
Example
IN:
// @flow
type Count = number
type State = { count: Count, isLoading: boolean }
const initialState: State = {}
OUT:
// @flow
type Count = number
type State = { count: Count, isLoading: boolean }
const initialState: State = { count: 0, isLoading: false }
Usage
{
['s2s-initial-state-creater']
}
Options
from
type: string
required: true
Set target.js path
If you use s2s
, you don't use this option. s2s handle it automatically.