Closed nswalters closed 4 years ago
As a developer, I should have access to a standard set of utilities for generating user-facing content on the website.
WHEN the developer wants to load functions used on every page THEN I should have access to a standard set of utility functions
init() function created and called on page load
const init = () => { // code to run on page load here... }
printToDom function used to dynamically update a given selector with a provided domString of HTML
const printToDom = (selector, domString) => { document.querySelector(selector).innerHTML = domString; };
init() function should be the only function created in main.js.
main.js
printToDom should be located in a separate JS directory path for utilities similar to the following: [PROJECT ROOT]/js/helpers/utils.js
[PROJECT ROOT]/js/helpers/utils.js
User Story
As a developer, I should have access to a standard set of utilities for generating user-facing content on the website.
AC
WHEN the developer wants to load functions used on every page THEN I should have access to a standard set of utility functions
Dev Notes
init() function created and called on page load
printToDom function used to dynamically update a given selector with a provided domString of HTML
init() function should be the only function created in
main.js
.printToDom should be located in a separate JS directory path for utilities similar to the following:
[PROJECT ROOT]/js/helpers/utils.js