Skip to content

Commit 2da0936

Browse files
committed
style: 💄 run Prettier
1 parent 823c37e commit 2da0936

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

src/server/__tests__/blocks.spec.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ describe('blocks.*', () => {
292292
await tick(11);
293293
const emits: any[] = [];
294294
caller.call$('blocks.listen', of({id: 'my-block'}), {}).subscribe((data) => emits.push(data));
295-
const model = Model.withLogicalClock();
295+
const model = Model.withLogicalClock();
296296
model.api.root({
297297
text: 'Hell',
298298
});
@@ -321,20 +321,23 @@ describe('blocks.*', () => {
321321
const {call, caller} = setup();
322322
const emits: any[] = [];
323323
caller.call$('blocks.listen', of({id: 'my-block'}), {}).subscribe((data) => emits.push(data));
324-
const model = Model.withLogicalClock();
324+
const model = Model.withLogicalClock();
325325
model.api.root({
326326
text: 'Hell',
327327
});
328328
const patch1 = model.api.flush();
329329
await tick(12);
330330
expect(emits.length).toBe(0);
331-
await call('blocks.create', {id: 'my-block', patches: [
332-
{
333-
seq: 0,
334-
created: Date.now(),
335-
blob: patch1.toBinary(),
336-
},
337-
]});
331+
await call('blocks.create', {
332+
id: 'my-block',
333+
patches: [
334+
{
335+
seq: 0,
336+
created: Date.now(),
337+
blob: patch1.toBinary(),
338+
},
339+
],
340+
});
338341
await until(() => emits.length === 1);
339342
expect(emits.length).toBe(1);
340343
expect(emits[0].data.patches.length).toBe(1);

src/server/routes/blocks/methods/listen.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ export const listen =
3838
description: 'Subscribe to a block to receive updates when it changes.',
3939
})
4040
.implement((req$) => {
41-
return req$.pipe(
42-
switchMap(({id}) => services.pubsub.listen$(`__block:${id}`)),
43-
) as any;
41+
return req$.pipe(switchMap(({id}) => services.pubsub.listen$(`__block:${id}`))) as any;
4442
});
4543

4644
return router.fn$('blocks.listen', Func);

src/server/services/blocks/BlocksServices.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class BlocksServices {
1515
block,
1616
patches,
1717
};
18-
this.services.pubsub.publish(`__block:${id}`, data).catch(error => {
18+
this.services.pubsub.publish(`__block:${id}`, data).catch((error) => {
1919
console.error('Error publishing block patches', error);
2020
});
2121
return {block};
@@ -31,7 +31,7 @@ export class BlocksServices {
3131

3232
public async remove(id: string) {
3333
await this.store.remove(id);
34-
this.services.pubsub.publish(`__block:${id}`, {deleted: true}).catch(error => {
34+
this.services.pubsub.publish(`__block:${id}`, {deleted: true}).catch((error) => {
3535
console.error('Error publishing block deletion', error);
3636
});
3737
}
@@ -42,7 +42,7 @@ export class BlocksServices {
4242
const seq = patches[0].seq;
4343
const {store} = this;
4444
const {block} = await store.edit(id, patches);
45-
this.services.pubsub.publish(`__block:${id}`, {patches}).catch(error => {
45+
this.services.pubsub.publish(`__block:${id}`, {patches}).catch((error) => {
4646
console.error('Error publishing block patches', error);
4747
});
4848
const expectedBlockSeq = seq + patches.length - 1;

0 commit comments

Comments
 (0)