mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-12-05 00:59:04 +01:00
19 lines
550 B
TypeScript
19 lines
550 B
TypeScript
|
import { createReducer, isAnyOf } from '@reduxjs/toolkit';
|
||
|
|
||
|
import {
|
||
|
fetchNotificationPolicy,
|
||
|
updateNotificationsPolicy,
|
||
|
} from 'mastodon/actions/notification_policies';
|
||
|
import type { NotificationPolicy } from 'mastodon/models/notification_policy';
|
||
|
|
||
|
export const notificationPolicyReducer =
|
||
|
createReducer<NotificationPolicy | null>(null, (builder) => {
|
||
|
builder.addMatcher(
|
||
|
isAnyOf(
|
||
|
fetchNotificationPolicy.fulfilled,
|
||
|
updateNotificationsPolicy.fulfilled,
|
||
|
),
|
||
|
(_state, action) => action.payload,
|
||
|
);
|
||
|
});
|