long.tsx 732 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { createSlice } from "@reduxjs/toolkit";
  2. interface LongState {
  3. // scenario: null,
  4. join: any,
  5. follow: any,
  6. title: string,
  7. }
  8. const initialState: LongState = {
  9. // scenario: null,
  10. join: null,
  11. follow: null,
  12. title: ''
  13. }
  14. const longSlice = createSlice({
  15. name: 'access',
  16. initialState,
  17. reducers: {
  18. setJoinData(state, action) {
  19. state.join = action.payload
  20. },
  21. setFollow(state, action) {
  22. state.follow = action.payload
  23. },
  24. setJoinTitle(state, action) {
  25. state.title = action.payload
  26. },
  27. }
  28. });
  29. export default longSlice.reducer;
  30. export const { setJoinData, setFollow, setJoinTitle } = longSlice.actions;