Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback before or after create / buildCreateInput #42

Open
Tracked by #5
Quramy opened this issue Nov 25, 2022 · 1 comment · Fixed by #254
Open
Tracked by #5

Callback before or after create / buildCreateInput #42

Quramy opened this issue Nov 25, 2022 · 1 comment · Fixed by #254
Labels
enhancement New feature or request

Comments

@Quramy
Copy link
Owner

Quramy commented Nov 25, 2022

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
@Quramy Quramy mentioned this issue Nov 25, 2022
16 tasks
@Quramy Quramy added the enhancement New feature or request label Nov 25, 2022
@subvertallchris
Copy link

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?

@Quramy Quramy changed the title Callback after create / buildCreateInput Callback before or after create / buildCreateInput Dec 29, 2023
This was referenced Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants