api.setNext()
Description
Allows adding some action into the Event Bus orderUsage
api.setNext(next: any): void;
Parameters
next
- (required) the action to be included into the Event Bus order
Example
<script>
import { FilterBuilder } from "wx-svelte-filter";
import { getData } from "./common/data";
const { value, fields, options } = getData();
function CustomActions() {
return class {
constructor(api) {
api.on("change", (value) => {
console.log("Filter value changed:", value);
});
}
};
}
const init = (api) => {
api.setNext(CustomActions()); // Add custom action to Event Bus
};
</script>
<FilterBuilder {fields} {value} {options} {init} />
Related articles: How to access FilterBuilder API