Eliot Gevers
Eliot Gevers2mo ago

ctx.runAction inside docs

I was reading the docs and I came across ctx.runAction, this is not correct right? I thought that you could only call an action from something like a mutation with:
await ctx.scheduler.runAfter(0, internal.yourModule.yourAction, {
// action arguments here
});
await ctx.scheduler.runAfter(0, internal.yourModule.yourAction, {
// action arguments here
});
No description
1 Reply
mikeysee
mikeysee2mo ago
Hey! Yes you are correct, if you are in a mutation then you can only call an action using the scheduler but if you are already in an action you have this runAction function on the context you can use. But as the docs suggest, you really only shoud use that to navigate the two runtimes so probably a rare case
No description

Did you find this page helpful?