UNPKG

cluedin-widget

Version:

This is the project for creating and managing widgets in CluedIn.

26 lines (24 loc) 843 B
const constants = require( '../constants' ); const initialState = { genericLastTools: [], isFetchingGenericTools: false, isFakeGenericTools: false }; module.exports = function update( state = initialState, action = {} ) { switch( action.type ) { case constants.tool.RECEIVE_GENERIC_LAST_TOOLS: return Object.assign( {}, { genericLastTools: action.data.tools, isFetchingGenericTools: false, isFakeGenericTools: action.data.isFake } ); case constants.tool.REQUEST_GENERIC_LAST_TOOLS: return Object.assign( {}, { genericLastTools: state.genericLastTools, isFetchingGenericTools: true, isFakeGenericTools: false } ); default : return state; } };