Skip to content

EditorShared beta ​

Interface of @v12-engine/editor

ts
export interface EditorShared<T>

A value the panels share (editor.shared): value() or value.get() reads it (the first follows in Solid), value.set(next) (or a function of what it was) changes it, and subscribe(listener) is told of each change, with the value, giving back what stops it

Members ​

(call) ​

ts
(): T;

Reads the value, like get(); in Solid it follows the value

get ​

ts
get(): T;

Reads the value

key ​

ts
readonly key: string;

Its key

set ​

ts
set(value: T | ((was: T) => T)): void;

Changes the value to value, or to what a function of the value it was gives; the subscribers are told

subscribe ​

ts
subscribe(listener: (value: T) => void): () => void;

Calls listener with the new value on each change; gives back what stops it