0.1.3 • Published 7 years ago
ember-literal v0.1.3
ember-literal
This README outlines the details of collaborating on this Ember addon.
Use
literal
is a way of disambiguating between literals and property keys when using computed properties.
import l from 'ember-literal/macros/literal';
import among from 'ember-cpm/macros/among'; // from the wonderful ember-cpm library
var and = Ember.computed.and;
var MyOtherType = Ember.Object.extend({
isServerReady: false,
userInput: 'ready',
ready: and('isUserReady', 'isServerReady'),
isUserReady: among( // NOTE: among doesn't have composed macro support, but it soon will!
'userInput' // property key
l('ready'), // literal (this would otherwise be ambiguious without using "literal")
l('good'), // literal
l('fine'), // literal
l('satisfactory'), // literal
l('rad') // literal
)
});
You can use literal
in your project two ways
- Use it via the
Ember
namespace
Ember.literal
- Import the macro directly
import literal from 'ember-literal/macros/literal';
CDN
Tagged releases are automatically uploaded to a CDN for light development use. Do not rely on these for production
Examples:
- Globals: https://ember-ui.s3.amazonaws.com/ember-literal/globals/ember-literal-v0.0.1-beta.1.js
- AMD: https://ember-ui.s3.amazonaws.com/ember-literal/named-amd/ember-literal-v0.0.1-beta.1.amd.js
Installation
git clone
this repositorynpm install
bower install
Running
ember server
- Visit your app at http://localhost:4200.
Running Tests
ember test
ember test --server
Building
ember build
Thanks!
- @hjdavid for documenting his thoughts on the subject of Ember.literal
- @stefanpenner for his tremendous work on ember-cli
- @jamesarosen and @cibernox for supporting my work on composable computed property macros