cluedin-widget
Version:
This is the project for creating and managing widgets in CluedIn.
23 lines (21 loc) • 632 B
JavaScript
const constants = require( '../constants' );
const initialState = {
providers: [],
isFetching: true
};
module.exports = function update( state = initialState, action = {} ) {
switch( action.type ) {
case constants.provider.REQUEST_ACTIVE_PROVIDERS:
return Object.assign( {}, {
providers: [],
isFetching: true
} );
case constants.provider.RECEIVE_ACTIVE_PROVIDERS:
return Object.assign( {}, {
providers: action.data,
isFetching: false
} );
default:
return state;
}
};