Skip to main content

HandlerFactory

Stentor API Reference


Stentor API Reference / stentor-handler-factory/src / HandlerFactory

Class: HandlerFactory

Defined in: packages/stentor-handler-factory/src/HandlerFactory.ts:34

Constructors​

Constructor​

new HandlerFactory(props?): HandlerFactory

Defined in: packages/stentor-handler-factory/src/HandlerFactory.ts:39

Parameters​

props?​

HandlerFactoryProps

Returns​

HandlerFactory

Methods​

fromProps()​

fromProps(props): AbstractHandler<Content, Data, Forward, Redirect> | undefined

Defined in: packages/stentor-handler-factory/src/HandlerFactory.ts:87

Converts handler properties to the appropriate Handler.

Parameters​

props​

Handler

Returns​

AbstractHandler<Content, Data, Forward, Redirect> | undefined

Static​


from()​

from(request, context): AbstractHandler<Content, Data, Forward, Redirect> | undefined

Defined in: packages/stentor-handler-factory/src/HandlerFactory.ts:118

Gets the correct handler from storage.

Depending on if audio is playing or not, the correct handler is picked off the storage if it is available or not.

Parameters​

request​

Request

context​

Context

Returns​

AbstractHandler<Content, Data, Forward, Redirect> | undefined