-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Exposes store transition utility and types #5386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Expose the `createStoreTransition` utility. Make internal store logic and configuration types publicly accessible. This enables broader integration and customizability for store management.
🦋 Changeset detectedLatest commit: 7c923e6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Might also be worth considering adding in the 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 |
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 |
createStoreWithProducer, | ||
createStoreConfig | ||
createStoreConfig, | ||
createStoreTransition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add some basic tests for this one? one test that would show (roughly) how you plan to use it would be helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My actual usage is just copy pasting the persist utility from David's branch. Maybe the better course of action here is to maybe get that branch merged instead with perhaps these extra utils exposed should someone else want to build a custom utility as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are copy-pasting from the other branch then let's not reuse that sample as a test case for this exposed util, a new one (even a rather dummy one) should be added to tests. At the moment, this util is indirectly tested because other things use it but when exposing it as part of the public API we should have an extra smoke test for this new public interface~
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 utilitycreateStoreTransition
utility function.StoreLogic
,AnyStoreLogic
, andAnyStoreConfig
types.Additional context: Discord thread