Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
switch (action.actionType) {
case actionsConstants.SEARCH_START:
SearchStore.emit(actionsConstants.SEARCH_START);
break;
case actionsConstants.SEARCH_RESULTS:
searchResults = action.results;
searchError = null;
SearchStore.emit(actionsConstants.SEARCH_RESULTS);
break;
case actionsConstants.SEARCH_ERROR:
searchResults = null;
searchError = action.error;
SearchStore.emit(actionsConstants.SEARCH_ERROR);
break;
default:
// no op
}
}
);
function(action) {
switch (action.actionType) {
case actionsConstants.SEARCH_START:
SearchStore.emit(actionsConstants.SEARCH_START);
break;
case actionsConstants.SEARCH_RESULTS:
searchResults = action.results;
searchError = null;
SearchStore.emit(actionsConstants.SEARCH_RESULTS);
break;
case actionsConstants.SEARCH_ERROR:
searchResults = null;
searchError = action.error;
SearchStore.emit(actionsConstants.SEARCH_ERROR);
break;
default:
// no op
}
}
);
function(error) {
dispatcher.dispatch({
actionType: actionsConstants.SEARCH_ERROR,
error: error
});
isSearching = false;
}
);