0.1.3 • Published 7 years ago

ember-literal v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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!

0.1.3

7 years ago

0.1.2

8 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

10 years ago