Skip to content

Restore the userCreated event#1441

Merged
wyattjoh merged 7 commits intomasterfrom
restore-new-user-event
Mar 15, 2018
Merged

Restore the userCreated event#1441
wyattjoh merged 7 commits intomasterfrom
restore-new-user-event

Conversation

@wyattjoh
Copy link
Copy Markdown
Contributor

@wyattjoh wyattjoh commented Mar 12, 2018

What does this PR do?

An example of utilizing the new event is as follows:

module.exports = {
  connect(connectors) {
    const { graph: { subscriptions: { getBroker } } } = connectors;
    
    // Get the handle for the broker.
    const broker = getBroker();

    // The passed in method will fire for every user that is created.
    broker.on('userCreated', user => {
      // Do something with the user...
    });
  },
};

You can also listen with a graph subscription to userCreated.

Note: External plugins utilizing the Users service's user create methods must adjust their call signatures to pass in the context.

Copy link
Copy Markdown
Contributor

@alinhle alinhle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wyattjoh wyattjoh merged commit c9ec5ca into master Mar 15, 2018
@wyattjoh wyattjoh deleted the restore-new-user-event branch March 15, 2018 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Event service no longer exists, not sure how to trigger on events now

3 participants