getBeforeMiddleware<T> function
Runs the second middleware before the main
Example:
getBeforeMiddleware(
myMockMiddleware,
ouputUserData
);
Implementation
Middleware<T> getBeforeMiddleware<T>(
Middleware<T> beforeMiddleware,
Middleware<T> middleware,
// ignore: prefer_expression_function_bodies
) {
return (context, next) async {
final called = await wrapMiddlewareNextCall(context, beforeMiddleware);
if (called) {
return middleware(context, next);
}
};
}