Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export renderSettled via renderer package #20053

Merged
merged 1 commit into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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