ima
Version:
IMA.js framework for isomorphic javascript application
53 lines (48 loc) • 1.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* Events constants, which is firing to app.
*
* @enum {string}
*/
const Events = Object.freeze({
/**
* Router fire event {@code $IMA.$Router.beforeHandleRoute} before page
* manager handle the route. Event's data contain
* {@code { params: Object<string, string>}, route: ima.router.Route,
* path: string, options: Object<string, *>}}. The {@code path} is current
* path, the {@code params} are params extracted from path, the
* {@code route} is handle route for path and the {@code options} is route
* additional options.
*
* @const
* @type {string}
*/
BEFORE_HANDLE_ROUTE: '$IMA.$Router.beforeHandleRoute',
/**
* Router fire event {@code $IMA.$Router.afterHandleRoute} after page
* manager handle the route. Event's data contain
* {@code {response: Object<string, *>, params: Object<string, string>},
* route: ima.router.Route, path: string, options: Object<string, *>}}.
* The {@code response} is page render result. The {@code path} is current
* path, the {@code params} are params extracted from path, the
* {@code route} is handle route for path and the {@code options} is route
* additional options.
*
* @const
* @type {string}
*/
AFTER_HANDLE_ROUTE: '$IMA.$Router.afterHandleRoute'
});
exports.default = Events;
typeof $IMA !== 'undefined' && $IMA !== null && $IMA.Loader && $IMA.Loader.register('ima/router/Events', [], function (_export, _context) {
'use strict';
return {
setters: [],
execute: function () {
_export('default', exports.default);
}
};
});