open-index/open-npm huggingface dataset:
npm package: @myoshida/fluxion
Description: An EventEmitter-based layman's Flux implementaion
Author: Masakazu Yoshida
Latest version: 0.2.1

# Fluxion

An EventEmitter-based layman's Flux implementaion

## Installation

```shell
  npm install @myoshida/fluxion --save
```

## Basic Usage ("Hello World")

```javascript
import React from 'react';
import ReactDOM from 'react-dom';
import { Component, createStore, next } from 'fluxion';

class MyComponent extends Component {
  render() {
    return (
      <div>
        <span>Counter: {this.props.count} </span>
        <button onClick={() => this.dispatch('inc')}>INC</button>
      </div>
    );
  }
}
MyComponent.propTypes = {
  count: React.PropTypes.number.isRequired,
};

const store = createStore({
  actions: {
    inc: ({ val = 1 }) => {
      store.update(state => {
        const { count } = state;
        return next(state, { count: count + val });
      });
    },
  },
  renderer(state, provider) {
    return ReactDOM.render(
      provider(<MyComponent {...state} />),
      document.getElementById('example'));
  },
});

store.update(() => { count: 0 });	// this fires rendering
```

## Release History

* 0.2.1 Maintenance release
* 0.2.0 Added some APIs
* 0.1.0 Initial release (preliminary)