@narrative/babel-plugin-compiler

1.1.0 • Public • Published

@narrative/babel-plugin-compiler

The compiler for @narrative/control-flow.

Usage

npm install @narrative/babel-plugin-compiler

.babelrc:

{
  "plugins": ["@narrative/compiler"]
}

How it works

<If when={index > 5}>
  <li>{todo * 2}</li>
  <ElseIf when={index > 10}>
    <li>{todo * 3}</li>
  </ElseIf>
</If>

Compiled      

index > 5 ? <li>{todo * 2}</li> : index > 10 ? <li>{todo * 3}</li> : null

Readme

Keywords

none

Package Sidebar

Install

npm i @narrative/babel-plugin-compiler

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

34.1 kB

Total Files

11

Last publish

Collaborators

  • joe_sky