1.1.1 • Published 10 years ago

simple-status v1.1.1

Weekly downloads
5
License
MIT
Repository
github
Last release
10 years ago

Simple Status

Installation

npm install simple-status --save-dev

Example Usage

var SimpleStatus = require('simple-status');

// Initialize with all possible statuses and optional initial current status.
// If no initial status is given, the initial current status will default to
// the first value in the array

var status = new SimpleStatus(['READY', 'STEADY', 'GO'], 'READY');
console.log(status.current);  // 'READY'

// Set status, note, status is given properties equal to statuses

status.set(status.STEADY);
console.log(status.current);  // 'STEADY'

// Setting status to unknown status throw exception

status.set('SOMETHING_UNKNOWN'); // Exception thrown

// Get readonly object of statuses

var readOnlyStatuses = status.getStatuses();
console.log(readOnlyStatuses.READY);  // 'READY'
readOnlyStatuses.set('STEADY'); // Exception thrown

Build

webpack

Test

karma start karma.config.js
1.1.1

10 years ago

1.1.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago