PHP 7.4.33
Preview: tracking.ts Size: 1.03 KB
/var/www/sitesecurity.bitkit.dk/httpdocs/node_modules/reselect/src/autotrackMemoize/tracking.ts
import type { Cell } from './autotracking'
import {
  getValue as consumeTag,
  createCell as createStorage,
  setValue
} from './autotracking'

export type Tag = Cell<unknown>

const neverEq = (a: any, b: any): boolean => false

export function createTag(): Tag {
  return createStorage(null, neverEq)
}
export { consumeTag }
export function dirtyTag(tag: Tag, value: any): void {
  setValue(tag, value)
}

export interface Node<
  T extends Array<unknown> | Record<string, unknown> =
    | Array<unknown>
    | Record<string, unknown>
> {
  collectionTag: Tag | null
  tag: Tag | null
  tags: Record<string, Tag>
  children: Record<string, Node>
  proxy: T
  value: T
  id: number
}

export const consumeCollection = (node: Node): void => {
  let tag = node.collectionTag

  if (tag === null) {
    tag = node.collectionTag = createTag()
  }

  consumeTag(tag)
}

export const dirtyCollection = (node: Node): void => {
  const tag = node.collectionTag

  if (tag !== null) {
    dirtyTag(tag, null)
  }
}

Directory Contents

Dirs: 0 × Files: 5
Name Size Perms Modified Actions
4.94 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
3.82 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
5.35 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
1.03 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
176 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).