File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 106
106
107
107
Behaves like a normal atom for the value at the specified path."
108
108
[a path]
109
- (cursor path ))
109
+ (cursor path a ))
Original file line number Diff line number Diff line change 12
12
test-cursor (c/cur test-atom [:a :b :c :d ])
13
13
test-cursor2 (c/cur test-atom [])] ; ; nasty edge case
14
14
15
+ (is (= cljs.core/Atom (type test-cursor2)))
16
+
15
17
; ; get the initial values
16
18
(is (= (get-in @test-atom [:a :b :c :d ])
17
19
@test-cursor))
18
20
19
- (is (= get-in @test-atom []
21
+ (is (= ( get-in @test-atom [])
20
22
@test-cursor2))
21
23
22
24
; ; now we update the cursor with a reset
23
25
(reset! test-cursor 2 )
24
26
(is (= @test-cursor 2 ))
25
- (is (= (get-in @test-atom [:a :b :c :d ]) 2 ))
26
-
27
- (reset! test-cursor2 2 )
28
- (is (= @test-cursor2 2 ))
29
- (is (= (get-in @test-atom []) 2 ))
27
+ (is (= (get-in @test-atom [:a :b :c :d ]) 2 ))
28
+
29
+ (reset! test-cursor2 3 )
30
+ (is (= @test-cursor2 3 ))
31
+ (is (= @test-atom 3 ))
32
+ (reset! test-atom {:a {:b {:c {:d 1 }}}}) ; ; restore test-atom
30
33
31
34
; ; swap
32
35
(reset! test-cursor {}) ; ; empty map
You can’t perform that action at this time.
0 commit comments