joist-orm / joist-orm/joist-orm
Change factory opt order
Open
- Dominant language
- TypeScript
- Stars
- 385
- Forks
- 26
- Avg merge
- 8h 55m
- Merged PRs (30d)
- 42
Description
Seems like factories should apply things like:
* Sort the fields using setDefault hints (done)
* Change `newTestInstance` to `em.create` without any fields/opts set yet
* We want to incrementally set the fields, one-by-one, so we can control when the default lambdas are invoked
* Loop over the in-setDefault-order fields
* If it's a opt, set it.
* If there's a sync (a hintless-sync lambda or a hint+sync lambda), invoke it
* If there's an obvious default, set it.
* If it's required, create it
Contributor guide
Assessment
This issue has not been assessed yet.