AdaptiveInit Module
Helpers for building an AdaptiveInit.
These keep the Disposables list and the default subscription
projection hidden: AdaptiveInit.ofFrameBuilder
defaults them (empty subscriptions, no disposables), and
AdaptiveInit.withSubscriptions /
AdaptiveInit.withDisposables /
AdaptiveInit.withDisposable replace or append
to them. Callers never write Disposables = [] by hand.
Functions and values
| Function or value |
Description
|
Full Usage:
ofFrameBuilder frameBuilder
Parameters:
unit -> 'Frame
-
Forces the frame's output projections and packs them into 'Frame.
Returns: AdaptiveInit<'Frame>
Modifiers: inline Type parameters: 'Frame |
Creates an init from a frame builder with no subscriptions and no disposables.
|
Full Usage:
withDisposable disposable init
Parameters:
IDisposable
init : AdaptiveInit<'Frame>
Returns: AdaptiveInit<'Frame>
Modifiers: inline Type parameters: 'Frame |
Adds a single disposable to the init. The disposable is released when the runner is disposed.
|
Full Usage:
withDisposables disposables init
Parameters:
IDisposable list
init : AdaptiveInit<'Frame>
Returns: AdaptiveInit<'Frame>
Modifiers: inline Type parameters: 'Frame |
Appends a list of disposables to the init. The disposables are released when the runner is disposed.
|
Full Usage:
withSubscriptions subscribe init
Parameters:
AdaptiveFrameContext -> amap<SubId, AdaptiveSub>
-
Builds the subscription map from the context.
init : AdaptiveInit<'Frame>
-
The init to configure.
Returns: AdaptiveInit<'Frame>
Modifiers: inline Type parameters: 'Frame |
Sets the subscription projection. The runner reads the map once per step (skipping the read when nothing changed), compares it by SubId against its attached table, and starts new, keeps matching, and stops vanished subscriptions. The adaptive counterpart of Program.withSubscription.
The projection must return a stable map: build it once and return the
same instance. The runner checks the map's version every step and skips
the diff when nothing changed.
If you need subscriptions that change with game state, use
|
Mibo