INNER CODE UNIT · TypeScript
areRelatedPathKeys
margelo/react-native-runtimes · packages/state/src/index.ts:293
function areRelatedPathKeys(left: string, right: string): boolean {
if (
left === right ||
left === ROOT_SUBTREE_KEY ||
right === ROOT_SUBTREE_KEY
) {
return true;
}
return left.startsWith(`${right}.`) || right.startsWith(`${left}.`);
}
function shouldNotifyPath(
subscribedKeys: ReadonlySet<string> | undefined,
changedKey: string,
): boolean {
if (!subscribedKeys) {
return true;