Skip to content

Commit

Permalink
fix excess fetch on start
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-donarise committed Jul 29, 2024
1 parent 52c0568 commit a28a7df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 0 additions & 2 deletions app/app.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ $optimade_tmdne_app $mol_view
number? 1
plugins /
<= Theme $mol_theme_auto
auto /
<= update null
rotating? false
number_swiped? 0
number_prefetch? 0
Expand Down
14 changes: 12 additions & 2 deletions app/app.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,26 @@ namespace $.$$ {
]
}

@ $mol_action
random_number() {
return random_int( 1, 384937 )
}

@ $mol_mem
number( next?: number ): number {
return next ?? this.random_number()
}

@ $mol_mem
number_prefetch( next?: number ): number {
return next ?? random_int( 1, 384937 )
return next ?? this.random_number()
}

@ $mol_action
update() {
this.number_swiped( this.number() )
this.number( this.number_prefetch() )
const prefetch = random_int( 1, 384937 )
const prefetch = this.random_number()
this.number_prefetch( prefetch )
$mol_wire_async( this ).predict_by_number( prefetch )
}
Expand Down

0 comments on commit a28a7df

Please sign in to comment.