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

wip: Callback options #251

Closed
wants to merge 3 commits into from
Closed

wip: Callback options #251

wants to merge 3 commits into from

Conversation

Quramy
Copy link
Owner

@Quramy Quramy commented Jan 11, 2024

What

Related #42

factories API

Add new options ,onAfterBuild, onBeforeCreate, and onAfterCreate such as:

const UserFactory = defineUserFactory({
  onAfterBuild: (userCreateInput) => {
    // do something
  },
  onBeforeCreate: (userCreateInput) => {
    // do something
  },
  onAfterCreate: (createdUser) => {
    // do something
  },
});
  • userCreateInput is assignable to Primsa.CreateUserInput (parameter type of prisma.user.create)
  • createdUser is assignable to User ( return type of prisma.user.create )

@Quramy Quramy changed the title test: Design callback options wip: Callback and arbitrary params Jan 11, 2024
@Quramy Quramy changed the title wip: Callback and arbitrary params wip: Callback options Jan 11, 2024
@Quramy

This comment was marked as resolved.

@Quramy
Copy link
Owner Author

Quramy commented Jan 12, 2024

#254

@Quramy Quramy closed this Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant