Skip to content
Permalink
Browse files

Add effect handler to domain

  • Loading branch information
goodmind committed Feb 12, 2019
1 parent e70a96c commit 4c6ae801b301067473f583b490eefde7b3287afc
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/domain/domainFabric.js
@@ -52,11 +52,17 @@ export function domainFabric(
hooks.event(result)
return result
},
effect<Params, Done, Fail>(name?: string): Effect<Params, Done, Fail> {
effect<Params, Done, Fail>(
name?: string,
config?: {
handler?: (payload: Params) => Promise<Done> | Done,
},
): Effect<Params, Done, Fail> {
const result = effectFabric({
name,
domainName: compositeName.fullName,
parent: compositeName,
handler: config?.handler,
})
hooks.effect(result)
return result

0 comments on commit 4c6ae80

Please sign in to comment.
You can’t perform that action at this time.