1.1.0 • Published 9 years ago
virtual-progress v1.1.0
virtual-progress 
Animated, randomized progress bar built with virtual-dom
Install
$ npm install --save virtual-progressUsage
var Progress = require('virtual-progress')
var state = Progress()
var vtree = Progress.render(state)API
Progress([data]) -> function
data
Required
Type: object
Initial state data for the component. Returns an observable state ({active, value}.
Progress.start(state) -> undefined
Starts the progress meter, ticking the value every 200ms.
Progress.stop(state) -> undefined
Stops the progress meter.
Progress.reset(state) -> undefined
Stops the progress meter and resets it to {value: 0}.
Progress.done(state) -> undefined
Animates the progress meter to its final state ({value: 1, active: false}).
Progress.onComplete(state, listener) -> function
The listener is called when the progress bar's value is 1 and its transition ends.
Returns an unlisten function.
License
MIT © Ben Drucker