v4.1.0
Minor Changes
-
#63
d9d3820Thanks @tivac! - Added observable APIAvailable on the
ComponentTreeinstance as.subscribe(callback), calls the callback function immediately with the most recent result and then will re-call it each time a build completes.Follows the svelte store contract which isn't strictly compliant with any official observable APIs but is extremely simple and usable.
The
callbackpassed to.subscribe(...)will immediately be called with the most recent result of building the component tree (orfalseif it hasn't finished yet), and then for each complete tree building run after that thecallbackwill be called with a single argument. The arg is anObjectwith anullprototype and the following properties:tree, nested component structures. This is the same as the first argument to the oldernew ComponentTree(service, callback)API.state, an XStateStateinstance representing the most recent state of the root statechart.matches(<state>),state.matches()but for every statechart instance including any invoked statecharts.hasTag(<tag>),state.hasTag()but for every statechart instance including any invoked statecharts.broadcast(<event>),service.send()but for every statechart instance including any invoked statecharts. Prefer using this instead of settinginvoke.autoForwardbecause it'll reduce the amount of junk events sent to invoked children.
All notable changes to this project will be documented in this file. See standard-version for commit guidelines.