Lavash.Form.Runtime (Lavash v0.3.0-rc.3)

Copy Markdown View Source

Shared form handling runtime for both LiveView and Component.

This module contains the common logic for form operations:

Summary

Functions

Broadcast mutation to all relevant PubSub topics.

Extract the Ash changeset from various form types.

Extract the Ash resource module from various form types.

Extract per-field errors from an Ash submit failure for storage in _server_errors state.

Functions

broadcast_mutation(form)

Broadcast mutation to all relevant PubSub topics.

Uses the resource's notify_on configuration from Lavash.Resource extension to enable fine-grained invalidation based on filter combinations.

extract_changeset(cs)

Extract the Ash changeset from various form types.

Supports:

extract_resource(arg1)

Extract the Ash resource module from various form types.

Supports:

extract_submit_errors(arg1)

Extract per-field errors from an Ash submit failure for storage in _server_errors state.

Returns a map of %{"field_name" => ["error message", ...]}.