mirror of
https://github.com/fergalmoran/turnstone.git
synced 2026-01-06 00:55:09 +00:00
Remove redundant TODOs
This commit is contained in:
@@ -86,6 +86,7 @@ const App = () => {
|
||||
placeholder={placeholder}
|
||||
plugins={[[recentSearchesPlugin, {ratio: 2, name: 'Recent', limit: maxItems}]]}
|
||||
styles={autocompleteStyles}
|
||||
text="bar"
|
||||
typeahead={true}
|
||||
Cancel={CancelButton}
|
||||
Clear={ClearButton}
|
||||
|
||||
@@ -8,7 +8,8 @@ import {
|
||||
formatQuery
|
||||
} from './containerEffects'
|
||||
|
||||
let inputRef = (value = '') => ( //TODO: Put in a beforeEach when blogging
|
||||
//TODO: Put in a beforeEach
|
||||
let inputRef = (value = '') => (
|
||||
{
|
||||
current: {
|
||||
focus: vi.fn(),
|
||||
|
||||
@@ -35,13 +35,14 @@ const limitResults = (groups, listboxProp, maxItems) => {
|
||||
const groupCounts = []
|
||||
let unassignedSlots = resultTotal < maxItems ? resultTotal : maxItems
|
||||
|
||||
while (unassignedSlots > 0) { // TODO: Use something better than a while loop
|
||||
while (unassignedSlots > 0) {
|
||||
groups = groups.map((group, i) => {
|
||||
if (!groupCounts[i]) {
|
||||
groupCounts[i] = Math.round(ratios[i] * ratioMultiplier)
|
||||
if (groupCounts[i] > group.length) groupCounts[i] = group.length
|
||||
unassignedSlots = unassignedSlots - groupCounts[i]
|
||||
} else if (groupCounts[i] < group.length) {
|
||||
}
|
||||
else if (groupCounts[i] < group.length) {
|
||||
unassignedSlots -= ++groupCounts[i]
|
||||
}
|
||||
return group
|
||||
@@ -114,8 +115,6 @@ export const fetcher = (query, listbox, defaultListbox, minQueryLength, maxItems
|
||||
|
||||
return groups.flat()
|
||||
})
|
||||
// .catch(() => {throw('Something went wrong')})
|
||||
//TODO Put a .catch here https://javascript.info/promise-error-handling
|
||||
}
|
||||
|
||||
const useData = (query, isImmutable, listbox, defaultListbox, minQueryLength, maxItems) => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { fetcher } from './useData'
|
||||
import undef from '../../utils/undef'
|
||||
import { fruits, vegetables, books } from '../../../data'
|
||||
|
||||
// TODO: This might be better tested in an integration test
|
||||
// TODO: This would be better tested in an integration test
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Test Fetched data //
|
||||
|
||||
@@ -4,7 +4,6 @@ import { describe, expect, test } from 'vitest'
|
||||
import { StateContextProvider } from '../context/state.jsx'
|
||||
import Item from './item.jsx'
|
||||
|
||||
// TODO: Create test helper files?
|
||||
const customStyles = {
|
||||
item: 'item-class',
|
||||
highlightedItem: 'highlighted-item-class',
|
||||
|
||||
@@ -19,7 +19,7 @@ const StateContextProvider = (props) => {
|
||||
props: propsMinusChildren
|
||||
})
|
||||
|
||||
useEffect(() => dispatch(setQuery(text)), [text]) // TODO: Is this needed?
|
||||
useEffect(() => dispatch(setQuery(text)), [text])
|
||||
|
||||
return (
|
||||
<StateContext.Provider
|
||||
|
||||
Reference in New Issue
Block a user