@adamldoyle/react-aws-auth-redux-slice
v2.0.0
Published
Extension of [@adamldoyle/react-aws-auth-context-core](https://github.com/adamldoyle/react-aws-auth-context-core) that listens to Auth context changes and adds the session and profile to an authentication Redux slice.
Downloads
4
Readme
react-aws-auth-redux-slice
Extension of @adamldoyle/react-aws-auth-context-core that listens to Auth context changes and adds the session and profile to an authentication Redux slice.
Features
- Automatically detects profile/session changes and keeps them up-to-date in Redux
- Provides several selectors to extract information
Installation
yarn add @adamldoyle/react-aws-auth-redux-slice
- Build auth slice using
buildAuthSlice
which returnsauthSlice
,authSelectors
,AuthInjector
- Nest
AuthInjector
withinAuthContextProvider
(from @adamldoyle/react-aws-auth-context-core or a related component library) and containing the rest of your application component heirarchy - Use selectors provided by
authSelectors
to select session/profile information as necessary
Examples
- https://adamldoyle-react-aws-auth-redux-slice-storybook.netlify.app/
OR
- Create
.env
file in root based on.env.sample
yarn storybook
Development
yarn install
yarn build
Contributors
License
MIT