npm

babel-plugin-s2s-initial-state-creater

0.3.6 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-s2s-initial-state-creater

Weekly Downloads

4

Version

0.3.6

License

MIT

Unpacked Size

4.92 kB

Total Files

6

Last publish

Collaborators

  • akameco