atom.io 0.15.5 → 0.15.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,8 @@
1
+ import { setState } from "atom.io"
1
2
  import type { Atom } from "../atom"
2
3
  import { isAtomDefault, markAtomAsNotDefault } from "../atom"
3
4
  import { cacheValue } from "../caching"
5
+ import type { Transceiver } from "../mutable"
4
6
  import { markDone } from "../operation"
5
7
  import { readOrComputeValue } from "../read-or-compute-value"
6
8
  import type { Store } from "../store"
@@ -28,9 +30,12 @@ export const setAtom = <T>(
28
30
  const update = { oldValue, newValue }
29
31
  if (target.transactionMeta === null) {
30
32
  emitUpdate(atom, update, target)
31
- } else if (target.transactionMeta.phase === `applying` && target.parent) {
32
- emitUpdate(atom, update, target.parent)
33
- } else {
33
+ } else if (target.on.transactionApplying && target.parent) {
34
34
  stowUpdate(atom, update, target)
35
+ if (atom.key.startsWith(`*`)) {
36
+ const mutableKey = atom.key.slice(1)
37
+ const mutable: Transceiver<any> = target.valueMap.get(mutableKey)
38
+ mutable.do(update.newValue)
39
+ }
35
40
  }
36
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atom.io",
3
- "version": "0.15.5",
3
+ "version": "0.15.6",
4
4
  "description": "Composable and testable reactive data library.",
5
5
  "homepage": "https://atom.io.fyi",
6
6
  "sideEffects": false,