2.2.4 • Published 8 years ago

noflux v2.2.4

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Build Status

noflux

a simple top down data flow implementation.

install

npm install noflux

usage

import {connect, state} from "noflux";
import React from "react";

state.load({
  name: 'jack'
});

@connect
export default class extends React.Component {
    render() {
        return (
            <div>
                <input onChange={e => state.set('name', e.target.value)} />
                <p> hello, my name is {state.get('name')} </p>
            </div>
        )
    }
}

The page will be refresh once the state changes.

API

connect

a function works as decrocation to bind a React class with state. state will emit change event after its modification and the instance of the class will be re-rendered.

pure

a function works as decrocation to make a React class as a pure render component even though you pass cursors as props.

state

A instance of dataton which implemented Copy-On-Write technique. You can:

  • load: load data into state.
  • set: set specific key-value for state.
  • get: get the correspond value for the provided key.
  • cursor: get the cursor from the provided path.

License

MIT

2.2.4

8 years ago

2.2.3

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.1.8

9 years ago

1.1.7

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago