add the augmentMiddlewareApi as part of the updux api

This commit is contained in:
Yanick Champoux 2022-09-06 11:35:59 -04:00
parent 7f1bcbddef
commit f206026087

View File

@ -201,14 +201,16 @@ export class Updux {
this.#localReactions = [...this.#localReactions, reaction]; this.#localReactions = [...this.#localReactions, reaction];
} }
augmentMiddlewareApi(api) {
return augmentMiddlewareApi(api, this.actions, this.selectors);
}
subscribeTo(store, subscription) { subscribeTo(store, subscription) {
const localStore = augmentMiddlewareApi( const localStore = this.augmentMiddlewareApi(
{ {
...store, ...store,
subscribe: (subscriber) => this.subscribeTo(store, subscriber), // TODO not sure subscribe: (subscriber) => this.subscribeTo(store, subscriber), // TODO not sure
}, }
this.actions,
this.selectors,
); );
const subscriber = subscription(localStore); const subscriber = subscription(localStore);