xstate icon indicating copy to clipboard operation
xstate copied to clipboard

Exposes store transition utility and types

Open svemat01 opened this issue 3 months ago • 4 comments

This PR exposes additional utilities and types from the xstate-store package.

The new exports provide consumers with direct access to the createStoreTransition function and key store configuration types. This enhances flexibility and configurability, allowing for more advanced and custom store configurations to be built externally such as the currently stalled persist utility

  • Exports createStoreTransition utility function.
  • Exports StoreLogic, AnyStoreLogic, and AnyStoreConfig types.

Additional context: Discord thread

svemat01 avatar Oct 06 '25 10:10 svemat01

🦋 Changeset detected

Latest commit: 7c923e6e459d3aed6e2135975b63b867bc2bc447

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@xstate/store Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Oct 06 '25 10:10 changeset-bot[bot]

Might also be worth considering adding in the storeConfigToLogic util from the persist branch so that custom middleware creators don't have to copy paste it.

Happy to add it in here as well or submit it as another PR if it's wanted

svemat01 avatar Oct 06 '25 10:10 svemat01

Might also be worth considering adding in the storeConfigToLogic util from the persist branch so that custom middleware creators don't have to copy paste it.

Happy to add it in here as well or submit it as another PR if it's wanted

Sure, you can expose that one too.

Can you also add a changeset? Just pnpm changeset and let's make it a minor.

davidkpiano avatar Oct 06 '25 13:10 davidkpiano

Just to clarify, that utility does not currently exist, it was only introduced in your persist branch so adding it here would include both adding that utility and potentially updating the undo helper to use it. So not just a quick extra export

svemat01 avatar Oct 06 '25 20:10 svemat01