Composer<T extends Object> class

A simple middleware compose builder

Constructors

Composer()

Properties

hashCode int
The hash code for this object.
no setterinherited
lenght int
The number of middleware installed in Composer
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

after(Middleware<T> middleware, Middleware<T> afterMiddleware) → void
Runs the second middleware after the main
before(Middleware<T> beforeMiddleware, Middleware<T> middleware) → void
Runs the second middleware before the main
branch(dynamic condition, Middleware<T> trueMiddleware, Middleware<T> falseMiddleware) → void
By condition splits the middleware
caught(CaughtMiddlewareHandler<T> errorHandler) → void
Catches errors in the middleware chain
clone() Composer<T>
Clones an instance
compose() Middleware<T>
Compose middleware handlers into a single handler
concurrency(Iterable<Middleware<T>> middlewares) → void
Concurrently launches middleware, the chain will continue if is called in all middlewares next()`
enforce(Middleware<T> beforeMiddleware, Middleware<T> middleware, Middleware<T> afterMiddleware) → void
Runs middleware before and after the main
filter(dynamic condition, Middleware<T> filterMiddleware) → void
Conditionally runs middleware or stops the chain
fork(Middleware<T> middleware) → void
Runs the middleware at the next event loop and force call next()
lazy(LazyMiddlewareFactory<T> factory) → void
Lazily asynchronously gets middleware
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
optional(dynamic condition, Middleware<T> optionalMiddleware) → void
Conditionally runs optional middleware or skips middleware
tap(Middleware<T> middleware) → void
Runs the middleware and force call next()
toString() String
A string representation of this object.
inherited
use(Middleware<T> middleware) → void
Adds middleware to the chain

Operators

operator ==(Object other) bool
The equality operator.
inherited