Ƭ ObserverListProps: object
Defined in react/index.ts:50
Ƭ ObserverProps: object & T extends ReactNode ? { next?: (value: T) => ReactNode; } : { next: (value: T) => ReactNode; }
Defined in preact/Observer.ts:12
Defined in react/Observer.ts:12
Defined in react/index.ts:14
Properties of the <Observer .../>
component
Properties of the <Observer .../>
component
Ƭ ProtectedState: object
Defined in seal.ts:7
Make all Behavior / Subject properties in T asObservable(). The resulting ProtectedState will not allow anyone to call .next() on any Behaviors.
Ƭ SealState: object
Defined in seal.ts:12
Strict State type which enforces that each property is either a void function, or an Observable
- [ propertyOrAction: string]: function | Observable‹any›
Ƭ TLength: number | string
Defined in spring/CSS.ts:3
• INIT_ITEM: unique symbol = Symbol("unallocated")
Defined in BehaviorList.ts:78
• REMOVED_ITEM: unique symbol = Symbol("removed")
Defined in BehaviorList.ts:79
▸ seal<T>(state
: T): ProtectedState‹T›
Defined in seal.ts:24
Protects a State from exposing mutable Behaviors or Subjects, and exposes those as Observables.
Ensure that the users of this State are not able to call .next() on the behaviors passed in. Additionally, types for protectState ensure that the shape of the State follows State best practices.
Type parameters:
▪ T: SealState
Parameters:
Name | Type | Description |
---|---|---|
state |
T | set of Behavior / Observable values and action functions controlling the state |
Returns: ProtectedState‹T›
▸ shouldStopAnimation(value
: number, destination
: number, velocity
: number): boolean
Defined in spring/shouldStopAnimation.ts:1
Parameters:
Name | Type |
---|---|
value |
number |
destination |
number |
velocity |
number |
Returns: boolean
▸ spyOnObservable<T>(obs
: Observable‹T›): SpyOnObservable‹T›
Defined in jest/index.ts:47
Type parameters:
▪ T
Parameters:
Name | Type |
---|---|
obs |
Observable‹T› |
Returns: SpyOnObservable‹T›
▸ spyOnState<T>(state
: T): SpyOnState‹Unwrap‹T››
Defined in jest/index.ts:34
Test State observable values by extending each observable with
.nextValue: Promise<T>
and .latestValue: T
for easier testing with jest
Example:
const todos = spyOnState(createTodosState());
expect(todos.$todoInput.latestValue).toBe("")
// this is a promise, so we must resolve
expect(todos.$todoInput.nextValue).resolve.toBe("new value")
// this will update $todoInput, and the expect will test it
todos.updateInput("new value")
Type parameters:
▪ T
Parameters:
Name | Type |
---|---|
state |
T |
Returns: SpyOnState‹Unwrap‹T››
▸ stepper(secondPerFrame
: number, x
: number, v
: number, destX
: number, k
: number, b
: number, precision
: number): [number, number]
Defined in spring/stepper.ts:6
Parameters:
Name | Type |
---|---|
secondPerFrame |
number |
x |
number |
v |
number |
destX |
number |
k |
number |
b |
number |
precision |
number |
Returns: [number, number]