Pushing for help with Redux selectors #880
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#880
Loading…
Reference in a new issue
No description provided.
Delete branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I watched a Redux video and read some of the docs. I've created my action (please ignore the do and confirm actions, I will delete those, sorry) and reducer and they seem to be working but my selector is not. I could use help on this. I think once I manage to get the videoPause value from the store into the VideoPlayer component I will be able to wrap this up.
I'm looking into this
what if you change this to
componentWillReceiveProps
instead ofpauseVideo
?then of course you would need to filter out the prop changes that don't lead to a pause, but does that make sense?
I tried that and the method(?) was never called.
I think the issue is that the selector isn't working, or that the reducer isn't actually changing the state. My focus is on line 63 of components/video.view.jsx where it console logs the value of videoPause. It's always false, even after I've clicked open, which should update valuePause to true through the reducer.
@daovist try using the console to help debug what unexpected behavior is happening here. The console will show all action dispatches as well as all state changes (expand the console messages that are printed on action dispatches). This should tell you whether it's an issue with actions or the reducer. If both the action is fired and the Redux state looks correct, you can add a console statement to see if the selector is firing when you think it ought to.
this should go in videos/index.js
@ -56,6 +56,8 @@ class Video extends React.PureComponent {
changeVolume,
you want this in here, and then you want to pass it into VideoPlayer
this should be
const _selectState = state => state.video || {};
Looks great! just this one question/change
@ -23,0 +23,4 @@
componentWillReceiveProps(nextProps) {
if (nextProps.videoPause) {
this.refs.media.children[0].pause();
this.props.setVideoPause(false);
is this (
this.props.setVideoPause(false);
) necessary? can we trigger this, instead, when they push "play" in app?Making a follow up issue to this since this is work.