Defer
The object that a should… hook returns when it cannot answer immediately, for example because it must ask the person a question. The app waits for the promise to settle, and then acts on the decision that the promise produced. While it waits, the screen remains responsive.
If the library changes during the wait, the app checks the change again before applying it. A plugin builds this object with defer(promise, reason), and the documentation of that function contains an example.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Description |
|---|---|
P |
the type of the replacement that an Amend decision carries. For the hooks of ctx.hooks, it is ChangeDraft. |
Properties
Section titled “Properties”readonly defer: Promise<Decision<P>>;A promise of the decision to take, which is allow(), veto(…) or amend(…).
reason
Section titled “reason”readonly reason: string;A short description of what the app is waiting for.
