@runic-artifex/views-effect

Version 0.23.0. Read from the published package.

@runic-artifex/views-effect

appearances function

The page's appearance (appearance from @runic-artifex/views): the appearance now, then each new one.

catchCase function

Handles every case of a declared $case failure in the error channel: the ViewDomainFailure of a command or operation whose .NET command declares a [RunicUnion] failure.

clientLayer function

A layer that provides a connected client as service.

command function

Runs a command, setter, query or checked write.

CommandValue type alias

The success value of a command: for one that declares a failure, the value of its BridgeOutcome, otherwise what the client method resolves to.

connect function

Connects a generated client for the lifetime of the current Scope and disposes it when the scope closes.

connectionStates function

The page's connection to its .NET host: the current BridgeConnectionState (connecting, connected, reconnecting, lost or closed), then each change, as onBridgeConnection from @runic-artifex/views reports it.

createEffectAction function

Creates the framework-neutral runner behind useEffectAction.

CurrentRunicInstance constant

The Runic instance that the Effects and streams of this package connect and read through: the default instance (defaultInstance() from @runic-artifex/views, the page instance or in a component bundle its element's) unless one is provided.

EffectAction interface

A latest-wins Effect workflow projected into framework-neutral state.

EffectActionOptions interface
EffectActionState interface

One consistent reading of an EffectAction.

EffectActionStatus type alias
followViewport function

Sends each new row range of a viewport controller to .NET, interrupting the request for a range the user already scrolled past.

fromBridgeError function

Maps a BridgeError to its tagged error.

indexOfKey function

The position of the row with key in a query collection's current query, or undefined when no row has it: what a search scrolls to with QueryViewportController.scrollToIndex.

operation function

Starts a .NET operation and waits for its terminal status.

OperationOptions interface
queryCollectionChanges function

The rows a query collection (client.queries.{name}) shows for its range: its current snapshot, then each change, keeping only the latest one a slow consumer has not read.

queryViewportChanges function

The layout of a query viewport (createQueryViewportController): the rows a scroll container shows, with variable heights.

RetryOperationOptions interface
setQuery function

Changes a query collection's sort and filter, which every presentation of the ViewModel shares.

states function

The client's current state, then each accepted state.

StatesOptions interface
textChanges function

Each change of the language that text references resolve in (subscribeText from @runic-artifex/views): the window's locale or the page's Translations locale changed, or a runtime was configured.

textLocales function

The locale that text is shown in (textLocale from @runic-artifex/views: the page's Translations locale, which follows the window's locale): the locale now, then each new one.

texts function

A text reference that a ViewModel produced, in the window's language (resolveText): its text now, then its text after each language switch.

upload function

Uploads a file to the window's .NET host (blobs/1) and succeeds with the reference that a command's RunicUpload input takes.

ViewCancelled class

.NET cancelled the call (cancelled).

ViewDisconnected class

The Bridge is not connected to .NET: the transport closed or the host ended (disconnected).

ViewDomainFailure class

The declared failure of a command or operation ([RunicFailure] in .NET): failure is the value the generated client decoded, such as { $case: "titleRequired" }.

ViewDomainFailureOf type alias

The ViewDomainFailure a command or operation with failure type F adds; nothing when F is never.

ViewError type alias

The failures of a command, setter, query or connection.

ViewFailed class

A connect, command, setter or query failed: the .NET handler threw, the reply was invalid, or the .NET host speaks another Views protocol version (failed).

ViewFailureFields interface

Fields shared by the errors that map one BridgeError kind.

ViewOperationCancelled class

The operation ended as cancelled, by this client or another one.

ViewOperationError type alias

The failures of an operation: starting it, observing it, or its terminal status.

ViewOperationFailed class

The operation ended as failed, or succeeded without a deliverable result.

ViewOperationTimedOut class

The operation did not complete in time: the timeout option of operation passed and the operation was cancelled, or the plain client's wait({ timeout }) resolved to its client-side timed-out status (.NET never reports one).

ViewOperationUncertain class

The client could not observe whether .NET admitted or completed an operation, or .NET no longer knows its outcome (expired or unknown).

viewportChanges function

The controller's current viewport, then each change.

ViewportRange interface

The rows a viewport request asks .NET for.

ViewRejected class

.NET refused the call, for example a command whose CanExecute is false (rejected).

ViewReleased class

The Bridge is connected, but this View was released: the client was disposed, or .NET released the View, for example because navigation replaced it (released).

ViewTimeout class

A Bridge exists but did not connect in time, or a call did not complete in time (timeout).

ViewUnavailable class

No host installed window.__runicBridge, for example a page opened from a plain Vite server (unavailable).

@runic-artifex/views-effect/react

EffectActionHandle interface
useEffectAction function

Runs an Effect workflow from a component and renders its status, value and typed error.