Ember Seamless Immutable
"Immutable data structures which are backwards-compatible with normal Arrays and Objects" provided by the excellent Seamless Immutable library, wrapped and adapted for Ember.
⚠️ Experimental. A noop function is defined on all objects made immutable to circumvent Ember defining meta properties on them.
⚠️ Array prototype extension incompatiblity. This add-on is incompatible with the Ember array prototype extension. For instructions on disabling prototype extensions consult the Ember guide.
Why Addon?
- Seamless-immutable is imported from node_modules to Ember app (i.e., up-to-date, not bundled)
- Seamless-immutable is configured to your Ember app environment
- Immutable objects are made usable in Ember templates
- Helper that makes properties passed to a component immutable
Installation
ember install ember-seamless-immutable
Usage
;; Route;
The default export immutable
is adapted for Ember. The original named export remains intact:
import { Immutable } from 'immutable';
See Seamless Immutable: API Overview.
Helper
{{contact-detail contact=(immutable contact)}}
An immutable contact object will be passed in to the component.
Running Tests
ember test
ember test --server