theatre/packages/dataverse/api/classes/PointerProxy.md
2023-08-10 13:31:54 +02:00

2.9 KiB

@theatre/dataverse / PointerProxy

Class: PointerProxy<O>

Allows creating pointer-prisms where the pointer can be switched out.

Remarks

This allows reacting not just to value changes at a certain pointer, but changes to the proxied pointer too.

Type parameters

Name Type
O extends Object

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new PointerProxy<O>(currentPointer)

Type parameters

Name Type
O extends Object

Parameters

Name Type
currentPointer Pointer<O>

Defined in

PointerProxy.ts:34

Properties

_currentPointerBox

Private Readonly _currentPointerBox: Atom<Pointer<O>>

Defined in

PointerProxy.ts:25


pointer

Readonly pointer: Pointer<O>

Convenience pointer pointing to the root of this PointerProxy.

Remarks

Allows convenient use of pointerToPrism and val.

Defined in

PointerProxy.ts:32

Methods

pointerToPrism

pointerToPrism<P>(pointer): Prism<P>

Returns a prism of the value at the provided sub-path of the proxied pointer.

Type parameters

Name
P

Parameters

Name Type
pointer Pointer<P>

Returns

Prism<P>

Implementation of

PointerToPrismProvider.pointerToPrism

Defined in

PointerProxy.ts:52


setPointer

setPointer(p): void

Sets the underlying pointer.

Parameters

Name Type Description
p Pointer<O> The pointer to be proxied.

Returns

void

Defined in

PointerProxy.ts:43