Skip to content

Add onValidated support to safeReference#1540

Merged
orlovcs merged 1 commit intomobxjs:masterfrom
getkey:oninvalidated-safereference
Nov 9, 2020
Merged

Add onValidated support to safeReference#1540
orlovcs merged 1 commit intomobxjs:masterfrom
getkey:oninvalidated-safereference

Conversation

@getkey
Copy link
Copy Markdown
Contributor

@getkey getkey commented Jun 28, 2020

So you can do, just like you would do with a normal reference:

types.safeReference(Entity, {
    onInvalidated(ev: any) {
        console.log('fancy', ev);
    }
})

`[mobx-state-tree] Failed to resolve reference '${this.identifier}' to type '${
this.targetType.name
}' (from node: ${node.path})`
`[mobx-state-tree] Failed to resolve reference '${this.identifier}' to type '${this.targetType.name}' (from node: ${node.path})`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not change this, prettier did 😉

@getkey
Copy link
Copy Markdown
Contributor Author

getkey commented Nov 9, 2020

Hey @jesse-savary and @orlovcs, how does this look? 🙂

Copy link
Copy Markdown
Member

@jesse-savary jesse-savary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@orlovcs orlovcs merged commit 3c92314 into mobxjs:master Nov 9, 2020
@getkey
Copy link
Copy Markdown
Contributor Author

getkey commented Nov 9, 2020

Amazing! Thank you ❤️

@getkey getkey deleted the oninvalidated-safereference branch November 9, 2020 21:17
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.

3 participants