1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-12 21:59:04 +09:00
YuruToot/app/javascript/flavours/glitch/reducers/markers.ts

19 lines
480 B
TypeScript
Raw Normal View History

import { createReducer } from '@reduxjs/toolkit';
import { submitMarkersAction } from 'flavours/glitch/actions/markers';
const initialState = {
home: '0',
notifications: '0',
};
export const markersReducer = createReducer(initialState, (builder) => {
builder.addCase(
submitMarkersAction.fulfilled,
(state, { payload: { home, notifications } }) => {
if (home) state.home = home;
if (notifications) state.notifications = notifications;
},
);
});