1.1.0 • Published 7 years ago

@ricardo-ch/native-redux-component v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

npm version

native-redux-component

Want to use redux without using react ? Redux Component is a native implementation of react component which permits to watch your state and trigger render() method of your child component whenever it changes.

It also has the ability to render only when parts of the state change.

And cherry on the cake, the code is build with the universal module definition

Features

  • Watch all state change and trigger render()
  • Render only when properties paths change
  • Keep up to date for properties paths without rendering

Install

npm install @ricardo-ch/native-redux-component

Usage

Create a component listening and rendering a specific part of your app:

class MyComponent extends ReduxComponent {
  constructor(store) {
    super(store, ['todos'])
  }

  render() {
    // triggered each time 'todos' property of the state change
    ...

    // if needed dispatch a new change
    this.dispatch(myAction(value))
  }
}

Demo

A simple app to create toto tasks has been created in this repository. To use it, simply open demo/src/index.htmlin your favorite browser.

License

native-redux-component is licensed under the MIT license. (http://opensource.org/licenses/MIT)

1.1.0

7 years ago

1.0.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago