Skip to content

Commit

Permalink
Merge pull request emberjs#20053 from cafreeman/cfreeman/expose-rende…
Browse files Browse the repository at this point in the history
…r-settled
  • Loading branch information
rwjblue authored and himanshiLt committed Apr 26, 2022
1 parent 4eec765 commit 17f25e6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/@ember/renderer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
@module @ember/renderer
@public
*/

/**
* @class Renderer
* @public
*/

/**
Returns a promise which will resolve when rendering has completed. In
this context, rendering is completed when all auto-tracked state that is
consumed in the template (including any tracked state in models, services,
etc. that are then used in a template) has been updated in the DOM.
For example, in a test you might want to update some tracked state and
then run some assertions after rendering has completed. You _could_ use
`await settled()` in that location, but in some contexts you don't want to
wait for full settledness (which includes test waiters, pending AJAX/fetch,
run loops, etc) but instead only want to know when that updated value has
been rendered in the DOM. **THAT** is what `await rerender()` is _perfect_
for.
@method renderSettled
@returns {Promise<void>} a promise which fulfills when rendering has completed
@public
*/

export { renderSettled } from '@ember/-internals/glimmer';
1 change: 1 addition & 0 deletions tests/docs/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ module.exports = {
'removeObjects',
'removeObserver',
'removeTestHelpers',
'renderSettled',
'reopen',
'reopenClass',
'replace',
Expand Down

0 comments on commit 17f25e6

Please sign in to comment.