ember-actions-service

0.3.0 • Public • Published

ember-actions-service

ember-actions-service is an Ember Addon to wrap common store and model methods with ember-concurrency tasks and making them available as a service.

Build Status Maintainability Test Coverage Ember Observer Score

Usage

Blueprint:

ember g actions-service user

Route

import Ember from 'ember';
import { actionsMixin } from 'ember-actions-service';
 
export default Ember.Route.extend(actionsMixin('user'), {});

Template using route-actions

{{user-editor saveAction=(route-action "userActions" user "save")}}

Actions

The following actions perform a ember-concurrency task and return a task instance.

  • find
  • findAll
  • create
  • save
  • delete
  • unload
  • rollback

Custom Actions

To implement a new action just include a new task into the service generated following the format bellow:

  doSomethingTask: task(function * (store, callback, model){
    updatedModel = yield doSomething(model);
    return { callback, model: updatedModel };
  })

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above

Installation

ember install ember-actions-service

License

This project is licensed under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i ember-actions-service

Weekly Downloads

1

Version

0.3.0

License

MIT

Unpacked Size

9.56 kB

Total Files

12

Last publish

Collaborators

  • lamabiker
  • tarmann