actus-ember
v0.12.1-alpha.0
Published
Ember bindings for actus
Downloads
8
Readme
actus-ember
Ember bindings for actus
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 updatingthis.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 withnull
- 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