@mainmatter/ember-api-actions

0.6.0 • Public • Published

@mainmatter/ember-api-actions

This is an Ember.js addon allowing you to easily implement non-CRUD actions for your Ember Data models.

Compatibility

  • Ember.js v3.28 or above
  • Ember CLI v3.28 or above
  • Node.js v14 or above

Installation

ember install @mainmatter/ember-api-actions

Usage

import Model from '@ember-data/model';
import { apiAction } from '@mainmatter/ember-api-actions';

class User extends Model {
  async follow() {
    return await apiAction(this, { method: 'PUT', path: 'follow' });
  }
}

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Dependents (1)

Package Sidebar

Install

npm i @mainmatter/ember-api-actions

Weekly Downloads

546

Version

0.6.0

License

MIT

Unpacked Size

9.96 kB

Total Files

6

Last publish

Collaborators

  • mainmatter