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 startedonDataLoadComplete: (success: boolean, error: Error | null, dataCount: number) => void- called when the data loading network request is completesuccess: whether or not the request was successfulerror: theHTTPRequestErrorif the request was not successfuldataCount: the number of Stories loadedonPlayerDismissed: () => void- called when a Story/Clip has been dismissed
interface IListViewDelegate {
onDataLoadStarted: () => void;
onDataLoadComplete: (
success: boolean,
error: Error | null,
dataCount: number
) => void;
onPlayerDismissed: () => void;
}