@creit.tech/stellar-wallets-kit
Version:
A kit to handle all Stellar Wallets at once
26 lines (23 loc) • 580 B
JavaScript
import { BehaviorSubject } from 'rxjs';
class ReactiveState {
constructor(host, source, value) {
this.host = host;
this.source = source;
this.value = value;
this.sub = null;
this.value$ = new BehaviorSubject(void 0);
this.host.addController(this);
}
hostConnected() {
this.sub = this.source.subscribe((value) => {
this.value = value;
this.value$.next(value);
this.host.requestUpdate();
});
}
hostDisconnected() {
this.sub?.unsubscribe();
}
}
export { ReactiveState };
//# sourceMappingURL=reactive-state.mjs.map