Sprites JavaScript Reactive Framework
The reactive framework. Values hold state, calculations read and derive, and the structure grows and shrinks with the data. The core holds the values, calculations, structure and context; the modules around it add logic, data, defaults and maths over those values. Choose a module below.
Reactive Modules
Sprites.Reactive
The core: values hold state, calculations derive, the structure follows the data, context injects a value for a subtree, and drivers run async work.
- Sprites.Reactive.Assert
- Sprites.Reactive.Calculate
- Sprites.Reactive.Calculate.Get
- Sprites.Reactive.Binding
- Sprites.Reactive.Driver
- Sprites.Reactive.Each
- Sprites.Reactive.Emit
- Sprites.Reactive.Field
- Sprites.Reactive.Gather
- Sprites.Reactive.If
- Sprites.Reactive.Else
- Sprites.Reactive.Pending
- Sprites.Reactive.Repeat
- Sprites.Reactive.Reverse
- Sprites.Reactive.Set
- Sprites.Reactive.Value
- Sprites.Reactive.Writable
- Sprites.Reactive.Object
- Sprites.Reactive.Array
- Sprites.Reactive.Constant
- Sprites.Reactive.Context.Get
- Sprites.Reactive.Context.Set
Sprites.Logic
Boolean logic over reactive values, for conditions that derive and follow.
Sprites.Text
String operations over reactive values, so a label or a parsed number that is built from several values stays live.
Sprites.Object
Object helpers: Read builds a read-only object from fields, Field views one field two ways, With copies with one field replaced, At reads a field by a reactive key. For a two-way object, use Sprites.Reactive.Object.
Sprites.Array
List helpers that read a fact from a list, crop or pad it, or bind its length two ways.
- Sprites.Array.At
- Sprites.Array.Build
- Sprites.Array.Emit
- Sprites.Array.Fill
- Sprites.Array.FindIndex
- Sprites.Array.Gather
- Sprites.Array.IndexOf
- Sprites.Array.IsEmpty
- Sprites.Array.Length
- Sprites.Array.Map
- Sprites.Array.Resize
- Sprites.Array.SizeBinding
- Sprites.Array.Slice
- Sprites.Array.Some
- Sprites.Array.Choose
- Sprites.Array.Lookup
Sprites.Grid
Cells packed in a flat list: Two for a 2D grid and Three for a 3D volume, reading a side or a cell, resizing, and binding the sides.
- Sprites.Grid.Two.At
- Sprites.Grid.Two.Blank
- Sprites.Grid.Two.FillRect
- Sprites.Grid.Two.Flatten
- Sprites.Grid.Two.Height
- Sprites.Grid.Two.HeightBinding
- Sprites.Grid.Two.Map
- Sprites.Grid.Two.Resize
- Sprites.Grid.Two.Set
- Sprites.Grid.Two.Width
- Sprites.Grid.Two.WidthBinding
- Sprites.Grid.Two.Default
- Sprites.Grid.Two.FillAcross
- Sprites.Grid.Two.Tile
- Sprites.Grid.Two.Choose
- Sprites.Grid.Three.At
- Sprites.Grid.Three.Depth
- Sprites.Grid.Three.DepthBinding
- Sprites.Grid.Three.Height
- Sprites.Grid.Three.HeightBinding
- Sprites.Grid.Three.Resize
- Sprites.Grid.Three.Width
- Sprites.Grid.Three.WidthBinding
- Sprites.Grid.Tiled.Width
- Sprites.Grid.Tiled.Height
- Sprites.Grid.Tiled.Tile
- Sprites.Grid.Tiled.Blank
- Sprites.Grid.Tiled.At
- Sprites.Grid.Tiled.FillRect
- Sprites.Grid.Tiled.Stamp
- Sprites.Grid.Tiled.Resize
- Sprites.Grid.Tiled.Flatten
- Sprites.Grid.Tiled.ToTwo
- Sprites.Grid.Tiled.FromTwo
Sprites.Optional
A default for a value that may be missing, and content shown while it is present or absent.
Sprites.Maths
Arithmetic and comparison over reactive values, so a derived number follows its inputs.
Sprites.Browser
The browser viewport as reactive values: keep width and height following the window as it resizes, through a shared driver.
Sprites.Keyboard
The keyboard as reactive values: keep a value following a key, true while it is down, through a shared driver. The companion to Sprites.Browser.
Sprites.Animate
Time based drivers: step a value up on an interval, or write a value once after a delay, each a shared driver that starts on request and clears when it goes.