Skip to content

Commit af106cd

Browse files
author
Chris Garrett
committed
clarify timing semantics
1 parent f2ef0e9 commit af106cd

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

text/0000-render-element-modifiers.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,13 @@ code is only run on clients.
235235
236236
### `{{did-render}}`
237237

238-
This modifier runs immediately after the element is inserted, and again whenever
239-
any of the arguments passed to it update, including the function passed as the
240-
first argument. It has the following timing semantics:
238+
This modifier is activated:
239+
240+
1. When The element is inserted in the DOM
241+
2. Whenever any of the arguments passed to it update, including the function
242+
passed as the first argument.
243+
244+
It has the following timing semantics when activated:
241245

242246
* **Always**
243247
* called after DOM insertion
@@ -252,6 +256,10 @@ first argument. It has the following timing semantics:
252256
* **Never**
253257
* called if the arguments to the modifier are constants
254258

259+
Note that these statements do not refer to when the modifier is _activated_,
260+
only to when it will be run relative to other hooks and modifiers _should it be
261+
activated_. The modifier is only activated on insertion and arg changes.
262+
255263
`{{did-render}}` receives a function with the following signature as the first
256264
positional parameter:
257265

@@ -266,8 +274,11 @@ rest of the arguments are any remaining positional parameters passed to
266274

267275
### `{{will-destroy}}`
268276

269-
This modifier runs immediately before the element is removed. It has the
270-
following timing semantics:
277+
This modifier is activated:
278+
279+
1. immediately before the element is removed from the DOM.
280+
281+
It has the following timing semantics when activated:
271282

272283
* **Always**
273284
* called _after_ any child element's `{{will-destroy}}` modifiers

0 commit comments

Comments
 (0)