mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-07-09 02:14:06 +00:00
17 lines
477 B
JavaScript
17 lines
477 B
JavaScript
import { ReportSharedStateVariable } from '$wails/go/app/App.js';
|
|
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;
|