npm.io
0.3.6 • Published 8 years ago

babel-plugin-s2s-initial-state-creater

Licence
MIT
Version
0.3.6
Deps
6
Size
5 kB
Vulns
1
Weekly
0
Stars
265

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.