Altinn / altinn-studio

Next generation open source Altinn platform and applications.
https://docs.altinn.studio
BSD 3-Clause "New" or "Revised" License
114 stars 70 forks source link

Multiple debounce mechanisms #12893

Closed mlqn closed 1 month ago

mlqn commented 4 months ago

Description

Studio currently uses several different debounce mechanisms. We should select one and remove the others to keep it consistent.

  1. react-use hook

https://github.com/Altinn/altinn-studio/blob/a5d9253df8d8736161aad9068ab57d02d8503310/frontend/dashboard/pages/Dashboard/Dashboard.tsx#L15

  1. Custom hook

https://github.com/Altinn/altinn-studio/blob/a5d9253df8d8736161aad9068ab57d02d8503310/frontend/packages/shared/src/hooks/useDebounce.ts#L4

  1. Custom implementation

https://github.com/Altinn/altinn-studio/blob/a5d9253df8d8736161aad9068ab57d02d8503310/frontend/packages/ux-editor/src/containers/FormItemContext.tsx#L143

Additional Information

No response

Tasks

No response

Acceptance Criterias

No response

wrt95 commented 3 months ago

Change all occurrences of debounce to use alternative nr. 2 😄 Also, move the useDebounce function to @studio/pure-functions package.

mlqn commented 1 month ago

Tested OK in dev!