Skip to content

Commit ec4cee2

Browse files
committed
resources
1 parent 70803ae commit ec4cee2

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ version = "0.2.1"
77
Signals = "6303bc30-01ab-52eb-8b10-60e47555a8d1"
88

99
[compat]
10-
Signals = "1.2.0"
10+
Signals = "1.3.0"
1111
julia = "1.10"

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,17 @@ effect(() -> println("Sum changed to: ", z()))
2020

2121
x(5) # Prints "Sum changed to: 7"
2222
```
23+
24+
Using resources for long computations:
25+
26+
```julia
27+
using StateSignals
28+
29+
s = Signal(0)
30+
r = Resource([s]) do
31+
sleep(3)
32+
println("Resource acquired")
33+
s()*3
34+
end
35+
s(3)
36+
```

0 commit comments

Comments
 (0)