export const asyncWrap = (promise: Promise<any>) => promise.then((res) => ({ res, error: null })).catch((error) => ({ res: null, error }));