KMsgHooks
Defined in: packages/messaging/src/hooks.ts:43
Properties
Section titled “Properties”onBeforeSend?
Section titled “onBeforeSend?”
optionalonBeforeSend?: (context) =>void|Promise<void>
Defined in: packages/messaging/src/hooks.ts:48
Runs before the provider is called. Throwing aborts the send and rejects the call.
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”void | Promise<void>
onError?
Section titled “onError?”
optionalonError?: (context,error) =>void|Promise<void>
Defined in: packages/messaging/src/hooks.ts:53
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”void | Promise<void>
onFinal?
Section titled “onFinal?”
optionalonFinal?: (context,state) =>void|Promise<void>
Defined in: packages/messaging/src/hooks.ts:63
Parameters
Section titled “Parameters”context
Section titled “context”Returns
Section titled “Returns”void | Promise<void>
onHookError?
Section titled “onHookError?”
optionalonHookError?: (error,info) =>void|Promise<void>
Defined in: packages/messaging/src/hooks.ts:72
Receives errors thrown by the observer hooks (every hook except
onBeforeSend). Those errors never change the send result. Without this
hook, or when it throws too, they are written to console.error.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”void | Promise<void>
onQueued?
Section titled “onQueued?”
optionalonQueued?: (context,result) =>void|Promise<void>
Defined in: packages/messaging/src/hooks.ts:54
Parameters
Section titled “Parameters”context
Section titled “context”result
Section titled “result”Returns
Section titled “Returns”void | Promise<void>
onRetryScheduled?
Section titled “onRetryScheduled?”
optionalonRetryScheduled?: (context,error,metadata) =>void|Promise<void>
Defined in: packages/messaging/src/hooks.ts:55
Parameters
Section titled “Parameters”context
Section titled “context”HookContext & RetryScheduledHookContext
metadata
Section titled “metadata”reason
Section titled “reason”string
retryAfterMs?
Section titled “retryAfterMs?”number
Returns
Section titled “Returns”void | Promise<void>
onSuccess?
Section titled “onSuccess?”
optionalonSuccess?: (context,result) =>void|Promise<void>
Defined in: packages/messaging/src/hooks.ts:49
Parameters
Section titled “Parameters”context
Section titled “context”result
Section titled “result”Returns
Section titled “Returns”void | Promise<void>