1234567891011121314151617181920212223242526272829 |
- import { queryTags } from '../services/api';
-
- export default {
- namespace: 'monitor',
-
- state: {
- tags: [],
- },
-
- effects: {
- *fetchTags(_, { call, put }) {
- const response = yield call(queryTags);
- yield put({
- type: 'saveTags',
- payload: response.list,
- });
- },
- },
-
- reducers: {
- saveTags(state, action) {
- return {
- ...state,
- tags: action.payload,
- };
- },
- },
- };
|