We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b773059 commit bf5171aCopy full SHA for bf5171a
src/components/Voyager.tsx
@@ -89,7 +89,7 @@ export default class Voyager extends React.Component<VoyagerProps> {
89
90
let promise = this.props.introspection(getIntrospectionQuery());
91
92
- if (!isPromise(promise)) {
+ if (!promise instanceof Promise) {
93
throw new Error(
94
'SchemaProvider did not return a Promise for introspection.',
95
);
@@ -249,8 +249,3 @@ export default class Voyager extends React.Component<VoyagerProps> {
249
return props.children || null;
250
};
251
}
252
-
253
-// Duck-type promise detection.
254
-function isPromise(value) {
255
- return typeof value === 'object' && typeof value.then === 'function';
256
-}
0 commit comments