1.0.1 • Published 7 years ago

yo-yo-collection v1.0.1

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

yo-yo-collection

Keep a collection of yo-yo components.

Install

npm install yo-yo-collection

Why

Needed a way to handle state and update of multiple small yo-yo components. Inspired by choo.

Example

const collection = new Collection()

// Add a component to the collection
collection.component(function (state, bus) {
  return yo`<div>${state.data}</div>`
})

// Add a store
collection.store(function (state, bus) {
  bus.on('data', function (data) {
    state.data = data
    bus.emit('rerender')
  })
})

License

MIT

1.0.1

7 years ago

1.0.0

7 years ago