mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { defineStore } from "pinia";
|
|
|
|
import {
|
|
fetchInvocationDetails,
|
|
fetchInvocationJobsSummary,
|
|
fetchInvocationStep,
|
|
type WorkflowInvocation,
|
|
type WorkflowInvocationJobsSummary,
|
|
type WorkflowInvocationStep,
|
|
} from "@/api/invocations";
|
|
import { useKeyedCache } from "@/composables/keyedCache";
|
|
|
|
export const useInvocationStore = defineStore("invocationStore", () => {
|
|
const { getItemById: getInvocationById, fetchItemById: fetchInvocationForId } =
|
|
useKeyedCache<WorkflowInvocation>(fetchInvocationDetails);
|
|
|
|
const { getItemById: getInvocationJobsSummaryById, fetchItemById: fetchInvocationJobsSummaryForId } =
|
|
useKeyedCache<WorkflowInvocationJobsSummary>(fetchInvocationJobsSummary);
|
|
|
|
const { getItemById: getInvocationStepById, fetchItemById: fetchInvocationStepById } =
|
|
useKeyedCache<WorkflowInvocationStep>(fetchInvocationStep);
|
|
|
|
return {
|
|
getInvocationById,
|
|
fetchInvocationForId,
|
|
getInvocationJobsSummaryById,
|
|
fetchInvocationJobsSummaryForId,
|
|
getInvocationStepById,
|
|
fetchInvocationStepById,
|
|
};
|
|
});
|