Skip to content

Commit

Permalink
Update config-static/README.md
Browse files Browse the repository at this point in the history
Co-authored-by: Emma Russell <[email protected]>
  • Loading branch information
M-Kusumgar and EmmaLRussell authored Jan 6, 2025
1 parent 4f1d36b commit 5ea22cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config-static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ The `wodinStatic.ts` script is the entrypoint for run time wodin static. This sc
1. Queries the document and finds all `data-w-store` tags (data tags that define what stores to use for that component). This is a list of all the stores the user has used in the HTML document and the values should match the `<store-name>` folder names in the user's config.
1. Gets the `stores/<store-name>/config.json` and `stores/<store-name>/model.json` for only the stores the user has used in the page.
1. For each `<store-name>` the user has used in the page, it initialises the store with the config, runners (using the global variables), model and finally runs the model with the runners. This initialisation was the responsibility of on mount hook of components like `WodinSession.vue` but we no longer mount those components so we have to manually initialise the store. Note: the api service is disabled in the wodin static build so returns undefined for all responses, this may break things if you want to mount certain components that do api requests. We intend to fix this soon.
1. For each `<store-name>` we loop over the components we want to mount. We define a selector for each one in `componentsAndSelectors` function and query the DOM for these selectors making sure they have `data-w-store` tag with value `<store-name>`. We mount the component to the correct selector with the correct store.
1. For each `<store-name>` we loop over the components we want to mount. We define a selector for each one in `componentsAndSelectors` function and query the DOM for these selectors making sure they have `data-w-store` tag with value `<store-name>`. We mount the component to the correct selector with the correct store. `index.html` in this folder includes examples of all supported components.

0 comments on commit 5ea22cd

Please sign in to comment.