@@ -23,6 +23,7 @@ Added in v1.0.0
2323 - [ update] ( #update )
2424- [ Focus] ( #focus )
2525 - [ makeRefreshOnSignal] ( #makerefreshonsignal )
26+ - [ refreshOnWindowFocus] ( #refreshonwindowfocus )
2627 - [ windowFocusSignal] ( #windowfocussignal )
2728- [ KeyValueStore] ( #keyvaluestore )
2829 - [ kvs] ( #kvs )
@@ -41,13 +42,13 @@ Added in v1.0.0
4142 - [ keepAlive] ( #keepalive )
4243 - [ map] ( #map )
4344 - [ mapResult] ( #mapresult )
44- - [ refreshOnWindowFocus] ( #refreshonwindowfocus )
4545 - [ serializable] ( #serializable-1 )
4646 - [ setIdleTTL] ( #setidlettl )
4747 - [ setLazy] ( #setlazy )
4848 - [ transform] ( #transform )
4949 - [ withFallback] ( #withfallback )
5050 - [ withLabel] ( #withlabel )
51+ - [ withOptimisticSet] ( #withoptimisticset )
5152- [ constructors] ( #constructors )
5253 - [ context] ( #context )
5354 - [ family] ( #family )
@@ -88,9 +89,6 @@ Added in v1.0.0
8889 - [ TypeId (type alias)] ( #typeid-type-alias )
8990 - [ WritableTypeId] ( #writabletypeid )
9091 - [ WritableTypeId (type alias)] ( #writabletypeid-type-alias )
91- - [ utils] ( #utils )
92- - [ RxResultFn (namespace)] ( #rxresultfn-namespace )
93- - [ ArgToVoid (type alias)] ( #argtovoid-type-alias )
9492
9593---
9694
@@ -199,6 +197,16 @@ export declare const makeRefreshOnSignal: <_>(
199197
200198Added in v1.0.0
201199
200+ ## refreshOnWindowFocus
201+
202+ **Signature**
203+
204+ ` ` ` ts
205+ export declare const refreshOnWindowFocus: <A extends Rx <any >>(self : A ) => Rx .WithoutSerializable <A >
206+ ` ` `
207+
208+ Added in v1.0.0
209+
202210## windowFocusSignal
203211
204212**Signature**
@@ -385,16 +393,6 @@ export declare const mapResult: {
385393
386394Added in v1.0.0
387395
388- ## refreshOnWindowFocus
389-
390- **Signature**
391-
392- ` ` ` ts
393- export declare const refreshOnWindowFocus: <A extends Rx <any >>(self : A ) => Rx .WithoutSerializable <A >
394- ` ` `
395-
396- Added in v1.0.0
397-
398396## serializable
399397
400398**Signature**
@@ -495,6 +493,33 @@ export declare const withLabel: {
495493
496494Added in v1.0.0
497495
496+ ## withOptimisticSet
497+
498+ **Signature**
499+
500+ ` ` ` ts
501+ export declare const withOptimisticSet: {
502+ <A , XA , XE , W = A extends Result .Result <infer _A , infer _E > ? _A : A >(options : {
503+ readonly updateToValue: (
504+ value : W ,
505+ current : NoInfer <A >
506+ ) => A extends Result .Result <infer _A , infer _E > ? _A : NoInfer <A >
507+ readonly fn: RxResultFn <NoInfer <W >, XA , XE >
508+ readonly disableRefresh? : boolean | undefined
509+ }): (self : Rx <A >) => Writable <A , W >
510+ <A , XA , XE , W = A extends Result .Result <infer _A , infer _E > ? _A : A >(
511+ self : Rx <A >,
512+ options : {
513+ readonly updateToValue: (value : W , current : NoInfer <A >) => A extends Result .Result <infer _A , infer _E > ? _A : A
514+ readonly fn: RxResultFn <NoInfer <W >, XA , XE >
515+ readonly disableRefresh? : boolean | undefined
516+ }
517+ ): Writable <A , W >
518+ }
519+ ` ` `
520+
521+ Added in v1.0.0
522+
498523# constructors
499524
500525## context
@@ -526,19 +551,19 @@ export declare const fn: {
526551 <Arg >(): <E , A >(
527552 fn : (arg : Arg , get : FnContext ) => Effect .Effect <A , E , Scope .Scope | RxRegistry >,
528553 options ? : { readonly initialValue? : A }
529- ) => RxResultFn <RxResultFn . ArgToVoid < Arg > , A , E >
530- <Arg , E , A >(
554+ ) => RxResultFn <Arg , A , E >
555+ <E , A , Arg = void >(
531556 fn : (arg : Arg , get : FnContext ) => Effect .Effect <A , E , Scope .Scope | RxRegistry >,
532557 options ? : { readonly initialValue? : A }
533- ): RxResultFn <RxResultFn . ArgToVoid < Arg > , A , E >
558+ ): RxResultFn <Arg , A , E >
534559 <Arg >(): <E , A >(
535560 fn : (arg : Arg , get : FnContext ) => Stream .Stream <A , E , RxRegistry >,
536561 options ? : { readonly initialValue? : A }
537- ) => RxResultFn <RxResultFn . ArgToVoid < Arg > , A , E | NoSuchElementException >
538- <Arg , E , A >(
562+ ) => RxResultFn <Arg , A , E | NoSuchElementException >
563+ <E , A , Arg = void >(
539564 fn : (arg : Arg , get : FnContext ) => Stream .Stream <A , E , RxRegistry >,
540565 options ? : { readonly initialValue? : A }
541- ): RxResultFn <RxResultFn . ArgToVoid < Arg > , A , E | NoSuchElementException >
566+ ): RxResultFn <Arg , A , E | NoSuchElementException >
542567}
543568` ` `
544569
@@ -551,17 +576,11 @@ Added in v1.0.0
551576` ` ` ts
552577export declare const fnSync: {
553578 <Arg >(): {
554- <A >(f : (arg : Arg , get : FnContext ) => A ): Writable <Option .Option <A >, RxResultFn .ArgToVoid <Arg >>
555- <A >(
556- f : (arg : Arg , get : FnContext ) => A ,
557- options : { readonly initialValue: A }
558- ): Writable <A , RxResultFn .ArgToVoid <Arg >>
579+ <A >(f : (arg : Arg , get : FnContext ) => A ): Writable <Option .Option <A >, Arg >
580+ <A >(f : (arg : Arg , get : FnContext ) => A , options : { readonly initialValue: A }): Writable <A , Arg >
559581 }
560- <Arg , A >(f : (arg : Arg , get : FnContext ) => A ): Writable <Option .Option <A >, RxResultFn .ArgToVoid <Arg >>
561- <Arg , A >(
562- f : (arg : Arg , get : FnContext ) => A ,
563- options : { readonly initialValue: A }
564- ): Writable <A , RxResultFn .ArgToVoid <Arg >>
582+ <A , Arg = void >(f : (arg : Arg , get : FnContext ) => A ): Writable <Option .Option <A >, Arg >
583+ <A , Arg = void >(f : (arg : Arg , get : FnContext ) => A , options : { readonly initialValue: A }): Writable <A , Arg >
565584}
566585` ` `
567586
@@ -927,26 +946,26 @@ export interface RxRuntime<R, ER> extends Rx<Result.Result<Runtime.Runtime<R>, E
927946 options ? : {
928947 readonly initialValue? : A
929948 }
930- ): RxResultFn <RxResultFn . ArgToVoid < Arg > , A , E | ER >
949+ ): RxResultFn <Arg , A , E | ER >
931950 <E , A >(
932951 fn : (arg : Arg , get : FnContext ) => Stream .Stream <A , E , RxRegistry | R >,
933952 options ? : {
934953 readonly initialValue? : A
935954 }
936- ): RxResultFn <RxResultFn . ArgToVoid < Arg > , A , E | ER | NoSuchElementException >
955+ ): RxResultFn <Arg , A , E | ER | NoSuchElementException >
937956 }
938- <Arg , E , A >(
957+ <E , A , Arg = void >(
939958 fn : (arg : Arg , get : FnContext ) => Effect .Effect <A , E , Scope .Scope | RxRegistry | R >,
940959 options ? : {
941960 readonly initialValue? : A
942961 }
943- ): RxResultFn <RxResultFn . ArgToVoid < Arg > , A , E | ER >
944- <Arg , E , A >(
962+ ): RxResultFn <Arg , A , E | ER >
963+ <E , A , Arg = void >(
945964 fn : (arg : Arg , get : FnContext ) => Stream .Stream <A , E , RxRegistry | R >,
946965 options ? : {
947966 readonly initialValue? : A
948967 }
949- ): RxResultFn <RxResultFn . ArgToVoid < Arg > , A , E | ER | NoSuchElementException >
968+ ): RxResultFn <Arg , A , E | ER | NoSuchElementException >
950969 }
951970
952971 readonly pull: <A , E >(
@@ -1061,19 +1080,3 @@ export type WritableTypeId = typeof WritableTypeId
10611080` ` `
10621081
10631082Added in v1.0.0
1064-
1065- # utils
1066-
1067- ## RxResultFn (namespace)
1068-
1069- Added in v1.0.0
1070-
1071- ### ArgToVoid (type alias)
1072-
1073- **Signature**
1074-
1075- ` ` ` ts
1076- export type ArgToVoid <Arg > = Arg extends infer A ? (unknown extends A ? void : A extends undefined ? void : A ) : never
1077- ` ` `
1078-
1079- Added in v1.0.0
0 commit comments