VS Code warning: cancelRetry is never used in the machine definition
My machine:
const authMachine = createMachine(
{
id: "authenticationMachine",
tsTypes: {} as import("./consumer.typegen").Typegen0,
initial: "newPage",
states: {
//...
captcha2: {
id: "captcha2",
initial: "notSent",
states: {
notSent: {
on: {
SEND: "sent",
},
},
sent: {
invoke: {
src: "sendCaptchaChallenge",
onDone: "solving",
},
},
solving: {
invoke: {
src: "solveCaptcha",
},
on: {
SOLVED: "solved",
},
after: {
[CAPTCHA_RECHECK]: {
target: "solving",
internal: true,
},
[CAPTCHA_TIMEOUT]: {
target: "loginScreen",
// call cancelRetry in parent machine
actions: "cancelRetry",
},
},
},
solved: {
type: "final",
},
},
// after final state, go back to login screen
onDone: "emailVerification",
after: {
[CAPTCHA_TIMEOUT]: "loginScreen",
},
},
emailVerification: {
invoke: {
src: "verifyEmail",
onDone: "authenticated",
onError: "emailVerification",
},
},
authenticated: {
entry: ["startReceivingMessages"],
type: "final",
},
},
},
{
actions: {
//
cancelRetry: (context, event) => {},
},
guards: {
// ...
},
services: {
// ...
},
}
);
How do I call cancelRetry
from the child state machine?