Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPLAT-11863 Add Redux Hooks #674

Merged
merged 4 commits into from
Jan 29, 2021
Merged

CPLAT-11863 Add Redux Hooks #674

merged 4 commits into from
Jan 29, 2021

Conversation

aaronlademann-wf
Copy link
Contributor

@aaronlademann-wf aaronlademann-wf commented Jan 20, 2021

Motivation

The react-redux JS package that we wrap / expose from our over_react_redux.dart library offers function component hook APIs that we don't have wrapped for our consumers.

Core Changes

  1. Add useSelector, createSelectorHook, useDispatch, createDispatchHook, useStore and createStoreHook top level functions, along with the necessary JS interop pieces to call into the analogous JS hooks.
  2. Add examples, tests and documentation.

Misc Changes

  1. Move over_react_redux test utils into a directory within src/ so we can reuse some of it in our example/s

Release Notes

Add React Redux hooks for function components

@aviary3-wk
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some comments, but this looks awesome!! I'm so excited for these hooks to be available!

lib/src/over_react_redux/hooks/use_selector.dart Outdated Show resolved Hide resolved
lib/src/over_react_redux/hooks/use_store.dart Outdated Show resolved Hide resolved
lib/src/over_react_redux/over_react_redux.dart Outdated Show resolved Hide resolved
lib/src/over_react_redux/test_fixtures/store.dart Outdated Show resolved Hide resolved
test/over_react_redux/connect_flux_integration_test.dart Outdated Show resolved Hide resolved
doc/over_react_redux_documentation.md Outdated Show resolved Hide resolved
lib/src/over_react_redux/hooks/use_selector.dart Outdated Show resolved Hide resolved
lib/src/over_react_redux/hooks/use_selector.dart Outdated Show resolved Hide resolved
lib/src/over_react_redux/hooks/use_selector.dart Outdated Show resolved Hide resolved
lib/src/over_react_redux/hooks/use_selector.dart Outdated Show resolved Hide resolved
@aaronlademann-wf
Copy link
Contributor Author

@greglittlefield-wf all feedback has been addressed.

Copy link
Contributor

@joebingham-wk joebingham-wk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks really good to me - the nesting on those hooks does not look fun haha. I only found nits!

doc/over_react_redux_documentation.md Outdated Show resolved Hide resolved
doc/over_react_redux_documentation.md Outdated Show resolved Hide resolved
example/hooks/over_react_redux/counter.dart Outdated Show resolved Hide resolved
example/hooks/over_react_redux/counter.dart Outdated Show resolved Hide resolved
example/hooks/over_react_redux/redux_actions.dart Outdated Show resolved Hide resolved
example/hooks/over_react_redux/redux_actions.dart Outdated Show resolved Hide resolved
example/hooks/over_react_redux/store.dart Outdated Show resolved Hide resolved
example/hooks/use_selector_example.dart Show resolved Hide resolved
test/over_react_redux/hooks/use_selector_test.dart Outdated Show resolved Hide resolved
@aaronlademann-wf
Copy link
Contributor Author

All feedback addressed @joebingham-wk!

joebingham-wk
joebingham-wk previously approved these changes Jan 27, 2021
Copy link
Contributor

@joebingham-wk joebingham-wk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple more small things

lib/src/over_react_redux/hooks/use_selector.dart Outdated Show resolved Hide resolved
doc/over_react_redux_documentation.md Outdated Show resolved Hide resolved
doc/over_react_redux_documentation.md Outdated Show resolved Hide resolved
doc/over_react_redux_documentation.md Show resolved Hide resolved
@aaronlademann-wf
Copy link
Contributor Author

@greglittlefield-wf all feedback addressed.

@greglittlefield-wf
Copy link
Contributor

QA +1

@Workiva/release-management-p

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 from RM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants