{
  "version": 3,
  "sources": ["../../../src/synchronization/use-bi-dir-binding-sync.ts"],
  "sourcesContent": ["import type { Binding } from '../binding/types/binding';\nimport { useBindingEffect } from '../use-binding-effect/use-binding-effect.mjs';\nimport type { UseBindingSyncOptions } from './types/options';\n\n/**\n * Synchronizes two bindings bidirectionally so that any change in one will also affect the other.\n *\n * It's the responsibility of the bindings themselves to make sure this doesn't result in an infinite update.  For example, the bindings\n * could be configured to use `detectChanges: true`, so that trivial changes doesn't result in triggers.\n */\nexport const useBiDirBindingSync = <T>(a: Binding<T>, b: Binding<T>, options?: UseBindingSyncOptions) => {\n  useBindingEffect(a, (a) => b.set(a), { ...options, triggerOnMount: true });\n  useBindingEffect(b, (b) => a.set(b), { ...options, triggerOnMount: true });\n};\n"],
  "mappings": "AACA,SAAS,wBAAwB;AAS1B,MAAM,sBAAsB,CAAI,GAAe,GAAe,YAAoC;AACvG,mBAAiB,GAAG,CAACA,OAAM,EAAE,IAAIA,EAAC,GAAG,EAAE,GAAG,SAAS,gBAAgB,KAAK,CAAC;AACzE,mBAAiB,GAAG,CAACC,OAAM,EAAE,IAAIA,EAAC,GAAG,EAAE,GAAG,SAAS,gBAAgB,KAAK,CAAC;AAC3E;",
  "names": ["a", "b"]
}
