Skip to content

Commit

Permalink
use throttle 200 instead of debounce 1000 (#4670)
Browse files Browse the repository at this point in the history
Co-authored-by: Dong Lei <donglei@microsoft.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
  • Loading branch information
3 people authored Nov 4, 2020
1 parent 707131f commit 41f9bf9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { FocusZone, FocusZoneDirection } from 'office-ui-fabric-react/lib/FocusZ
import cloneDeep from 'lodash/cloneDeep';
import formatMessage from 'format-message';
import { DialogInfo, ITrigger, Diagnostic, DiagnosticSeverity } from '@bfc/shared';
import debounce from 'lodash/debounce';
import throttle from 'lodash/throttle';
import { useRecoilValue } from 'recoil';
import { ISearchBoxStyles } from 'office-ui-fabric-react/lib/SearchBox';
import { extractSchemaProperties, groupTriggersByPropertyReference, NoGroupingTriggerGroupName } from '@bfc/indexers';
Expand Down Expand Up @@ -152,7 +152,7 @@ export const ProjectTree: React.FC<Props> = ({
const [filter, setFilter] = useState('');
const formDialogComposerFeatureEnabled = useFeatureFlag('FORM_DIALOG');
const [selectedLink, setSelectedLink] = useState<Partial<TreeLink> | undefined>(defaultSelected);
const delayedSetFilter = debounce((newValue) => setFilter(newValue), 1000);
const delayedSetFilter = throttle((newValue) => setFilter(newValue), 200);
const addMainDialogRef = useCallback((mainDialog) => onboardingAddCoachMarkRef({ mainDialog }), []);
const projectCollection = useRecoilValue<BotInProject[]>(botProjectSpaceSelector).map((bot) => ({
...bot,
Expand Down

0 comments on commit 41f9bf9

Please sign in to comment.