@grafana/ui
Version:
Grafana Components Library
20 lines (15 loc) • 428 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var reactUse = require('react-use');
;
const useAsyncDependency = (importStatement) => {
const state = reactUse.useAsync(async () => {
return await importStatement;
});
return {
...state,
dependency: state.value
};
};
exports.useAsyncDependency = useAsyncDependency;
//# sourceMappingURL=useAsyncDependency.cjs.map