frontexpress/docs/middleware.md

64 lines
1.3 KiB
Markdown
Raw Permalink Normal View History

2016-07-22 22:02:34 +00:00
# Middleware
## Middleware.entered(request)
2016-07-22 22:02:34 +00:00
Invoked by the app before ajax request are sent or
during the DOM loading (document.readyState === 'loading').
See Application#_callMiddlewareEntered documentation for details.
Override this method to add your custom behaviour
**Parameters**
**request**: `Object`
2016-07-22 22:02:34 +00:00
## Middleware.exited(request)
2016-07-22 22:02:34 +00:00
Invoked by the app before a new ajax request is sent or before the DOM unloading.
See Application#_callMiddlewareExited documentation for details.
Override this method to add your custom behaviour
**Parameters**
**request**: `Object`
2016-07-22 22:02:34 +00:00
## Middleware.updated(request, response)
2016-07-22 22:02:34 +00:00
Invoked on ajax request responding or on DOM ready
(document.readyState === 'interactive').
See Application#_callMiddlewareUpdated documentation for details.
Override this method to add your custom behaviour
**Parameters**
**request**: `Object`
2016-07-22 22:02:34 +00:00
**response**: `Object`
2016-07-22 22:02:34 +00:00
## Middleware.failed(request, response)
2016-07-22 22:02:34 +00:00
Invoked when ajax request fails.
Override this method to add your custom behaviour
**Parameters**
**request**: `Object`
2016-07-22 22:02:34 +00:00
**response**: `Object`
2016-07-22 22:02:34 +00:00
## Middleware.next()
2016-07-22 22:02:34 +00:00
Allow the hand over to the next middleware object or function.
Override this method and return `false` to break execution of
middleware chain.
**Returns**: `Boolean`, `true` by default