-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: Add global mutation trigger field to EntityCompanionProvider #215
Conversation
371683c
to
c94ab19
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #215 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 69 70 +1
Lines 1899 1921 +22
Branches 262 267 +5
=========================================
+ Hits 1899 1921 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
f2c48bf
to
d6b7921
Compare
f00f3e9
to
70f44f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few changes before commit, otherwise looks good.
One other thing is I renamed the PR to use conventional commits style, so when you merge it ensure it keeps the new style in the final commit title. This just makes it so that the changelog is auto-generated.
Why
Adding global mutation triggers to
EntityCompanionProvider
allows the creation of mutation triggers that run for every entity.How
I added the property
globalMutationTriggers
toEntityCompanionProvider
. In theEntityMutator
constructor, themutationTriggers
property is set to the combination ofcompanionProvider.globalMutationTriggers
and any mutation triggers included in the constructor's parameter. Global mutation triggers will always run before any mutation triggers defined for the individual entity.Test Plan
I modified
EntityMutator-test.ts
to include theglobalMutationTriggers
duringcreateEntityMutatorFactory
, and these global triggers have their trigger count verified later.