Skip to content

Commit bf5171a

Browse files
committed
Drop 'isPromise'
We shouldn't do any additional validation beyound TS
1 parent b773059 commit bf5171a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/components/Voyager.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default class Voyager extends React.Component<VoyagerProps> {
8989

9090
let promise = this.props.introspection(getIntrospectionQuery());
9191

92-
if (!isPromise(promise)) {
92+
if (!promise instanceof Promise) {
9393
throw new Error(
9494
'SchemaProvider did not return a Promise for introspection.',
9595
);
@@ -249,8 +249,3 @@ export default class Voyager extends React.Component<VoyagerProps> {
249249
return props.children || null;
250250
};
251251
}
252-
253-
// Duck-type promise detection.
254-
function isPromise(value) {
255-
return typeof value === 'object' && typeof value.then === 'function';
256-
}

0 commit comments

Comments
 (0)