api.on()
Description
Allows attaching a handler to the inner eventsUsage
api.on(
    event: string,
    handler: function
): void;
Parameters
- event- (required) an event to be fired
- handler- (required) a handler to be attached (the handler arguments will depend on the event to be fired)
Example
<script>
  import { getData } from "./common/data";
  import { FilterBuilder } from "@svar-ui/svelte-filter";
  const { value, fields, options } = getData();
  
  const init = (api) => {
    api.on("edit-rule", ({ id }) => {
      console.log(id);
    });
  }
</script> 
    
<FilterBuilder {data} {fields} {options} {init} />
Related articles: How to access FilterBuilder API