New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ember-wormhole-action

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-wormhole-action

An Ember Addon for sending actions sideways.

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

Ember Wormhole Action

Nearly always state in an Ember application should be managed by following the 'data down, actions up' paradigm. However there are some rare cases where it is reasonable to send actions sideways. Ember wormhole action provides provides a clean interface for doing so.

Installation

ember install ember-wormhole-action

Usage

  • Make a component wormhole actionable using mixin:wormhole-actionable
  • Use helper:wormhole-action to send an action sideways

mixin:wormhole-actionable

To make an action on a component wormhole actionable (1) mixin the wormhole-actionable mixin and (2) define a wormholeActionableActions property on the class.

wormholeActionableActions should be an array of POJO's each of which defines action and name properties.

  • action is the action defined in the component
  • name is what becomes 'wormhole actionable' and should be less generically named than action
import Ember from 'ember';
import WormholeActionable from 'ember-wormhole-action/mixins/wormhole-actionable';

export default Ember.Component.extend(WormholeActionable, {
  wormholeActionableActions: [
    {action: 'open', name: 'openDrawer'}
  ],

  actions: {
    open(item) {
      // ...
    }
  }
});

helper:wormhole-action

Use the helper to call a wormhole actionable action. Note that wormhole-action will accept params to pass to the action.

<button onClick={{wormhole-action 'openDrawer' item}}>Open</button>

Keywords

ember-addon

FAQs

Package last updated on 19 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts