Skip to content

Make onComplete more type safe #2

@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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions