mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
removed player reducer, migrated to CRA 5
This commit is contained in:
parent
88f8fe21f7
commit
558e8f8a4f
211 changed files with 7131 additions and 10318 deletions
|
@ -1,14 +1,16 @@
|
|||
import { useCallback, useEffect, useState } from 'react';
|
||||
import useSWRInfinite from 'swr/infinite';
|
||||
import useSWRInfinite, { SWRInfiniteKeyLoader } from 'swr/infinite';
|
||||
import { flatten } from 'ramda';
|
||||
import { getSearchResults } from '~/api/flow';
|
||||
import { KeyLoader } from 'swr';
|
||||
import { INode } from '~/redux/types';
|
||||
import { GetSearchResultsRequest } from '~/types/flow';
|
||||
|
||||
const RESULTS_COUNT = 20;
|
||||
|
||||
const getKey: (text: string) => KeyLoader<INode[]> = text => (pageIndex, previousPageData) => {
|
||||
const getKey: (text: string) => SWRInfiniteKeyLoader = text => (
|
||||
pageIndex,
|
||||
previousPageData: INode[]
|
||||
) => {
|
||||
if ((pageIndex > 0 && !previousPageData?.length) || !text) return null;
|
||||
|
||||
const props: GetSearchResultsRequest = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue