Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 309 Bytes

isPromise.md

File metadata and controls

17 lines (13 loc) · 309 Bytes

isPromise

Test whether an object looks like a promise or not

import { isPromise } from '@ttrmz/react-utils'

Usage

isPromise(Promise.resolve()) // true
isPromise({then:function () {...}}) // true
isPromise(null) // false
isPromise({}) // false
isPromise({then: true}) // false