react-global-state-hooks
Version:
This is a package to easily handling global-state across your react components
10 lines (9 loc) • 301 B
TypeScript
type TryCatchResult<T extends (...args: any[]) => any> = {
result: ReturnType<T> | null;
error: unknown;
};
/**
* Simple linear try catch utility to avoid repetitive try catch blocks
*/
declare function tryCatch<T extends () => any>(callback: T): TryCatchResult<T>;
export default tryCatch;