Skip to content

v0.2.0

Choose a tag to compare

@aleclarson aleclarson released this 08 Dec 15:13
· 34 commits to master since this release

Breaking changes

  • Renamed onParentChange observer method to eventObserved
  • Removed getFluidConfig export
  • Replaced setFluidConfig export with setFluidGetter, which takes a "getter" function to be called by getFluidValue.
    The getter has this access, so a method can be passed. You must call setFluidGetter before observers can be added. If you extend the FluidValue class, you can pass the getter to super or define a get method on your prototype, instead of calling setFluidGetter.
  • Observed values don't manage their observers anymore. This is now done internally via the observer API: addFluidObserver, removeFluidObserver, getFluidObservers, callFluidObserver, and callFluidObservers
  • The addFluidObserver function no longer returns a disposer. You must call removeFluidObserver instead.

New features

  • Observers can be functions now, instead of only objects with an eventObserved method.
  • Observed values may have observerAdded and/or observerRemoved methods, called with (count: number, observer: FluidObserver). This is especially useful for reacting to the first observer being added or the last observer being removed.