Skip to content

Home > @unseenco/backstage-core > val

val() function

Takes a Pointer and returns the value it points to.

Signature:

typescript
export declare function val<T>(pointer: PointerType<T>): T;

Parameters

ParameterTypeDescription
pointerPointerType<T>A pointer (like object.props.x)

Returns:

T

The value the pointer points to

Example

Usage

ts
import {val, getProject} from '@unseenco/backstage'

const obj = getProject("A project").sheet("Scene").object("Box", {position: {x: 0}})

console.log(val(obj.props.position.x)) // logs the value of obj.props.x