init
This commit is contained in:
20
snippets/rjsx-mode/Redux/rxreducer
Normal file
20
snippets/rjsx-mode/Redux/rxreducer
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- mode: snippet -*-
|
||||
# uuid: a7bb3ea0-bf96-401b-851e-a63b254f42ba
|
||||
# contributor: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
|
||||
# name: reduxReducer
|
||||
# key: rxreducer
|
||||
# --
|
||||
|
||||
const initialState = {
|
||||
|
||||
}
|
||||
|
||||
export default (state = initialState, { type, payload }) => {
|
||||
switch (type) {
|
||||
case ${1:typeName}:
|
||||
return { ...state, ...payload }
|
||||
|
||||
default:
|
||||
return state
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user