Skip to content

Handling computed values in listeners #265

Answered by ai
gismya asked this question in Q&A
Jan 23, 2024 · 1 comments · 9 replies
Discussion options

You must be logged in to vote

Got it. The problem is that currentPlaylistItem.listen(loadPlayer) is running before the currentFPS update (since computed() use the same currentPlaylistItem.listen and listeners are executed by the order)?

The simplest solution without overcomplicating is to create getFPS(playlistItem)and use it in listener.

More complex solution is to create store playerOptions computed from currentPlaylistItem and currentFPS and init player on playerOptions changes.

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@ai
Comment options

@gismya
Comment options

@gismya
Comment options

@ai
Comment options

Answer selected by gismya
@gismya
Comment options

@ai
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants