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