1.1.0 • Published 8 years ago

virtual-progress v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

virtual-progress Build Status

Animated, randomized progress bar built with virtual-dom

Install

$ npm install --save virtual-progress

Usage

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