Skip to content

Commit

Permalink
split useSignleExecution for web and native
Browse files Browse the repository at this point in the history
  • Loading branch information
getusha committed Nov 7, 2023
1 parent 1f3d2a3 commit c97ff97
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 44 deletions.
40 changes: 0 additions & 40 deletions src/hooks/useSingleExecution/index.native.js

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {useCallback} from 'react';

type Action<T extends unknown[]> = (...params: T) => void | Promise<void>;

/**
* This hook was specifically written for native issue
* more information: https://github.com/Expensify/App/pull/24614 https://github.com/Expensify/App/pull/24173
* on web we don't need this mechanism so we just call the action directly.
*
* @returns {Object}
*/
export default function useSingleExecution() {
const singleExecution = useCallback(
(action) =>
(...params) => {
<T extends unknown[]>(action: Action<T>) =>
(...params: T) => {
action(...params);
},
[],
Expand Down

0 comments on commit c97ff97

Please sign in to comment.