Skip to main content
cngx-src documentation

ScalarCommitHandler

Interface

projects/forms/select/shared/scalar-commit-handler.ts

Import#

import { ScalarCommitHandler } from '@cngx/forms/select'

Description#

API returned from createScalarCommitHandler.

Index#

Methods#

beginCommit#void
beginCommit(intended: T, previous: T | undefined, action: CngxSelectCommitAction<T>)

Start a commit. Consumer pre-writes optimistic value.set(intended)

  • togglingOption.set(option); handler drives the state machine.
@paramintendedT
@parampreviousT | undefined
dispatchFromActivation#void
dispatchFromActivation(intended: T, option: CngxSelectOptionDef<T>)

Dispatch a commit from AD activation. No-op when commitAction is unbound - wire the onActivate path to finalizeSelection in that case.

@paramintendedT
finalizeSelection#void
finalizeSelection(intended: T, option: CngxSelectOptionDef<T>, previousValue: T | undefined)

Non-commit finalization.

@paramintendedT
@parampreviousValueT | undefined
retryLast#void

Replay last commit. No-op when preconditions unmet.