The OrderedSet class lets you store unique values of any type, whether
primitive values or object references. It is mostly similar to the native
Set
class introduced in ES2015.
- Ember.js v3.8 or above
- Ember CLI v2.13 or above
- Node.js v10 or above
ember install @ember/ordered-set
After installing you can import OrderedSet from @ember/ordered-set:
import OrderedSet from '@ember/ordered-set';The OrderedSet class has mostly the same API as the native Set
class with a few differences:
- The constructor does not take any arguments
- A static
create()method exists for symmetry withEmber.Object - A static
lengthproperty does not exist onOrderedSet OrderedSethas anisEmpty()method- There are no
entries(),keys()andvalues()methods, but there is atoArray()method instead - The
@@iteratorsymbol is not defined OrderedSethas acopy()method
See the Contributing guide for details.
ember-ordered-set is licensed under the MIT License.