Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): allow updating nested 1:1 and m:1 references with EntityA…
…ssigner (#1535) Adds `updateNestedEntities` flag that mimics the `mergeObjects` flag for M:1 and 1:1 relations. ```ts const authorEntity = new Author('Jon2 Snow', 'snow3@wall.st'); book.author = authorEntity; wrap(book).assign({ author: { name: 'Jon Snow2' } }, { updateNestedEntities: true }); console.log(book.author); // { ... name: 'Jon Snow2' ... } console.log(book.author === authorEntity) // true // this will have no effect as author is an entity wrap(book).assign({ author: { name: 'Jon Snow2' } }, { mergeObjects: true }); console.log(book.author); // { ... name: 'Jon Snow2' ... } console.log(book.author === authorEntity) // false ```
- Loading branch information
Showing
3 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters