Skip to content

Commit

Permalink
feat: Auto preserve named hubs
Browse files Browse the repository at this point in the history
  • Loading branch information
HasinduLanka committed Apr 5, 2022
1 parent 232949a commit b0c2dbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spindly",
"version": "1.0.32",
"version": "1.0.33",
"description": "Spindly Go - Svelte desktop app framework",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions spindly-make.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ var HubManager *Spindly.HubManager = Spindly.NewHubManager()
const hub_name = '${hubclass}';
export function ${hubclass}(hub_instance_id) {
let SpindlyStore = ConnectHub(hub_name, hub_instance_id);
export function ${hubclass}(hub_instance_id, preserve = false) {
let SpindlyStore = ConnectHub(hub_name, hub_instance_id, preserve);
let SpindlyEventStore = (storename) => {
let es = SpindlyStore(storename);
return () => { es.set(Math.random()); };
Expand Down Expand Up @@ -127,7 +127,7 @@ var ${hubclass}_OnInstanciate func(*${hubclass})

if ((hub.hasOwnProperty("instances")) && (hub.instances.length > 0)) {
for (const instname of hub.instances) {
js += `export let ${instname} = ${hubclass}("${instname}");\n`;
js += `export let ${instname} = ${hubclass}("${instname}", true);\n`;
go += `var ${instname} *${hubclass}\n`
}
}
Expand Down

0 comments on commit b0c2dbb

Please sign in to comment.