Skip to content

Implementing StorytellerListViewDelegate Callbacks#

The StorytellerListViewDelegate can be used to handle events from the Story/Clip list. To define delegate methods, set the delegate property on a Storyteller List.

const storyRow = new Storyteller.StorytellerStoriesRowView('row-id');
storyRow.delegate = {
    ...
};

Delegate Methods#

You can implement these optional methods when responding to the StorytellerListViewDelegate protocol:

  • onDataLoadStarted: () => void - called when the network request to load data for all Stories/Clips has started
  • onDataLoadComplete: (success: boolean, error: Error | null, dataCount: number) => void - called when the data loading network request is complete
  • success: whether or not the request was successful
  • error: the HTTPRequestError if the request was not successful
  • dataCount: the number of Stories loaded
  • onPlayerDismissed: () => void - called when a Story/Clip has been dismissed
interface IListViewDelegate {
  onDataLoadStarted: () => void;

  onDataLoadComplete: (
    success: boolean,
    error: Error | null,
    dataCount: number
  ) => void;

  onPlayerDismissed: () => void;
}