Polyfills the tracked storage primitive from Ember/Glimmer.
import { createStorage, getValue, setValue } from 'ember-tracked-storage-polyfill';
let storage = createStorage(true);
getValue(storage); // true
setValue(storage, false);
getValue(storage); // false
See the RFC for more details. Imports should be from the polyfill itself, not the path from Ember in the RFC:
// right
import { createStorage, getValue, setValue } from 'ember-tracked-storage-polyfill';
// wrong
import { createStorage, getValue, setValue } from '@glimmer/tracking/primitives/storage';
The extra complexity required to polyfill the import path as it will be in Ember itself is not compatible with Embroider, and generally not worth it. This import path will begin re-exporting from Ember as soon as the real version is available, making the transition seamless.
- Ember.js v3.15 or above
- Ember CLI v3.20 or above
- Node.js v10 or above
ember install ember-tracked-storage-polyfill
See the Contributing guide for details.
This project is licensed under the MIT License.