UNPKG

@behance/router

Version:

A lightweight JavaScript library is built on top of route-recognizer and rsvp.js to provide an API for handling routes

20 lines (15 loc) 659 B
import ResolvedHandlerInfo from 'router/handler-info/resolved-handler-info'; import UnresolvedHandlerInfoByObject from 'router/handler-info/unresolved-handler-info-by-object'; import UnresolvedHandlerInfoByParam from 'router/handler-info/unresolved-handler-info-by-param'; handlerInfoFactory.klasses = { resolved: ResolvedHandlerInfo, param: UnresolvedHandlerInfoByParam, object: UnresolvedHandlerInfoByObject }; function handlerInfoFactory(name, props) { var Ctor = handlerInfoFactory.klasses[name], handlerInfo = new Ctor(props || {}); handlerInfo.factory = handlerInfoFactory; return handlerInfo; } export default handlerInfoFactory;