File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 5454 import api from " ../../api" ;
5555 import type { Round } from " ../../api/resourceObjects" ;
5656 import MapWrapper from " ./MapWrapper.svelte" ;
57+ import subscribeIfNotDeepEqual from " ../utilities/subscribeIfNotDeepEqual" ;
5758
5859 export let unhandledError: Error | null = null ;
5960
190191
191192 // To be safe, complete the round when the final question is complete
192193 unsubscribers .push (
193- currentQuestion . subscribe ( (value ) => {
194+ subscribeIfNotDeepEqual ( currentQuestion , (value ) => {
194195 console .debug (" currentQuestion subscribe" , value );
195196 if (
196197 value &&
214215 );
215216
216217 unsubscribers .push (
217- gameRound . subscribe ( (value ) => {
218+ subscribeIfNotDeepEqual ( gameRound , (value ) => {
218219 console .debug (" gameRound subscribe" , value );
219220 if (! value ) {
220221 return ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export default function subscribeIfNotDeepEqual<T>(
1717) {
1818 let oldValue : T ;
1919
20- store . subscribe ( ( newValue ) => {
20+ return store . subscribe ( ( newValue ) => {
2121 if ( ! isEqual ( oldValue , newValue ) ) {
2222 if ( debugName ) {
2323 console . debug ( `[${ debugName } ] changed` , oldValue , newValue ) ;
You can’t perform that action at this time.
0 commit comments