Use dictionary argument in ResourceWatcher.watch
Categories
(DevTools :: Framework, enhancement)
Tracking
(Fission Milestone:M7, firefox78 fixed)
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: ochameau, Assigned: daisuke)
Details
(Whiteboard: dt-fission-m2-mvp)
Attachments
(1 file)
ResourceWatcher.watch
interface looks currently like this:
async watch(resources, onAvailable, onDestroyed) {
But, we are talking about exposing a new onUpdated
callback (here), and also possibly a new option in order to listen only for "future" resources (here). And who knows if we will start adding yet some others??
It may be great to start using a dictionary argument.
I could think about using either:
async watch(resources, { onAvailable, onDestroyed })
or
async watch({ resources, onAvailable, onDestroyed })
The first better highlight that resources
is a mandatory attribute.
This may soon become:
async watch(resources, { onAvailable, onUpdated, onDestroyed, onlyFuture })
or
async watch({ resources, onAvailable, onUpdated, onDestroyed, onlyFuture })
(Flagging in the reserve list as that's not mandarory refactoring)
Comment 1•5 years ago
|
||
I like the async watch(resources, { onAvailable, onDestroyed })
option. As you said, it highlights the importance and mandatory nature of resources
. onAvailable
is also mandatory, but async watch(resources, onAvailable, { onDestroyed, ... })
would not make any sense :)
Comment 2•5 years ago
|
||
dt-fission-m2-reserve bugs do not need to block Fission Nightly (M6). For now, let's track them for Fission riding the trains to Beta (M7) so we revisit these bugs before we ship Fission.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Okee! And me too!
Assignee | ||
Comment 5•5 years ago
|
||
Updated•5 years ago
|
Comment 7•5 years ago
|
||
bugherder |
Description
•