flowviz
Version:
A framework which provides seamless integration with other phylogenetic tools and frameworks, while allowing workflow scheduling and execution, through the Apache Airflow workflow system.
19 lines (15 loc) • 486 B
JavaScript
import React from "react";
import useFetch from "../hooks/useFetch";
import { RequestState } from "../hooks/useFetch";
export default function Request(url, options, onError, onSuccess, onLoading) {
const [data, requestState, error] = useFetch(url, options);
switch (requestState) {
case RequestState.fetching:
return onLoading;
case RequestState.error:
return onError(error);
case RequestState.success:
return onSuccess(data);
}
return <></>;
}