Skip to content

A slightly more idiomatic way to invoke actions in your Ember components

License

Notifications You must be signed in to change notification settings

cah-brian-gantzler/ember-invoke-action

Repository files navigation

ember-invoke-action

NPM Version Build Status Ember Observer Score

A slightly more idiomatic way to invoke actions in your Ember components.

Installation

ember install ember-invoke-action

How To

This add on places the method invokeAction on every component. This method will test for a closure action, and if none is found, it will return undefined

let x = invokeAction('onChange', newValue);

Required Actions

If an action is required for your component to work, you can add it the the array requiredActions. If an action is not passed, an error will be thrown.

  requiredActions: ['onChange']

If you wish to check for required parameters, the array 'requiredParams' is available.

Credits

This code was inspired by @miguelcobain, I just made an addon out of it.

About

A slightly more idiomatic way to invoke actions in your Ember components

Resources

License

Stars

Watchers

Forks

Packages

No packages published