-
Notifications
You must be signed in to change notification settings - Fork 13
Working With Stream
James Yang edited this page Dec 14, 2016
·
1 revision
cssobj can use with stream libs like flyd, when stream update, it will auto update CSS.
// html: <input><button>
import flyd from 'flyd'
import cssobj form 'cssobj'
const obj=flyd.stream({ p: {color: 'grey'} })
const result = obj.map(cssobj(obj()).update)
button.onclick = _ => obj({
p: { color: input.value }
})
When user click on button, the color value will be applied to CSS, automatically.
Also, you can try flyd.combine
, flyd.merge
, flyd.scan
, any thing javascript can does.