@@ -9,30 +9,30 @@ const { controllers, matchWithServices } = matchFor(BlogRsc)
99
1010const FindPost = matchWithServices ( "FindPost" ) (
1111 { BlogPostRepo } ,
12- ( req , { BlogPostRepo } ) =>
13- BlogPostRepo . find ( req . id )
12+ ( req , { blogPostRepo } ) =>
13+ blogPostRepo . find ( req . id )
1414 . map ( _ => _ . getOrNull )
1515)
1616
1717const GetPosts = matchWithServices ( "GetPosts" ) (
1818 { BlogPostRepo } ,
19- ( _ , { BlogPostRepo } ) => BlogPostRepo . all . map ( items => ( { items } ) )
19+ ( _ , { blogPostRepo } ) => blogPostRepo . all . map ( items => ( { items } ) )
2020)
2121
2222const CreatePost = matchWithServices ( "CreatePost" ) (
2323 { BlogPostRepo } ,
24- ( req , { BlogPostRepo } ) =>
24+ ( req , { blogPostRepo } ) =>
2525 Effect ( new BlogPost ( { ...req } ) )
26- . tap ( BlogPostRepo . save )
26+ . tap ( blogPostRepo . save )
2727 . map ( _ => _ . id )
2828)
2929
3030const PublishPost = matchWithServices ( "PublishPost" ) (
3131 { BlogPostRepo, Events, Operations } ,
32- ( req , { BlogPostRepo , Events , Operations } ) =>
32+ ( req , { blogPostRepo , events , operations } ) =>
3333 Do ( $ => {
3434 $ (
35- BlogPostRepo . find ( req . id )
35+ blogPostRepo . find ( req . id )
3636 . flatMap ( _ => _ . encaseInEffect ( ( ) => new NotFoundError ( "BlogPost" , req . id ) ) )
3737 )
3838
@@ -47,15 +47,15 @@ const PublishPost = matchWithServices("PublishPost")(
4747 const operationId = $ (
4848 Effect . forkOperationWithEffect (
4949 opId =>
50- Operations . update ( opId , {
50+ operations . update ( opId , {
5151 total : PositiveInt ( targets . length ) ,
5252 completed : PositiveInt ( done . length )
5353 } ) >
5454 targets
5555 . forEachEffect ( _ =>
5656 Effect ( done . push ( _ ) )
5757 . tap ( ( ) =>
58- Operations . update ( opId , {
58+ operations . update ( opId , {
5959 total : PositiveInt ( targets . length ) ,
6060 completed : PositiveInt ( done . length )
6161 } )
@@ -65,7 +65,7 @@ const PublishPost = matchWithServices("PublishPost")(
6565 . map ( ( ) => "the answer to the universe is 41" ) ,
6666 // while operation is running...
6767 _opId =>
68- Effect . suspendSucceed ( ( ) => Events . publish ( new BogusEvent ( { } ) ) )
68+ Effect . suspendSucceed ( ( ) => events . publish ( new BogusEvent ( { } ) ) )
6969 . delay ( DUR . seconds ( 1 ) )
7070 . forever
7171 )
0 commit comments