Omnistac / zedux

:zap: A Molecular State Engine for React
https://Omnistac.github.io/zedux/
MIT License
347 stars 7 forks source link

feat(react)!: make `instance.invalidate()` a normal method #29

Closed bowheart closed 1 year ago

bowheart commented 1 year ago

Description

AtomInstance#invalidate() is currently a function property. It doesn't need to be. Make it a normal method for tiny performance gains when instantiating AtomInstances.

This is technically a breaking change. Any code that was dereferencing the instance property can't do that anymore.

// BAD
const { invalidate } = instance
invalidate()

// GOOD
instance.invalidate()