this release simplifies the management of dynamic signals by making every Accessor<T>
function identifiable via its custom id
property.
when observer signals are aware of their dependency's id
, it makes it easy for them to remove their dependency on them by simply invoking ctx.delEdge(getDepSignalValue.id, thisSignal.id)
.
another advantage that it gives is the ability add dependencies silently via ctx.addEdge(getDepSignalValue.id, thisSignal.id)
. previously, you would have to call the getter function with your observer signal's id as the argument so that it would register it as an observer.
in addition, this release introduces two new dynamic signal classes under the new collection_signal
submodule:
UnisetSignal
:
holds a set of accessors (Set<Accessor<T>>
), and when its value is requested, it returns the values of the accessors it is holding (as aSet<T>
).ListSignal
: holds an array of reference counted accessors (RcList<Accessor<T>>
), and when its value is requested, it returns an array of the values of the accessors it is holding (as aList<T>
, which is a subclass ofArray<T>
).
each of the signals above fire an update cycle when the collection is mutated (addition, removal, or swapping of elements).
they also carry on the propagation of an update cycle if one or more of their underlying dependency elements fires an update.
and as always, recall uncle ben's wise words:
with great american allies comes a greater national debt
don't forget to sell your soul to the bankers, for they be lending out moderately-noice foreclosed homes, and brand new hyundai accents.
What's Changed
- feature: identifiable signal methods by @omar-azmi in #8
- feature: dynamic signals 1 by @omar-azmi in #9
Full Changelog: v0.3.2...v0.4.0