waygraph / withDialog
Function: withDialog()
withDialog<
B>(block,options?):B
Defined in: src/engine/block/dialog.ts:15
Answers the browser's own dialog (confirm, alert, prompt, beforeunload) that this Block's action triggers. A dialog freezes the page until it is answered, so the answer has to be armed before the click - this does that without folding it into the Block's own act. The dialog's text can be kept in mem.
Type Parameters
B
B extends SomeBlock
Parameters
block
B
options?
accept?
boolean
into?
MemKey<string>
promptText?
string
Returns
B
Example
ts
withDialog(CancelBlock, { accept: true, into: LeaveWarning })