@@ -100,8 +100,7 @@ export function define<const Type extends string, Fields extends Schema.Struct.F
100100 ) {
101101 registry . set ( input . type , definition )
102102 }
103- if ( input . durable )
104- durableRegistry . set ( versionedType ( input . type , input . durable . version ) , definition )
103+ if ( input . durable ) durableRegistry . set ( versionedType ( input . type , input . durable . version ) , definition )
105104 return definition as Schema . Schema < Payload < Definition < Type , Schema . Struct < Fields > > > > &
106105 Definition < Type , Schema . Struct < Fields > >
107106}
@@ -126,10 +125,7 @@ export interface Interface {
126125 ) => Effect . Effect < Payload < D > >
127126 readonly subscribe : < D extends Definition > ( definition : D ) => Stream . Stream < Payload < D > >
128127 readonly all : ( ) => Stream . Stream < Payload >
129- readonly durable : ( input : {
130- readonly aggregateID : string
131- readonly after ?: number
132- } ) => Stream . Stream < Payload >
128+ readonly durable : ( input : { readonly aggregateID : string ; readonly after ?: number } ) => Stream . Stream < Payload >
133129 /** @deprecated Use `all()` and consume the returned stream. */
134130 readonly listen : ( listener : Subscriber ) => Effect . Effect < Unsubscribe >
135131 readonly project : < D extends Definition > ( definition : D , projector : Subscriber < D > ) => Effect . Effect < void >
@@ -382,8 +378,7 @@ export const layerWith = (options?: LayerOptions) =>
382378 Effect . suspend ( ( ) => observer ( event ) ) . pipe (
383379 Effect . catchCauseIf (
384380 ( cause ) => ! Cause . hasInterrupts ( cause ) ,
385- ( cause ) =>
386- Effect . logError ( "Event listener failed" , { eventID : event . id , eventType : event . type , cause } ) ,
381+ ( cause ) => Effect . logError ( "Event listener failed" , { eventID : event . id , eventType : event . type , cause } ) ,
387382 ) ,
388383 )
389384
@@ -435,9 +430,9 @@ export const layerWith = (options?: LayerOptions) =>
435430 const payload = {
436431 id : event . id ,
437432 type : definition . type ,
438- data : Schema . decodeUnknownSync (
439- definition . data as Schema . Codec < unknown , unknown , never , never > ,
440- ) ( event . data ) ,
433+ data : Schema . decodeUnknownSync ( definition . data as Schema . Codec < unknown , unknown , never , never > ) (
434+ event . data ,
435+ ) ,
441436 } as Payload
442437 const committed = yield * commitDurableEvent ( payload , {
443438 seq : event . seq ,
@@ -580,10 +575,7 @@ export const layerWith = (options?: LayerOptions) =>
580575 return subscription
581576 } )
582577
583- const durable = ( input : {
584- readonly aggregateID : string
585- readonly after ?: number
586- } ) : Stream . Stream < Payload > =>
578+ const durable = ( input : { readonly aggregateID : string ; readonly after ?: number } ) : Stream . Stream < Payload > =>
587579 Stream . unwrap (
588580 Effect . gen ( function * ( ) {
589581 const wakes = yield * subscribeDurable ( input . aggregateID )
0 commit comments