We are Coltor Apps ― a software development agency behind this OSS. Need a reliable tech partner?

Let’s talk

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:

ParameterTypeDescription
interpreterStoreobjectThe interpreter store instance to monitor.
callbackfunctionA 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.

Previous
useEntityValueUpdated

Canary Branch