-
Notifications
You must be signed in to change notification settings - Fork 171
Open
Labels
code healthProactive technical investment via refactorings, removals, etc.Proactive technical investment via refactorings, removals, etc.help wantedReady to be picked up by anyone in the communityReady to be picked up by anyone in the community
Description
The editors use Redux to store their state, and it can be hard to reason about.
Expanding on previous work, state that's used by all the editors (i.e. the app state) should be moved into EditorContext.
Example:
🛑 Old:
const learningContextId = useSelector(selectors.app.learningContextId);🛑 Very old!
mapStateToProps = (state) => ({
learningContextId: selectors.app.learningContextId(state), ...
🛑 Very old! (no need to pass these as props ("prop drilling"); just get them from context wherever you need them)
VideoSelector.propTypes = {
learningContextId: PropTypes.string.isRequired, ...
✅ New:
const { learningContextid } = useEditorContext();Note: I'm not sure if everything in the app state is used by more than one editor. So check as you go.
PRs:
Metadata
Metadata
Assignees
Labels
code healthProactive technical investment via refactorings, removals, etc.Proactive technical investment via refactorings, removals, etc.help wantedReady to be picked up by anyone in the communityReady to be picked up by anyone in the community