ember-cli-rison

0.3.0 • Public • Published

Ember-cli-rison

Include rison in an ember-cli app.

This addon uses rison-node as its NPM rison dependency.

Usage

Computed Property Macros

Ships with the following computed property macros: risonEncode, risonDecode.

import Component from '@ember/component';
import risonEncode from 'ember-cli-rison/computeds/rison-encode';

export default Component.extend({
  encoded: risonEncode('value')
});

Handlebars Helpers

{{rison-encode value}} {{!-- encode value in RISON --}}
{{rison-decode value}} {{!-- decode RISON value --}}

Helpers in components

import Component from '@ember/component';
import { risonEncode } from 'ember-cli-rison/helpers/rison-encode';
import { risonDecode, safeRisonDecode } from 'ember-cli-rison/helpers/rison-decode';

export default Component.extend({

  didReceiveAttrs() {
    this._super(...arguments);
    this.set('decoded', safeRisonDecode(this.get('encoded')));
  },

  actions: {
    update(value) {
      this.get('update')(risonEncode(value));
    }
  }
});

ES6 Rison

This addon provides the ability to import rison as an ES6 module.

import rison from 'rison';

Installation

  • git clone <repository-url> this repository
  • cd ember-cli-rison
  • npm install

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://ember-cli.com/.

Readme

Keywords

Package Sidebar

Install

npm i ember-cli-rison

Weekly Downloads

2

Version

0.3.0

License

MIT

Unpacked Size

7.09 kB

Total Files

12

Last publish

Collaborators

  • panthony