Skip to content

Can triggers run asynchronously? #736

Description

@yanickrochon

Is it possible to run triggers asynchronously?

For exampls :

FlowRouter.route('/home', {
  // calls just before the action
  triggersEnter: [checkPermissions],
  action: function() {
    // do something you like
  }
});

function checkPermissions(context, redirect, stop) {
  return http.get('/path/to/service', params).catch(e => {
    stop();
  });
}

Where the action does not get executed unto the Promise is resolved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions