File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 60
60
"dependencies" : {
61
61
"dbl-linked-list-ds" : " ^2.0.0" ,
62
62
"in-node" : " ^1.0.0" ,
63
- "ts-scheduler" : " ^8.0.0"
63
+ "ts-scheduler" : " ^8.0.0" ,
64
+ "utility-types" : " ^3.7.0"
64
65
}
65
66
}
Original file line number Diff line number Diff line change 1
1
/**
2
2
* Created by tushar on 2019-05-25
3
3
*/
4
+ import { DeepReadonly } from 'utility-types'
4
5
import { FIO , Task } from './FIO'
5
6
6
7
export class Ref < A > {
@@ -9,10 +10,10 @@ export class Ref<A> {
9
10
}
10
11
private constructor ( private value : A ) { }
11
12
12
- public read ( ) : Task < A > {
13
- return FIO . try ( ( ) => this . value )
13
+ public read ( ) : Task < DeepReadonly < A > > {
14
+ return FIO . try ( ( ) => this . value as DeepReadonly < A > )
14
15
}
15
- public update ( ab : ( a : A ) => A ) : Task < A > {
16
- return FIO . try ( ( ) => ( this . value = ab ( this . value ) ) )
16
+ public update ( ab : ( a : DeepReadonly < A > ) => A ) : Task < A > {
17
+ return FIO . try ( ( ) => ( this . value = ab ( this . value as DeepReadonly < A > ) ) )
17
18
}
18
19
}
Original file line number Diff line number Diff line change @@ -6281,6 +6281,11 @@ util-extend@^1.0.1:
6281
6281
resolved "https://registry.yarnpkg.com/util-extend/-/util-extend-1.0.3.tgz#a7c216d267545169637b3b6edc6ca9119e2ff93f"
6282
6282
integrity sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=
6283
6283
6284
+ utility-types@^3.7.0 :
6285
+ version "3.7.0"
6286
+ resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.7.0.tgz#51f1c29fa35d4267488345706efcf3f68f2b1933"
6287
+ integrity sha512-mqRJXN7dEArK/NZNJUubjr9kbFFVZcmF/JHDc9jt5O/aYXUVmopHYujDMhLmLil1Bxo2+khe6KAIVvDH9Yc4VA==
6288
+
6284
6289
uuid@^3.3.2 :
6285
6290
version "3.3.2"
6286
6291
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
You can’t perform that action at this time.
0 commit comments