Created
October 14, 2016 14:22
-
-
Save rchaser53/279cf09a653c8ff781bf0a2f2236db62 to your computer and use it in GitHub Desktop.
redo,undoの対象がstateAなのかstateBなのか判断しなければならない例
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stateA = { | |
idA:{ | |
xx:1 | |
} | |
} | |
const stateB = { | |
idA:{ | |
yy:1 | |
} | |
} | |
combineReducers({ | |
stateA, | |
stateB | |
}); | |
const actionForA = () => {/* 略 */} // stateAを変更する | |
const actionForB = () => {/* 略 */} // stateBを変更する | |
// stateの状態をaction1つ分redo,undoする | |
const redo = () => {/* 略 */} | |
const undo = () => {/* 略 */} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
あっ色々と失敗してしますね。すみません。多めに見てください。
2つあるオブジェクトを1つにしているだけなので
正規化という表現は適切ではない気がさっきからしてきています(;´・ω・)
normalizr のサンプルっぽくしたらどうだろうというのが正確な表現かもしれません。
しかしとりあえずこれで達成したい以下の2つの目的は何とかできそうだと考えています。