actus-ember

0.12.1-alpha.0 • Public • Published

actus-ember

Ember bindings for actus

npm version

Included and preconfigured plugins

Install

npm install actus-ember

Examples

Usage

import Service from "@ember/service";
import { tracked } from "@glimmer/tracking";
import actusify from "actus-ember";

export default class ExampleService extends Service {
  @tracked state = {...};

  actions = {...};

  constructor(...args) {
    super(...args);

    actusify(this);
  }
}

Why choose actus-ember

  • actus promotes and facilitates the usage of the Immutable Pattern recommended by the official Glimmer docs for writing "maintainable, understandable components"
  • actus promotes declaring actions (functions that change the state object) separately and beforehand instead of updating this.state ad-hoc and all over the place
  • preconfigured freeze plugin prevents violation of the Immutable Pattern (prevents mutation of this.state)
  • preconfigured defaultActions plugin eliminates the need of implementing simple actions like toggling booleans, setting values, resetting values, etc. while following the Immutable Pattern
  • defaultActions plugin promotes the usage of non-null default empty values ("" for strings, [] for arrays, etc.) because defaultActions doesn't work with null
  • preconfigured logger plugin significantly improves developer experience by providing detailed info to the console on every state change

actus-ember vs ember-redux

  • no boilerplate
  • smaller, simpler API
  • built-in support for async actions with automatic loading states and error handling

Readme

Keywords

Package Sidebar

Install

npm i actus-ember

Weekly Downloads

1

Version

0.12.1-alpha.0

License

MIT

Unpacked Size

5.08 kB

Total Files

4

Last publish

Collaborators

  • evgenyorekhov