Skip to content

@arcmantle/chronicle / grouping

grouping

Functions

computeActiveGroupId()

computeActiveGroupId(root, getBatchFrames, nowProvider): string

Defined in: grouping.ts:17

Compute the active group ID for a change.

If inside a batch, uses the current batch frame's ID. Otherwise, if mergeUngrouped is enabled and within the merge window, reuses the last ungrouped ID. Otherwise generates a new group ID.

Parameters

root

object

The root object

getBatchFrames

(root) => object[] | undefined

Function to get batch frames for the root

nowProvider

() => number

Function to get current timestamp (defaults to Date.now)

Returns

string

The group ID to use for the current change

Released under the Apache-2.0 License.