10/15/2024 7:36 AM | |
Joined: 12/2/2010 Last visit: 10/17/2024 Posts: 34 Rating:
|
Hello, currently I'm trying to create Global module in which I will store some data as screens will be changed during navigation. After each screen is loaded, module is imported and new data added while old data is preserved. This was my assumption. It turned out that every time module is imported, it's imported with initial (default) values. Then I found about singletons and it seemed to be the solution. I have checked befaviour with dummy files in browser/node and it worked, however trying same stuff in unified doesen't work. Am I running into some unified restrictions or my understanding is wrong (js beginner)? I'm attaching js code (index.js is one to run) and unified project. In unified project root screen is loaded and data is set. Screen window loads another screen in which module is loaded and data is added. Unified output is observed with TraceViewer "Trace(): { screen: '', render: '' } ". Attachmentsingleton.zip (95 Downloads) |
Follow us on