File tree Expand file tree Collapse file tree 3 files changed +16
-15
lines changed Expand file tree Collapse file tree 3 files changed +16
-15
lines changed Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments