Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 Have StringCalculatorPage use host document #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.