feat: support multiple stores registering the same thunk #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to the
query/thunk.ts,store/store.ts, andtest/thunk.test.tsfiles to support multiple stores registering same thunk. The most important changes include adding a unique store ID context, modifying the thunk creation process to handle multiple store registrations, and adding tests to ensure the new functionality works as expected.Support for Multiple Store Registrations:
IdContextto manage unique store IDs and updatedcreateStoreto set this context (store/store.ts). [1] [2] [3]createThunksto use theIdContextfor registering thunks with unique store IDs (query/thunk.ts). [1] [2] [3]Code Enhancements:
thunkIdincrementer to replace the previous random ID generation (query/thunk.ts). [1] [2]Testing:
test/thunk.test.ts).