From 1018a4ca9069ebbc9a1d8af9f351fd5e74963736 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 2 Oct 2020 10:27:59 +0300 Subject: [PATCH] Store asyncDispatch: support passing non-async actions --- src/store/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/index.ts b/src/store/index.ts index b9aaedd..bf0ec90 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -25,7 +25,8 @@ if (process.env.NODE_ENV === "development") { middleware.push(createLogger()); } -export function asyncDispatch(action: ActionMeta, V>): Promise> { +// FIXME: Hack, we don't actually return a promise when one is not passed. +export function asyncDispatch(action: ActionMeta | T, V>): Promise> { return store.dispatch(action) as any; }