1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-09 10:24:09 +00:00
Files
rolens/frontend/src/lib/stores/sharedstate.js

17 lines
477 B
JavaScript
Raw Normal View History

2023-08-07 18:21:45 +02:00
import { ReportSharedStateVariable } from '$wails/go/app/App.js';
2023-05-27 21:18:47 +02:00
import { writable } from 'svelte/store';
function sharedStateStore(name) {
const { set, subscribe } = writable();
subscribe(newValue => ReportSharedStateVariable(name, newValue));
return { set, subscribe };
}
const sharedState = {
currentHost: sharedStateStore('currenthost'),
currentDb: sharedStateStore('currentdb'),
currentColl: sharedStateStore('currentcoll'),
};
export default sharedState;