From 462cf4b42d66d2a4b2bc0e9dc5ef612ab5ab6a0a Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Mon, 24 Sep 2018 17:05:17 -0700 Subject: [PATCH] Fix export --- js/actionCreators/index.ts | 3 ++- redux.md | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 redux.md diff --git a/js/actionCreators/index.ts b/js/actionCreators/index.ts index 838fd7bdc1..ba35fce147 100644 --- a/js/actionCreators/index.ts +++ b/js/actionCreators/index.ts @@ -25,7 +25,8 @@ export { windowsHaveBeenCentered, centerWindowsIfNeeded, resetWindowLayout, - browserWindowSizeChanged + browserWindowSizeChanged, + ensureWindowsAreOnScreen } from "./windows"; export { play, diff --git a/redux.md b/redux.md new file mode 100644 index 0000000000..2233953400 --- /dev/null +++ b/redux.md @@ -0,0 +1,19 @@ +# Thoughts on Redux + +## Actions describe a thing that happened + +Actions with names like `"SET_USER_NAME"` are a smell. Instead, prefer names like `"USERNAME_INPUT_CHANGED"`. Your actions should be a log of _facts_ and should not have any opinions about how those facts are interperated. + +## Actions and action creators are a global concern + +Reduces should know about actions, but actions should not know about your reducers. + +## Your state is a cache + +In principle, your state could simply be an array of every action that has been dispatched, and you could derive the current value by running your reducer in your selector. + +### What would this redux look like? How could you optimize it? + +- Often you need to refer to some other portion of your state within your reducer. How would you do this? + +##