All files / ima/router Events.js

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44    5x             5x                                                                 5x  
import ns from '../namespace';
 
ns.namespace('ima.router');
 
/**
 * 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'
});
 
export default Events;
 
ns.ima.router.Events = Events;