File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @effect-rx/rx " : patch
3+ ---
4+
5+ fix Rx.kvs
Original file line number Diff line number Diff line change @@ -1305,19 +1305,16 @@ export const kvs = <A>(options: {
13051305 } )
13061306 )
13071307 const resultRx = options . runtime . rx (
1308- Effect . fnUntraced ( function * ( get : Context ) {
1309- const store = ( yield * KeyValueStore . KeyValueStore ) . forSchema (
1310- options . schema
1311- )
1312- get . mount ( setRx )
1313- return Option . getOrElse (
1314- yield * store . get ( options . key ) ,
1315- options . defaultValue
1316- )
1317- } )
1308+ Effect . flatMap (
1309+ KeyValueStore . KeyValueStore ,
1310+ ( store ) => Effect . flatten ( store . forSchema ( options . schema ) . get ( options . key ) )
1311+ )
13181312 )
13191313 return writable (
1320- ( get ) => Result . getOrElse ( resultRx . read ( get ) , options . defaultValue ) ,
1314+ ( get ) => {
1315+ get . mount ( setRx )
1316+ return Result . getOrElse ( get ( resultRx ) , options . defaultValue )
1317+ } ,
13211318 ( ctx , value : A ) => {
13221319 ctx . set ( setRx , value as any )
13231320 ctx . setSelf ( value )
You can’t perform that action at this time.
0 commit comments