Add function docs

This commit is contained in:
Leonid Logvinov
2018-03-21 15:24:41 +01:00
parent 477daf4168
commit 111f7e917e

View File

@@ -1,7 +1,11 @@
import { logUtils } from '@0xproject/utils';
// Makes an async function no-throw printing errors to the console
export function consoleReporter<T>(asyncFn: (arg: T) => Promise<void>) {
/**
* Makes an async function no-throw printing errors to the console
* @param asyncFn async function to wrap
* @return Wrapped version of the passed function
*/
export function consoleReporter<T>(asyncFn: (arg: T) => Promise<void>): (arg: T) => Promise<void> {
const noThrowFnAsync = async (arg: T) => {
try {
const result = await asyncFn(arg);