Skip to content

Conversation

@VldMrgnn
Copy link
Collaborator

@VldMrgnn VldMrgnn commented Nov 5, 2024

This pull request introduces several changes to the query/thunk.ts, store/store.ts, and test/thunk.test.ts files 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:

  • Added IdContext to manage unique store IDs and updated createStore to set this context (store/store.ts). [1] [2] [3]
  • Modified createThunks to use the IdContext for registering thunks with unique store IDs (query/thunk.ts). [1] [2] [3]

Code Enhancements:

  • Introduced a unique thunkId incrementer to replace the previous random ID generation (query/thunk.ts). [1] [2]

Testing:

  • Incorporated @neurosnap's proposed test case to verify that multiple stores can register and dispatch the same thunk (test/thunk.test.ts).

@neurosnap neurosnap merged commit d0a8540 into fxforge:main Nov 14, 2024
4 checks passed
@VldMrgnn VldMrgnn deleted the exploring_registration_options_v2 branch November 18, 2024 18:29
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