activitypub-academy/app/javascript/mastodon/reducers/activitypub_explorer.js
2023-04-17 17:54:35 +02:00

18 lines
510 B
JavaScript

import { Map as ImmutableMap } from 'immutable';
import { ACTIVITYPUB_EXPLORER_DATA, ACTIVITYPUB_EXPLORER_URL } from '../actions/activitypub_explorer';
const initialState = ImmutableMap({
data: null,
url: '',
});
export default function activitypub_explorer(state = initialState, action) {
switch (action.type) {
case ACTIVITYPUB_EXPLORER_DATA:
return state.set('data', action.value);
case ACTIVITYPUB_EXPLORER_URL:
return state.set('url', action.value);
default:
return state;
}
}