From f2060260873826a3d05b8df011eec08bd675a7f3 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Tue, 6 Sep 2022 11:35:59 -0400 Subject: [PATCH] add the augmentMiddlewareApi as part of the updux api --- src/Updux.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Updux.js b/src/Updux.js index 3aaf8bd..b178577 100644 --- a/src/Updux.js +++ b/src/Updux.js @@ -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);