feat(FN-4649): complete Step 1 — add core task-created hook
Fusion-Task-Id: FN-4649 Fusion-Task-Lineage: 98ab6ec3-5253-4db6-93f0-de4ab7792002
This commit is contained in:
committed by
gsxdsm
parent
8b371bae04
commit
4c3cd0b406
14
packages/core/src/task-creation-hooks.ts
Normal file
14
packages/core/src/task-creation-hooks.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { Task } from "./types.js";
|
||||
import type { TaskStore } from "./store.js";
|
||||
|
||||
export type TaskCreatedHook = (task: Task, store: TaskStore) => Promise<void> | void;
|
||||
|
||||
let taskCreatedHook: TaskCreatedHook | undefined;
|
||||
|
||||
export function setTaskCreatedHook(fn: TaskCreatedHook | undefined): void {
|
||||
taskCreatedHook = fn;
|
||||
}
|
||||
|
||||
export function getTaskCreatedHook(): TaskCreatedHook | undefined {
|
||||
return taskCreatedHook;
|
||||
}
|
||||
Reference in New Issue
Block a user