"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useLoading = useLoading;
function useLoading(isLoading, afterLoading, data, loadingSize = 10) {
  const loadingData = Array.from({
    length: loadingSize
  }, (_, index) => ({
    reservedMeta: {
      isLoading: true
    },
    id: `loading-${index}`
  }));
  return [...(isLoading ? [] : data), ...(afterLoading || isLoading ? loadingData : [])];
}