observ-enum
Observable value that can only accept a preset list of values
Install
$ npm install --save observ-enum
Usage
var Enum = var Color = var color = //=> ok! color//=> throws!
API
Enum(values)
-> function
Returns an observable that behaves normally unless non-enumerated values are passed in.
values
Required
Type: array[string]
Allowed string values for the enum.
License
MIT © Ben Drucker