Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jun 22, 2022

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

xstate-component-tree@4.1.0

Minor Changes

  • #63 d9d3820 Thanks @tivac! - Added observable API

    Available on the ComponentTree instance 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 callback passed to .subscribe(...) will immediately be called with the most recent result of building the component tree (or false if it hasn't finished yet), and then for each complete tree building run after that the callback will be called with a single argument. The arg is an Object with a null prototype and the following properties:

    • tree, nested component structures. This is the same as the first argument to the older new ComponentTree(service, callback) API.
    • state, an XState State instance 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 setting invoke.autoForward because 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.

@github-actions github-actions bot force-pushed the changeset-release/main branch from d9c4b0c to cae77ba Compare June 22, 2022 21:43
@tivac tivac merged commit a088dab into main Jun 22, 2022
@tivac tivac deleted the changeset-release/main branch June 22, 2022 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants