Skip to content

Commit

Permalink
small tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviergonz committed Apr 1, 2019
1 parent 17195c6 commit fcd4161
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/mobx-state-tree/src/types/utility-types/reference.ts
Expand Up @@ -552,14 +552,15 @@ export function safeReference<IT extends IAnyComplexType>(
subType: IT,
options?: ReferenceOptionsGetSet<IT>
): IMaybe<IReferenceType<IT>> & ISafeReference {
return maybe(
const ret = maybe(
reference(subType, {
...options,
onInvalidated(ev) {
ev.removeRef()
}
})
) as any
)
return ret as typeof ret & ISafeReference
}

/** @hidden */
Expand Down

0 comments on commit fcd4161

Please sign in to comment.