0.0.1 • Published 6 years ago

choo-break v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Trigger re-renders at breakpoints

Usage:

var choo = require('choo')
var html = require('choo/html')
var choobreak = require('choo-break')

var app = choo()
app.use(choobreak())
app.route('/', function (state, emit) {
  return html`<body>${state.breakpoint}</body>`
})
app.mount('body')

API

plugin = choobreak(breakpoints, render)

  • breakpoints desired breakpoints
  • render should app re-render on breakpoint change
choobreak({
  xs: 0,
  sm: 768,
  md: 1024,
  lg: 1280
}, true)

Todo

  • Allow args in any order
  • Set state key
  • Test
  • Publish