0.3.0 • Published 5 years ago

ember-actions-service v0.3.0

Weekly downloads
27
License
MIT
Repository
github
Last release
5 years ago

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.

0.3.0

5 years ago

0.2.0

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago