Simplify gViewController API methods
Categories
(Toolkit :: Add-ons Manager, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox88 | --- | fixed |
People
(Reporter: ntim, Assigned: ntim)
References
Details
Attachments
(1 file)
After bug 1525179:
-
gViewController.loadInitialView is the same as gViewController.replaceView for current usages, since currentViewId is always an empty string or null
-
gViewController.replaceView isn't used aside for replaceWithDefaultViewFn. It could be implemented as an argument for gViewController.loadView
-
gViewController.updateState is the same as gViewController.loadViewInternal, with slightly different args, these can be combined in a renderView method.
-
initialViewSelected is essentially the same as checking for the existence of currentViewId
-
I think it's worth adding a resetView helper which would be the equivalent of replaceWithDefaultViewFn
This way, gViewController can have a clear API with 3 methods: loadView/resetView/renderView which matches how gViewController is actually used. Also, external callers can call into loadView without knowing the initialization state.
| Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 3•4 years ago
|
||
| bugherder | ||
Description
•