Skip to content

Make onComplete more type safe #2

Open
@sujayakar

Description

@sujayakar

It currently only has any for the function return type. Instead, we could have developers define the callback with an onComplete wrapper instead of internalMutation:

export const exampleCallback = onComplete({
  action: internal.index.exampleAction, 
  handler: async (ctx, args) => {
});

Then, args would have its type specified precisely.

To support custom functions, onComplete could take in internalMutation:

const onComplete = makeOnComplete(internalMutation);

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