Skip to content

khirayama/react-circuit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Circuit

Official React bindings for Circuit.

Installation

npm install --save @khirayama/react-circuit

Documentation

Documents

Examples

Ref: Examples

createStore({total: 0}, (state, action) => {
  switch (action.type) {
    case 'COUNT_UP':
      state.total += 1;
      break;
    case 'COUNT_DOWN':
      state.total -= 1;
      break;
    default:
      break;
  }
  return state;
});

export default class CountContainer extends Container {
  render() {
    return (
      <section>
        <h1>Count: {this.state.total}</h1>
        <CountButton onCountButtonClick={countUp(this.dispatch)}>Count up +1</CountButton>
        <CountButton onCountButtonClick={countDown(this.dispatch)}>Count down -1</CountButton>
      </section>
    );
  }
}

Releases

No releases published

Packages

No packages published