freddi301/flow-validator

View on GitHub
src/async/syncFunctionToAsync.js

Summary

Maintainability
A
0 mins
Test Coverage
// @flow

export function syncFunctionToAsync<A, T>(
  f: (value: A) => T
): (value: A) => Promise<T> {
  return v => Promise.resolve(v).then(f);
}