Skip to content

Commit

Permalink
not crashing on insertions, #32
Browse files Browse the repository at this point in the history
  • Loading branch information
Miha-x64 committed Aug 5, 2018
1 parent 40e369f commit d328b75
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -61,10 +61,14 @@ class ManagedProperty<T, TOKN>(
// the transaction was committed

val oldValue = ref
check(oldValue !== Unset) // we've saved it earlier
ref = newValue

valueChanged(oldValue, newValue, null)
valueChanged(
// when just created, oldValue === Unset, so just say we've changed from 'new' to 'new'
if (oldValue === Unset) newValue else oldValue,
newValue,
null
)
}
}

Expand Down

0 comments on commit d328b75

Please sign in to comment.