Created
November 12, 2020 12:13
-
-
Save halfbug/4d50d263a0dc055b30ea5b4de3b418ba to your computer and use it in GitHub Desktop.
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
import { createSlice } from '@reduxjs/toolkit'; | |
export const initialState = {}; | |
const slice = createSlice({ | |
name: 'lastPropertyId', | |
initialState, | |
reducers: { | |
store(state, action) { | |
const { payload } = action; | |
return payload; | |
}, | |
setLastPropertyId(state, action) { | |
const { payload } = action; | |
return { ...state, lastPropertyId: payload }; | |
console.log("setLastPropertyId -> payload", payload) | |
}, | |
}, | |
}); | |
export const { store, setLastPropertyId } = slice.actions; | |
export default slice.reducer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment