Skip to main content

request-data

Description

Fires when folder data is requested

The action fires:

  • when data for the folder with the lazy parameter is requested (the action fires only once, and after the folder gets the requested data, there's no need to call the action as data is available locally)
  • when the spinner icon (next to the breadcrumbs) is activated for the open directory

Usage

"request-data": ({
id: string
}) => boolean | void;

Parameters

The callback of the request-data action takes an object with the following parameters:

  • id - (required) the ID of a folder for which data is requested

Example

<script>
import { getData, getDrive } from "./common/data";
import { Filemanager } from "@wx/svelte-filemanager";

let api;

$: if (api) {
api.on("request-data", ({ id }) => {
console.log("Data request for: " + id);
});
};

</script>

<Filemanager data={getData()} drive={getDrive()} bind:api />

Related articles: How to access File Manager API