Skip to content

Commit

Permalink
Improved docs around latest hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection committed Oct 30, 2023
1 parent 97cd801 commit 5266eb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ This is the list of all possible, yet **optional** hooks, a custom type can defi

| name | example | behavior |
| :------------------------ | :-------------------------------------------- | :-------- |
| onReady | `onReady(wrap:Wrap, el:Element) {}` | If defined, it is invoked before any other hook to signal that the element is going to execute the code. |
| onReady | `onReady(wrap:Wrap, el:Element) {}` | If defined, it is invoked before any other hook to signal that the element is going to execute the code. For custom scripts, this hook is in charge of eventually running the content of the script, anyway it prefers to do so. |
| onBeforeRun | `onBeforeRun(wrap:Wrap, el:Element) {}` | If defined, it is invoked before any other hook to signal that the element is going to execute the code. |
| onBeforeRunAsync | `onBeforeRunAsync(wrap:Wrap, el:Element) {}` | Same as `onBeforeRun` except it's the one used whenever the script is `async`. |
| codeBeforeRun | `codeBeforeRun: () => 'print("before")'` | If defined, prepend some code to evaluate right before the rest of the code gets executed. |
Expand Down Expand Up @@ -547,7 +547,7 @@ As summary, this is the list of all possible, yet **optional** hooks, a custom t

| name | example | behavior |
| :------------------------ | :-------------------------------------------- | :--------|
| onReady | `onReady(wrap:Wrap, xw:XWorker) {}` | If defined, it is invoked before any other hook to signal that the xworker is going to execute the code. |
| onReady | `onReady(wrap:Wrap, xw:XWorker) {}` | If defined, it is invoked before any other hook to signal that the xworker is going to execute the code. Differently from **main**, the code here is already known so all other operations will be performed automatically. |
| onBeforeRun | `onBeforeRun(wrap:Wrap, xw:XWorker) {}` | If defined, it is invoked before any other hook to signal that the xworker is going to execute the code. |
| onBeforeRunAsync | `onBeforeRunAsync(wrap:Wrap, xw:XWorker) {}` | Same as `onBeforeRun` except it's the one used whenever the worker script is `async`. |
| codeBeforeRun | `codeBeforeRun: () => 'print("before")'` | If defined, prepend some code to evaluate right before the rest of the code gets executed. |
Expand Down

0 comments on commit 5266eb5

Please sign in to comment.