ember-literal

0.1.3 • Public • Published

ember-literal

Greenkeeper badge

Build Status Dependency Status devDependency Status Ember Observer Score Code Climate

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

  1. Use it via the Ember namespace
Ember.literal
  1. 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:

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

Thanks!

Readme

Keywords

Package Sidebar

Install

npm i ember-literal

Weekly Downloads

0

Version

0.1.3

License

MIT

Last publish

Collaborators

  • northm