Skip to content

Commit a8a0d9d

Browse files
authored
add support for async RSAA properties
1 parent 6e782cd commit a8a0d9d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/middleware.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function createMiddleware(options = {}) {
8888
// Process [RSAA].endpoint function
8989
if (typeof endpoint === 'function') {
9090
try {
91-
endpoint = endpoint(getState());
91+
endpoint = await endpoint(getState());
9292
} catch (e) {
9393
return next(
9494
await actionWith(
@@ -106,7 +106,7 @@ function createMiddleware(options = {}) {
106106
// Process [RSAA].body function
107107
if (typeof body === 'function') {
108108
try {
109-
body = body(getState());
109+
body = await body(getState());
110110
} catch (e) {
111111
return next(
112112
await actionWith(
@@ -124,7 +124,7 @@ function createMiddleware(options = {}) {
124124
// Process [RSAA].headers function
125125
if (typeof headers === 'function') {
126126
try {
127-
headers = headers(getState());
127+
headers = await headers(getState());
128128
} catch (e) {
129129
return next(
130130
await actionWith(
@@ -142,7 +142,7 @@ function createMiddleware(options = {}) {
142142
// Process [RSAA].options function
143143
if (typeof options === 'function') {
144144
try {
145-
options = options(getState());
145+
options = await options(getState());
146146
} catch (e) {
147147
return next(
148148
await actionWith(

0 commit comments

Comments
 (0)