0.1.5 • Published 4 years ago

react-plo v0.1.5

Weekly downloads
11
License
MIT
Repository
github
Last release
4 years ago

REACT-PLO

npm i react-plo

Example

import React from 'react';
import { createModel } from 'plo'
import { connect } from 'react-plo'

const [counterModel, counterSub] = createModel({
  count: 0, 
  getCount() {
    return this.count
  },
  inc() { 
    this.count += 1 
  },
  dec() {
    this.count -= 1
  }
})

function App() {
  return (
    <div>
      <button onClick={counterModel.inc}>+</button>
      <button onClick={counterModel.dec}>-</button>
      count: {counterModel.getCount()}
    </div>
  );
}

export default connect([counterSub])(App);
0.1.4

4 years ago

0.1.3

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago