Closed sheldonbaker closed 3 months ago
Try it without caching first, i.e. create the schema dynamically in the load function, most likely the difference in speed in negligible.
If you need caching, you can cache the schemas yourself, for example with a lru-cache or ttl-cache. As long as it stays in memory, it will be re-used by the memoize function when the adapter is created.
I'd like to have a schema with validations that are dependent on a remote data source, but schemas must be defined outside a load function for caching purposes.
What's the best way to accomplish this use case? Would it just be to have another schema that extends from the main schema and I additionally
superValidate
that in my form action?