Skip to content

Commit 88e51e3

Browse files
committed
feat: 🎸 use onLine$ probe from rx-use
1 parent 5101ff7 commit 88e51e3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"json-joy": "^16.25.0",
8787
"memfs": "^4.11.0",
8888
"memory-level": "^1.0.0",
89+
"rx-use": "^1.8.1",
8990
"sonic-forest": "^1.0.3",
9091
"thingies": "^2.1.0"
9192
},

src/json-crdt-repo/JsonCrdtRepo.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {EditSessionFactory} from './session/EditSessionFactory';
55
import {BinStrLevel, LevelLocalRepoPubSubMessage} from './local/level/types';
66
import {PubSubBC} from './pubsub';
77
import {Locks} from 'thingies/lib/Locks';
8-
import {BehaviorSubject} from 'rxjs';
9-
import {LevelLocalRepo} from './local/level/LevelLocalRepo';
8+
import {LevelLocalRepo, LevelLocalRepoOpts} from './local/level/LevelLocalRepo';
109
import {Model} from 'json-joy/lib/json-crdt';
10+
import {onLine$} from 'rx-use/lib/onLine$';
1111
import type {EditSession} from './session/EditSession';
1212

1313
export interface JsonCrdtRepoOpts {
@@ -35,7 +35,7 @@ export class JsonCrdtRepo {
3535
const pubsub = new PubSubBC<LevelLocalRepoPubSubMessage>(this.opts.name);
3636
const locks = new Locks();
3737
const sid: number = this.readSid();
38-
const connected$ = new BehaviorSubject(true);
38+
const connected$ = onLine$ as LevelLocalRepoOpts['connected$'];
3939
const repo = new LevelLocalRepo({
4040
kv,
4141
locks,

0 commit comments

Comments
 (0)