@@ -21,6 +21,7 @@ const hydratedStoreRegistry = new CallbackRegistry<Store>('hydrated store');
2121/**
2222 * Register a store generator, a function that takes props and returns a store.
2323 * @param storeGenerators { name1: storeGenerator1, name2: storeGenerator2 }
24+ * @public
2425 */
2526export function register ( storeGenerators : Record < string , StoreGenerator > ) : void {
2627 Object . keys ( storeGenerators ) . forEach ( ( name ) => {
@@ -46,6 +47,7 @@ export function register(storeGenerators: Record<string, StoreGenerator>): void
4647 * @param throwIfMissing Defaults to true. Set to false to have this call return undefined if
4748 * there is no store with the given name.
4849 * @returns Redux Store, possibly hydrated
50+ * @public
4951 */
5052export function getStore ( name : string , throwIfMissing = true ) : Store | undefined {
5153 try {
@@ -71,6 +73,7 @@ This can happen if you are server rendering and either:
7173 * Internally used function to get the store creator that was passed to `register`.
7274 * @param name
7375 * @returns storeCreator with given name
76+ * @public
7477 */
7578export const getStoreGenerator = ( name : string ) : StoreGenerator => storeGeneratorRegistry . get ( name ) ;
7679
@@ -85,6 +88,7 @@ export function setStore(name: string, store: Store): void {
8588
8689/**
8790 * Internally used function to completely clear hydratedStores Map.
91+ * @public
8892 */
8993export function clearHydratedStores ( ) : void {
9094 hydratedStoreRegistry . clear ( ) ;
@@ -93,12 +97,14 @@ export function clearHydratedStores(): void {
9397/**
9498 * Get a Map containing all registered store generators. Useful for debugging.
9599 * @returns Map where key is the component name and values are the store generators.
100+ * @public
96101 */
97102export const storeGenerators = ( ) : Map < string , StoreGenerator > => storeGeneratorRegistry . getAll ( ) ;
98103
99104/**
100105 * Get a Map containing all hydrated stores. Useful for debugging.
101106 * @returns Map where key is the component name and values are the hydrated stores.
107+ * @public
102108 */
103109export const stores = ( ) : Map < string , Store > => hydratedStoreRegistry . getAll ( ) ;
104110
0 commit comments