@equinor/fusion
Advanced tools
Comparing version 0.1.63 to 0.1.64
@@ -78,3 +78,3 @@ import EventEmitter, { useEventEmitterValue } from "../utils/EventEmitter"; | ||
}; | ||
const useTasksData = (event, fetchAsync) => { | ||
const useTasksData = (event, fetchAsync, defaultData) => { | ||
const tasksContainer = useTasksContainer(); | ||
@@ -98,9 +98,9 @@ const [error, setError] = useState(null); | ||
}, []); | ||
return [error, isFetching, data || []]; | ||
return [error, isFetching, data || defaultData]; | ||
}; | ||
const useTaskSourceSystems = () => { | ||
return useTasksData("source-systems-updated", async (tasksContainer) => await tasksContainer.getSourceSystemsAsync()); | ||
return useTasksData("source-systems-updated", async (tasksContainer) => await tasksContainer.getSourceSystemsAsync(), useTasksContainer().getSourceSystems()); | ||
}; | ||
const useTaskTypes = () => { | ||
return useTasksData("task-types-updated", async (tasksContainer) => await tasksContainer.getTaskTypesAsync()); | ||
return useTasksData("task-types-updated", async (tasksContainer) => await tasksContainer.getTaskTypesAsync(), useTasksContainer().getTaskTypes()); | ||
}; | ||
@@ -116,3 +116,3 @@ const useTaskPrioritySetter = () => { | ||
const [taskTypesError, isFetchingTaskTypes, taskTypes] = useTaskTypes(); | ||
const [tasksError, isFetchingTasks, tasks] = useTasksData("tasks-updated", async (tasksContainer) => await tasksContainer.getAllTasksAsync()); | ||
const [tasksError, isFetchingTasks, tasks] = useTasksData("tasks-updated", async (tasksContainer) => await tasksContainer.getAllTasksAsync(), useTasksContainer().getTasks()); | ||
const error = sourceSystemsError || taskTypesError || tasksError; | ||
@@ -119,0 +119,0 @@ const isFetching = isFetchingTaskTypes || isFetchingTasks; |
{ | ||
"name": "@equinor/fusion", | ||
"version": "0.1.63", | ||
"version": "0.1.64", | ||
"description": "Everything a Fusion app needs to communicate with the core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
136738