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:32

Constructors​

Constructor​

new HandlerFactory(props?): HandlerFactory

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

Parameters​

props?​

HandlerFactoryProps

Returns​

HandlerFactory

Methods​

fromProps()​

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

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

Converts handler properties to the appropriate Handler.

Parameters​

props​

Handler

Returns​

AbstractHandler\<Content, Data, Forward, Redirect>

Static​


from()​

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

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

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>