activitypub-academy/app/javascript/mastodon/reducers/activitypub_explorer.js

19 lines
510 B
JavaScript
Raw Normal View History

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