React API Reference
useEntityProcessabilityChanged
The useEntityProcessabilityChanged
hook calls the provided callback whenever the processability of an entity changes in the given interpreter store.
Reference
useEntityProcessabilityChanged(interpreterStore, callback)
import {
useEntityProcessabilityChanged,
useInterpreterStore,
} from "@coltorapps/builder-react";
import { formBuilder } from "./form-builder";
export function App() {
const interpreterStore = useInterpreterStore(formBuilder, formSchema);
useEntityProcessabilityChanged(interpreterStore, (entity) => {
console.log(
`Entity ${entity.id} processability changed`,
"from",
entity.prevProcessable,
"to",
entity.processable,
);
});
return null;
}
Parameters
useEntityProcessabilityChanged
accepts two parameters:
Parameter | Type | Description |
---|---|---|
interpreterStore | object | The interpreter store instance to monitor. |
callback | function | A function called whenever an entity's processability changes. Receives the updated entity, including processable and prevProcessable . |
Returns
This hook does not return a value. It registers a side effect that triggers the provided callback whenever an entity's processability changes in the interpreter store.