import { FanOut } from 'thingies/lib/fanout';
export class FanoutSyncStore {
    getSnapshot;
    fanout = new FanOut();
    subscribe = (cb) => this.fanout.listen(cb);
    constructor(getSnapshot) {
        this.getSnapshot = getSnapshot;
    }
}
export class ValueSyncStore {
    value;
    fanout = new FanOut();
    subscribe = (cb) => this.fanout.listen(cb);
    constructor(value) {
        this.value = value;
    }
    getSnapshot = () => this.value;
    next(value, force = false) {
        if (!force && this.value === value)
            return;
        this.value = value;
        this.fanout.emit();
    }
}
//# sourceMappingURL=sync-store.js.map