mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-12-05 00:59:04 +01:00
19 lines
473 B
TypeScript
19 lines
473 B
TypeScript
|
import { createReducer } from '@reduxjs/toolkit';
|
||
|
|
||
|
import { submitMarkersAction } from 'mastodon/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;
|
||
|
},
|
||
|
);
|
||
|
});
|