* Get DOM element where app will mount.
()
| 68 | * Get DOM element where app will mount. |
| 69 | */ |
| 70 | function getRoot() { |
| 71 | /** |
| 72 | * Return existing root if found. |
| 73 | */ |
| 74 | const existingRoot = document.getElementById(ROOT_ID); |
| 75 | if (existingRoot) { |
| 76 | return existingRoot; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * If no existing root, create and return a new root. |
| 81 | */ |
| 82 | const newRoot = document.createElement('div'); |
| 83 | newRoot.id = ROOT_ID; |
| 84 | document.body.appendChild(newRoot); |
| 85 | return newRoot; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Dispatch config to store if received. This config will be merged into |