Skip to content
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.

Redux native component provides a base component to watch your store and trigger rendering method without using react.

License

Notifications You must be signed in to change notification settings

ricardoarchive/native-redux-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Redux native component provides a base component to watch your store and trigger rendering method without using react.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published