form-graph
    Preparing search index...

    Function cachedFactory

    • The same caching the built-in helpers use, packaged for an app's OWN def factories: the factory's result is built once per distinct config and reused on every later call — which is what makes calling it from a field factory (re-run every resolve pass) free after the first pass.

      The config is the cache key (JSON-serialized), so it must be JSON-serializable and function-free; pass keyOf to key on something narrower. Unlike the built-ins, this caches the WHOLE def — meta included — so per-pass meta belongs at the call site (spread the cached def and override), not in the config. defFamily is the primitive-args sibling for ctx-dependent schemas, where the author names the deps explicitly.

      Type Parameters

      • A extends unknown[]
      • R

      Parameters

      • build: (...args: A) => R
      • keyOf: (...args: A) => string = ...

      Returns (...args: A) => R