File

src/handlers/RepeatIntent/RepeatIntent.service.ts

Methods

Public recordResponse
recordResponse(response: Response)
Returns: void
Public loadLastResponse
loadLastResponse()
Returns: Response
Public hasLastResponse
hasLastResponse()
Returns: boolean

Properties

Private recordKey
recordKey: "recordedResponse"
Default value: recordedResponse
import { Response } from 'ask-sdk-model';
import { SessionAttributesManager } from '../../SessionAttributesManager/SessionAttributesManager.service';

export class RepeatIntentService extends SessionAttributesManager {
  private readonly recordKey = 'recordedResponse';
  public recordResponse(response: Response) {
    this.updateSessionAttributes<Response>(this.recordKey, response);
  }
  public loadLastResponse(): Response | null {
    return this.getSessionAttributes<Response>(this.recordKey);
  }
  public hasLastResponse(): boolean {
    const data = this.loadLastResponse();
    return !!data;
  }
}

results matching ""

    No results matching ""