-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Open
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: deferIssues related to @defer blocks.Issues related to @defer blocks.
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
compiler
Description
Please add the "delay" parameter to the "idle" trigger.
We could use it like this:
@defer (on hover(container); on idle(2000)) {
<heavy-component/>
}
or this:
@defer (on idle({delay: 2000})) {
<heavy-component/>
}
That would load the HeavyComponent either on hover or after a 2s delay after “idle”.
There are just components that are far enough from the user’s path, and heavy enough to load them not on just “idle”, but with a small delay - because more important components will take a chance to be loaded on “idle”.
Proposed solution
Please add the "delay" parameter to the "idle" trigger.
Alternatives considered
We can do this, but it is considered a bad practice by Angular.dev:
@defer (on idle) {
@defer(on timer(2000)) {
<heavy-component/>
}
}
Also, this way we can't combine triggers with "or" logic.
samuelfernandez, ncamera, manab999, reuse-ay and bobbhymanab999
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: deferIssues related to @defer blocks.Issues related to @defer blocks.