-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now all parameters that initApp() may pass through to each individual component's init() function are bundled into a single object. Other small but significant changes: - Removes window and document from the parameter list for now, as there's no components that need to inject them. - Sets up a list of components in initApp() so that it can call each component's init() via forEach(). This eliminates the need to add a new line for each init() call for each added component. - Sets initApp() to run only once on DOMContentLoaded. - Removes the now unused fragment() test helper (should've been part of commit 5f2a917 from #51). --- While adding the Calculator component, it became apparent that adding more params to main.js and initApp() to pass through to init() was becoming unwieldy. This solution makes future extension easier and the code cleaner while decoupling component initializer signatures from one another.
- Loading branch information
Showing
5 changed files
with
16 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters