0.0.16 • Published 9 years ago

fluxive v0.0.16

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

Fluxive

Flux-like MVB(MVVM) Library

Installation

npm install fluxive

Difference between Fluxive and Flux

Flux defines data flow as:

Action → Dispatcher → Store → View → Action → ...

But, Fluxive defines data flow as:

        (Model)
           ↓
Action → Binder → View → Action → ...

Notice:

  • Binder is Dispacher, and also Store in Flux.
  • Model is maybe unnecessary, but if you feel data store becoming more complex, you can use Model to solve its complexity.

Simple example

Create Action

let fooAction = Fluxive.Action(input => {
  let output = /* some code */;
  return output;
});

Create Binder

class FooBinder extends Fluxive.Binder {
  constructor() {
    super();
    this.state = {
      fooInfo: 'initial foo'
    };
    this.on(fooAction, output => {
      this.setState({fooInfo: output});
    });
  }
}

Create Component

class FooHandler extends Fluxive.Component {
  constructor(props) {
    super(props);
    this.involve(FooBinder);
  }
  render() {
    let {binder} = this;
    return (
      <p>Foo info: {binder.get('fooInfo')}</p>
    );
  }
}

More details

Preparing

LICENSE

MIT

0.0.17

9 years ago

0.0.16

9 years ago

0.0.15

9 years ago

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago