Skip to content

How do you send data to a promise invocation? #1329

Discussion options

You must be logged in to vote

You can use data to do that:

// ...
invoke: {
  src: 'fetchUser',
  data: { id: (ctx) => ctx.userId }
},

// ...

services: {
  fetchUser: (ctx, event, { data }) => {
    return fetchUserFromAPI(data.id);
  }
}

Or do you mean something else? Can you show in code what you want to do?

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@mattpeskett
Comment options

@davidkpiano
Comment options

@mattpeskett
Comment options

@Andarist
Comment options

@mattpeskett
Comment options

Answer selected by mattpeskett
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants