ember-route-orchestrate

0.0.1 • Public • Published

ember-route-orchestrate

ember-route-orchestrate allows you to schedule actions to run after a hook in another route.

Installation

  • npm install ember-route-orchestrate

Usage

Please note that this was developed for an experimental idea that I have been working on. This addon has very limited genuine use cases that do not go against DDAU.

  • Extend the target route from OrchestratedRoute.
import OrchestratedRoute from 'ember-route-orchestrate/routes/orchestrated';

export default OrchestratedRoute.extend({
});
  • This addon injects an orchestrator service with a method callAction into all routes. Schedule the action on the target route from the source route using callAction.
  this.get('orchestrator').callAction('actionName', {
      hook: 'anyOfEmberRouteHooks',
      route: 'targetRouteName',
      // action `actionName` will be called on 3 route visits.
      // if times is not provided, default value of 1 will be applied.
      // you can also set the value of times as 'forever'.
      times: 3,
      // optional params for the action.
      params: { hello: 'world' }
    });

License

MIT - Sivasubramanyam A

Readme

Keywords

Package Sidebar

Install

npm i ember-route-orchestrate

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

7.27 kB

Total Files

11

Last publish

Collaborators

  • astronomersiva