refreshOnRunEnd
Calls fn each time the agent's status leaves 'running': when a run
completes, fails or pauses on an interrupt. Pass a thread directory view in
place of a function to refresh it. It keeps following the agent across
thread switches.
Call it in an injection context; it uses an effect, so the call is
delivered when effects flush and the registration ends with the context.
import { refreshOnRunEnd } from '@threadplane/angular';Declaration · overload 1
export declare function refreshOnRunEnd(agent: {
readonly status: Signal<string>;
}, fn: RefreshTarget): void;Parameters
agent· required{ readonly status: Signal<string>; }fn· requiredRefreshTarget
Returns
voidExamples
constructor() {
refreshOnRunEnd(this.agent, this.threads);
}