Marcisbee / radi

🌀Tiny (in size) front-end framework with no extra browser re-flows
https://radi.js.org
MIT License
948 stars 34 forks source link

Adds `Subscribe` #37

Closed Marcisbee closed 6 years ago

Marcisbee commented 6 years ago

Example usage

Subscribes to any EventTarget, transforms data and injects into store.

const mouseEvent = new Subscribe(document).on('mousemove', ({x, y}) => ({x, y}))

const tracker = new Store({
  mouse: mouseEvent({x: 0, y: 0}),
})