File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ const reactEnhancer = <T>(
1111 delayTime : number ,
1212) : BehaviorObservable < T > => {
1313 let finalizeLastUnsubscription = noop
14- let latestValue = EMPTY_VALUE
1514 const result = new Observable < T > ( subscriber => {
1615 let isActive = true
16+ let latestValue = EMPTY_VALUE
1717 const subscription = source$ . subscribe ( {
1818 next ( value ) {
1919 if (
@@ -97,7 +97,6 @@ const reactEnhancer = <T>(
9797 }
9898
9999 if ( value !== EMPTY_VALUE ) {
100- latestValue = value
101100 return ( valueResult = { type : "v" , payload : value } )
102101 }
103102
Original file line number Diff line number Diff line change @@ -8,13 +8,16 @@ const SUSP: "s" = "s"
88type Action = "e" | "v" | "s"
99
1010const reducer = (
11- _ : { type : Action ; payload : any } ,
11+ current : { type : Action ; payload : any } ,
1212 action : { type : Action ; payload : any } ,
1313) => {
1414 if ( action . type === ERROR ) {
1515 throw action . payload
1616 }
17- return action
17+ return Object . is ( current . payload , action . payload ) &&
18+ current . type === action . type
19+ ? current
20+ : action
1821}
1922
2023const init = ( source$ : BehaviorObservable < any > ) => source$ . getValue ( )
You can’t perform that action at this time.
0 commit comments