Callback that is called when the stream is stopped by the user. Provides a mutate function to update the stream state immediately without requiring a server roundtrip.
onStop: (options: __type) => voidonStop: ({ mutate }) => {
mutate((prev) => ({
...prev,
ui: prev.ui?.map(component =>
component.props.isLoading
? { ...component, props: { ...component.props, stopped: true, isLoading: false }}
: component
)
}));
}