add the augmentMiddlewareApi as part of the updux api

typescript
Yanick Champoux 2022-09-06 11:35:59 -04:00
parent 7f1bcbddef
commit f206026087
1 changed files with 6 additions and 4 deletions

View File

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