Simulate File loading.
import { defineFilePond } from 'filepond';
import { locale } from 'filepond/locales/en-gb.js';
import { SimulatedLoader } from 'filepond/extensions/simulated-loader.js';
defineFilePond({
locale,
extensions: [
// Add the SimulatedLoader extension
SimulatedLoader
]
})
Configuration
The SimulatedLoader extension accepts an option object of type SimulatedLoaderOptions which defines the properties below.
actionLoad
Action to run to trigger the load operation. Defaults to ‘load’
actionLoad?: string
actionAbort
Action to run to abort the load operation. Defaults to ‘abort’
actionAbort?: string
bitrate
Maximum simulated load speed. Defaults to 1024000
bitrate?: number
tickrate
Delay in milliseconds between load ticks. Defaults to 250
tickrate?: number
connectionDelay
Delay before starting load. Defaults to 250
connectionDelay?: number
parallel
Total parallel load operations. Defaults to 4
parallel?: number
errorDelay
Delay until fake error thrown. Defaults to undefined
errorDelay?: number
fetchFile
File to fetch. Defaults to undefined
fetchFile?: (entry: FilePondEntry, options: { abortController: AbortController; onprogress: (e: ProgressEvent<EventTarget>) => void; onabort: () => void; }) => Promise<File>