public class |source

Replay

You can directly use an instance of this class. replay

Replay singleton takes care of replay.

Static Member Summary

Static Public Members
public static
public static

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public get

Get event object stored in local storage.

public
public

Method Summary

Public Methods
public

Clears the storage.

public

Gets the current event index.

public

getItem(index: *): Object

Get event Item by Index.

public
public

Gets number of total evnets

public

Increment current event index.

public

load(events: *)

Load events into storage.

public

playNextEvent(): Promise<Object>|Promise<undefined>

Returns a promise which executes an event.

public

Ready state check, checks wheter the document is ready.

public

async replay(): Promise<void>

Replay events.

public

setReplaySpeed(divider: *)

Sets the replay speed

public

stop()

Stop replay execution.

public

update replay storage

Static Public Members

public static instance: * source

public static storageKey: * source

Public Constructors

public constructor() source

Public Members

public cancel: boolean source

public get events: Object: * source

Get event object stored in local storage.

Return:

Object

public instance: * source

public storageKey: string source

Public Methods

public clear() source

Clears the storage.

public getCurrentEventIndex(): * | number source

Gets the current event index.

Return:

* | number

public getItem(index: *): Object source

Get event Item by Index.

Params:

NameTypeAttributeDescription
index*

Return:

Object

public getReplaySpeed(): * source

Return:

*

public getTotalEvents(): Number source

Gets number of total evnets

Return:

Number

public incrementCurrentEventIndedx() source

Increment current event index.

public load(events: *) source

Load events into storage. adds a currentEventIndex which will be used to keep track on which event we are currently playing.

Params:

NameTypeAttributeDescription
events*

public playNextEvent(): Promise<Object>|Promise<undefined> source

Returns a promise which executes an event. Checks for cancellation which occurs when this.stop() has been called. Finds the event to be executed in replay storage. Increment the current event index. Finds the correct class based on event type in Registry. Execute the replay function on the event class and wait for it to resolve.

Return:

Promise<Object>|Promise<undefined>

returns a Promise which rejects to an error and resolves to undefined.

public readyStateCheck(): Promise source

Ready state check, checks wheter the document is ready. resolves when the document is ready.

Return:

Promise

resolves when document is ready.

public async replay(): Promise<void> source

Replay events.

Return:

Promise<void>

public setReplaySpeed(divider: *) source

Sets the replay speed

Params:

NameTypeAttributeDescription
divider*

higher is faster, lower is slower.

public stop() source

Stop replay execution.

public updateReplayStorage(object: Object) source

update replay storage

Params:

NameTypeAttributeDescription
objectObject

object to store.