Skip to content

Profectus / game/boards/board / setupUniqueIds

Function: setupUniqueIds() ​

setupUniqueIds(nodes): ComputedRef<number>

Create a computed ref that can assist in assigning new nodes an ID unique from all current nodes.

Parameters ​

nodes ​

MaybeRefOrGetter<object[]>

The list of current nodes with IDs as properties

Returns ​

ComputedRef<number>

A computed ref that will give the value of the next unique ID

Defined in ​

profectus/src/game/boards/board.tsx:47