Frontmatter
| id | 5512 |
| title | Neo.setupClass() => create a protection for not creating singleton instances more than once |
| state | Closed |
| labels | enhancement |
| assignees | tobiu |
| createdAt | Jul 2, 2024, 10:33 AM |
| updatedAt | Jul 2, 2024, 10:47 AM |
| githubUrl | https://github.com/neomjs/neo/issues/5512 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jul 2, 2024, 10:47 AM |
The current singleton implementation works fine, in case we are sticking to one Neo.mjs version per app.
For the
LivePreview, the dynamic code can not be bundled, so when trying to build the Portal app, it could happen that we have both, thedist/productionand thedevelopmentversions of neo in parallel.In this case, singleton files will get pulled in from multiple locations (file-paths).
setupClass()needs to check if the namespace already exists and if so, not create a new instance or override the ns.