Skip to content

Commit c3fc3a9

Browse files
committed
format code
1 parent 9bd85af commit c3fc3a9

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/Signals.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ function (s::Signal)()
4141
end
4242

4343
function pull!(s::Signal)
44-
if !s.valid
45-
s.value = s.action()
46-
s.valid = true
47-
end
44+
if !s.valid
45+
s.value = s.action()
46+
s.valid = true
47+
end
4848
s.value
4949
end
5050

5151
function (s::Signal)(value)
52-
s.action != nothing && error("Can't modify state of computed signal.");
52+
s.action != nothing && error("Can't modify state of computed signal.")
5353
invalidate(s)
5454
s.value = value
5555
s.valid = true

test/test-signals.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ end
7474

7575
@testset "Circular dependencies" begin
7676
a = Signal(1)
77-
b = computed(() -> a()+1)
78-
c = computed(() -> begin a(2);println(a()); a() + b(); end)
77+
b = computed(() -> a() + 1)
78+
c = computed(() -> begin
79+
a(2)
80+
println(a())
81+
a() + b()
82+
end)
7983
end
8084

8185
# @testset "Slow state update" begin

0 commit comments

Comments
 (0)