Use this if you prefer composition over setup function
Example usage:
@kosModel("my-model")
export class MyModel implements IKosDataModel, FutureContainer {
id: string;
private futures = createKosModelFutureManager(this);
// Delegate FutureContainer interface
get futureHandler() { return this.futures.futureHandler; }
get future() { return this.futures.future; }
get progress() { return this.futures.progress; }
get status() { return this.futures.status; }
get isRunning() { return this.futures.isRunning; }
get isCancelled() { return this.futures.isCancelled; }
async cancelFuture() { return this.futures.cancelFuture(); }
constructor(modelId: string, options: any, context: KosCreationContext) {
this.id = modelId;
}
async performOperation() { return "done"; }
unload() {}
}
Composition helper that works with