0.1.10 • Published 4 years ago

plo v0.1.10

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

PLO

Plain Javascript Object State Container

Install

npm i plo

Example

Define Object with state, getter and setter. Subscribe the model and just use it.

import { createModel } from 'plo'

const [helloModel, helloSubscribe] = createModel({
  state: ['hello'],
  addState(state) {
    this.state.push(state)
  },
  getState() {
    return this.state.join(' ')
  },
})

helloSubscribe(model => {
  console.log(model.getState())
})

helloModel.addState('world')

How

Only methods that start with "get" do not publish the model

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago