Skip to content

Function: mountKey()

API / @xmachines/play-router / index / mountKey

function mountKey(basePath?, basePathParams?): string;

Defined in: packages/play-router/src/provider-lifecycle.ts:154

A key that changes when the MOUNT changes, and never when its identity changes.

The comparison is BY VALUE, because basePathParams is normally an inline object literal: its identity changes on every render while the prefix does not, and a provider that watched the identity would move the mount on each render.

Parameters

ParameterType
basePath?string
basePathParams?Record<string, string | number>

Returns

string

A string to compare, or to give to the dependency list of an effect.