Packages

React inside Phoenix LiveView — async code splitting, client-side props diffing, and zero-config component discovery.

Retired package: Release invalid - Not production-ready, LiveView 1.0.x compatibility issue

Current section

Files

Jump to
react_phx assets dist jsonPatch.d.ts
Raw

assets/dist/jsonPatch.d.ts

import type { PatchOp } from "./types";
/**
* Mutates `obj` in place by applying an array of patch operations.
*
* Supports standard RFC 6902 ops: add, remove, replace, test.
* Supports custom Phoenix Stream ops: upsert, delete_by_id, limit.
*/
export declare function applyPatch(obj: Record<string, unknown>, patches: PatchOp[]): void;
/**
* Returns an array of PatchOp describing changes from `prev` to `next`.
*
* - Added keys → `add` op
* - Changed vals → `replace` op (recurses into nested objects)
* - Removed keys → `remove` op
* - Arrays → compared with deepEqual, replaced wholesale if different
*/
export declare function computeDiff(prev: Record<string, unknown>, next: Record<string, unknown>, basePath?: string): PatchOp[];