@sanity/import
Version:
Import documents to a Sanity dataset
18 lines (17 loc) • 545 B
JavaScript
function progressStepper(onProgress, options) {
let current = -1;
// Stepper function which increments progress up to defined total and returns
// input argument verbatim so it may be used in the middle of a promise chain
const step = (inp)=>{
onProgress({
current: Math.min(++current, options.total),
step: options.step,
total: options.total
});
return inp;
};
step();
return step;
}
export { progressStepper };
//# sourceMappingURL=progressStepper.js.map