useMarkput
Call Signature
Section titled “Call Signature”function useMarkput<T>(selector): T;Defined in: react/markput/src/lib/hooks/useMarkput.ts:12
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
selector |
(store) => Selectable<T> |
Returns
Section titled “Returns”T
Call Signature
Section titled “Call Signature”function useMarkput<R>(selector): SignalValues<R>;Defined in: react/markput/src/lib/hooks/useMarkput.ts:13
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
R extends ObjectSelector |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
selector |
(store) => R |
Returns
Section titled “Returns”SignalValues<R>
Call Signature
Section titled “Call Signature”function useMarkput<T>(selector): T;Defined in: react/markput/src/lib/hooks/useMarkput.ts:28
A member of the store with nothing reactive about it — s.rows, s.edit, s.tokens. It is
handed back AS IT IS, identity and all, because a controller outlives every render of the
editor and there is nothing here for a snapshot to differ on. Ordered last, so an object
literal of signals still takes the unwrapping overload above it.
THE CONSTRAINT NAMES THE THREE RATHER THAN SAYING object, because object is satisfied by
every non-primitive and would turn two compile errors into silent wrong answers: a CALLED signal
(s.rows.selected()) is an array, which readSelected hands straight back — the snapshot then
reads nothing reactive and is frozen at mount forever — and an INTERFACE-typed return gets no
implicit index signature, so it keeps its wrapped type while the runtime unwraps it key by key.
Store[keyof Store] does not work either: KeyboardController is structurally empty, so the
union swallows anything. The list grows when a fourth member needs selecting.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends TokenModel | EditController | RowController |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
selector |
(store) => T |
Returns
Section titled “Returns”T