-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
It'd be useful to be able to define a task that doesn't start immediately. The task could start on some action / event, or when some other async process is done.
I could imagine two non-exclusive ways to do this:
- Have a method to start a task, along with an option to not immediately run a task. That option could be a particular set of deps, as in [@lit-labs/task] Task function never call if there are no deps #2317. Maybe
() => []always runs the task, andundefinedcreates a manually run task. - Support Promises as deps and only run a task when the promises resolve. This could be tricky when dealing with Promise identity (new Promise instances wrapping the same underlying value) and needing to always wait a microtask to see the Promise value. Some of the same issues that
Tasksolves vsuntil().
mohe2015 and shine-on-me
Metadata
Metadata
Assignees
Labels
No labels