Enum
Extends:
Unobservable → Enum
Base enum class
Example:
const Colors = new Enum(['RED', 'BLACK', 'GREEN', 'WHITE', 'BLUE']);
const Answers = new Enum({
YES: true,
NO: false,
// Passing functions as values will turn them into getters
// Getter results will appear in ::values
MAYBE: () => Math.random() >= 0.5,
});
const FontStyles = new Enum(['italic', 'bold', 'underline', 'regular'], true);
FontStyles.ITALIC === 'italic'
FontStyles.BOLD === 'bold'
// etc...
Constructor Summary
Public Constructor | ||
public |
constructor(enums: Object<String, *>|Array<String>, auto: boolean) |
Method Summary
Public Methods | ||
public |
List enum keys |
|
public |
List enum values |
Inherited Summary
From class Unobservable | ||
public get |
Overrides the |