Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Jan 23, 2024
1 parent 8001383 commit 0bf054e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/alpinejs/src/entangle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ export function entangle({ get: outerGet, set: outerSet }, { get: innerGet, set:
let innerHash

let reference = effect(() => {
const outer = outerGet()
const inner = innerGet()
let outer = outerGet()
let inner = innerGet()

if (firstRun) {
innerSet(cloneIfObject(outer))
firstRun = false
} else {
const outerHashLatest = JSON.stringify(outer)
const innerHashLatest = JSON.stringify(inner)
let outerHashLatest = JSON.stringify(outer)
let innerHashLatest = JSON.stringify(inner)

if (outerHashLatest !== outerHash) { // If outer changed...
innerSet(cloneIfObject(outer))
Expand Down

0 comments on commit 0bf054e

Please sign in to comment.