-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Description
The middleware has the return type void
in the TypedMiddleware class
Lines 214 to 234 in 3c515fb
class TypedMiddleware<State, Action> implements MiddlewareClass<State> { | |
/// A [Middleware] function that only works on actions of a specific type. | |
final void Function( | |
Store<State> store, | |
Action action, | |
NextDispatcher next, | |
) middleware; | |
/// Create a [Middleware] that is only executed when the dispatched action | |
/// matches the [Action] type. | |
TypedMiddleware(this.middleware); | |
@override | |
dynamic call(Store<State> store, dynamic action, NextDispatcher next) { | |
if (action is Action) { | |
return middleware(store, action, next); | |
} else { | |
return next(action); | |
} | |
} | |
} |
I've expected that after merging #52 middleware
should have the return type dynamic
, but this line was not changed. Is it a bug or is there a reason for this behavior?
Possible pull request: #66
Metadata
Metadata
Assignees
Labels
No labels