Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
next(searchLunr);
let results = options.store.existingStore ?
retrieveResultsFromState(getState, options, doLunrSearch(getState, _query)) :
retrieveResultsFromStore(getState, doLunrSearch(getState, _query));
next({
type: LUNR_SEARCH_SUCCESS,
results: _limit ? results.slice(0, _limit) : results,
query: _query
});
break;
case LUNR_LOAD_SEARCH_INDEX:
next(searchLunr);
next({
type: LUNR_LOAD_SEARCH_INDEX_SUCCESS,
searchIndex: lunr.index.load(JSON.parse(_index))
});
break;
case LUNR_SEARCH_RESET:
next(searchLunr);
break;
default:
throw new UnreconizedActionTypeException('Unknown action, ' + type);
}
}
}