Created
March 14, 2022 20:04
-
-
Save susimsek/d4d30526fb5e520aa2544b906d5afd0b to your computer and use it in GitHub Desktop.
Hateoas Redux Reducer
This file contains 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 initialState = { | |
capabilities: [], | |
capability: {}, | |
links: {}, | |
page: { | |
totalPages: 0, | |
totalElements: 0, | |
number: 0, | |
size: 3 | |
} | |
}; | |
export default function(state = initialState, action = {}) { | |
switch (action.type) { | |
case GET_CAPABILITIES: | |
return { | |
...state, | |
capabilities: action.payload, | |
links: action.links, | |
page: action.page | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment