After bug 1525179: - gViewController.loadInitialView is the same as gViewController.replaceView, since currentViewId is always an empty string. - 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, we 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.
Bug 1689230 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
After bug 1525179: - gViewController.loadInitialView is the same as gViewController.replaceView, since currentViewId is always an empty string. - 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.
After bug 1525179: - gViewController.loadInitialView is the same as gViewController.replaceView, 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.
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.