Commit d9c9d5db authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Improve type-checking

parent 6093ca6b
...@@ -531,16 +531,17 @@ function sortKeys(state) { ...@@ -531,16 +531,17 @@ function sortKeys(state) {
/** /**
* Retrieve state needed to calculate the root thread * Retrieve state needed to calculate the root thread
* *
* @return {ThreadState} * @type {(rootState: any) => ThreadState}
*/ */
const threadState = createSelector( const threadState = createSelector(
rootState => rootState.annotations.annotations, rootState => rootState.annotations.annotations,
rootState => rootState.route.name, rootState => rootState.route.name,
rootState => rootState.selection, rootState => rootState.selection,
(annotations, routeName, selection) => { (annotations, routeName, selection) => {
const filters = {}; const filters = /** @type {Object.<string,string>} */ ({});
if (focusModeActive(selection)) { const userFilter = focusModeUserFilter(selection);
filters.user = focusModeUserFilter(selection); if (userFilter) {
filters.user = userFilter;
} }
const selectionState = { const selectionState = {
expanded: expandedMap(selection), expanded: expandedMap(selection),
......
...@@ -134,7 +134,7 @@ export function toObject(searchText) { ...@@ -134,7 +134,7 @@ export function toObject(searchText) {
* Terms that are not associated with a particular facet are stored in the "any" * Terms that are not associated with a particular facet are stored in the "any"
* facet. * facet.
* *
* @param {string|null} searchText - Filter query to parse * @param {string} searchText - Filter query to parse
* @param {FocusFilter} focusFilters - Additional filter terms to mix in * @param {FocusFilter} focusFilters - Additional filter terms to mix in
* @return {Object.<string,Facet>} * @return {Object.<string,Facet>}
*/ */
......
...@@ -47,7 +47,7 @@ function buildRootThread(threadState) { ...@@ -47,7 +47,7 @@ function buildRootThread(threadState) {
if (annotationsFiltered) { if (annotationsFiltered) {
const filters = generateFacetedFilter( const filters = generateFacetedFilter(
selection.filterQuery, selection.filterQuery || '',
selection.filters selection.filters
); );
options.filterFn = ann => filterAnnotations([ann], filters).length > 0; options.filterFn = ann => filterAnnotations([ann], filters).length > 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment