You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
880 B
47 lines
880 B
4 years ago
|
import { createThunk, handleThunks } from 'Store/thunks';
|
||
|
import createFetchHandler from './Creators/createFetchHandler';
|
||
|
import createHandleActions from './Creators/createHandleActions';
|
||
|
|
||
|
//
|
||
|
// Variables
|
||
|
|
||
|
export const section = 'indexerStatus';
|
||
|
|
||
|
//
|
||
|
// State
|
||
|
|
||
|
export const defaultState = {
|
||
|
isFetching: false,
|
||
|
isPopulated: false,
|
||
|
error: null,
|
||
|
items: [],
|
||
|
|
||
|
details: {
|
||
|
isFetching: false,
|
||
|
isPopulated: false,
|
||
|
error: null,
|
||
|
items: []
|
||
|
}
|
||
|
};
|
||
|
|
||
|
//
|
||
|
// Actions Types
|
||
|
|
||
|
export const FETCH_INDEXER_STATUS = 'indexerStatus/fetchIndexerStatus';
|
||
|
|
||
|
//
|
||
|
// Action Creators
|
||
|
|
||
|
export const fetchIndexerStatus = createThunk(FETCH_INDEXER_STATUS);
|
||
|
|
||
|
//
|
||
|
// Action Handlers
|
||
|
|
||
|
export const actionHandlers = handleThunks({
|
||
|
[FETCH_INDEXER_STATUS]: createFetchHandler(section, '/indexerStatus')
|
||
|
});
|
||
|
|
||
|
//
|
||
|
// Reducers
|
||
|
export const reducers = createHandleActions({}, defaultState, section);
|