-
Notifications
You must be signed in to change notification settings - Fork 25
Redux
Richard Davis edited this page Aug 23, 2020
·
2 revisions
Redux is a predictable state container for JavaScript apps. - redux.js.org
These are the core concepts of Redux.
- The
state
of your application is represented as an object within the store. -
state
is read-only. - Changes to the application state are made via "pure" functions (aka - reducers).
Describe your application's state
in the form of arrays and objects.
Pass state
to your UI (e.g. - via Component props
). state
will be managed
by a single application store.
const state = {
messages: [ ... ],
user: { ... },
router: { ... }
}
state
is read-only. Dispatch actions to the store to get the next
application state. Actions can be triggered by Browser Events or Network Requests.
Think of actions as a minimal description of the event that happened in the app,
coupled with the information necessary to build the next state.
const action = {
type: "ADD_MESSAGE",
message: "I'm learning Redux!"
}
Describe state mutations as reducer functions.
const initialState = {
messages: []
}
// Keep this function "pure". Treat inputs as read-only.
const reducer = (state = initialState, action) => {
switch (action.type) {
case "ADD_MESSAGE":
// Don't change `state` directly. Return an updated copy.
return {
...state,
messages: [...state.messages, action.message]
}
case "DELETE_MESSAGE":
return {
...state,
messages: state.messages.filter(m => m.id !== action.messageId)
}
// ...
default:
return state;
}
}
- Team Working Agreement
- Team composition
- Workflows and processes
- Testing and bug filing
- Accessing eAPD
- Active Documentation:
- Sandbox Environment
- Glossary of acronyms
- APDs 101
- Design iterations archive
- MMIS Budget calculations
- HITECH Budget calculations
- Beyond the APD: From Paper to Pixels
- UX principles
- User research process
- Visual styling
- Content guide
- User research findings
- eAPD pilot findings
- User needs
- Developer info
- Development environment
- Coding Standards
- Development deployment
- Infrastructure Architecture
- Code Architecture
- Tech 101
- Authentication
- APD Auto Saving Process
- Resetting an Environment
- Hardware Software List
- Deploying Staging Production Instances Using Scripts
- Terraform 101 for eAPD
- Provisioning Infrastructure with Terraform
- WebSocket basics
- Operations-and-Support-Index
- Single Branch Deployment Strategy
- Ops and Support Overview
- Service Level AOI
- Incident Response Plan
- On-Call Policy
- Infrastructure Contingency Plan
- Updating CloudFront Security Headers
- Requesting and Installing TLS Certificates