Callback before or after create / buildCreateInput
Quramy opened this issue · comments
Yosuke Kurami commented
Feature like https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#default-callbacks
const PostFactory = definePostFactory({
defaultData: {
author: UserFactory,
},
onAfterCreate: async (created) => {
await something(created);
},
});
onAfterBuild
,onBeforeCreate
,onAfterCreate
is an optional callback function- It accepts created data object
Chris Grigg commented
I would very much like this. What do you think the effort level would be? Would this be an easy thing for someone to contribute?