Skip to content

Commit

Permalink
Add effect handler to domain
Browse files Browse the repository at this point in the history
  • Loading branch information
goodmind committed Feb 12, 2019
1 parent e70a96c commit 4c6ae80
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/domain/domainFabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c6ae80

Please sign in to comment.