chore: add mobile app

This commit is contained in:
2026-02-07 22:33:02 +01:00
parent db34640acc
commit e89384ad4e
29327 changed files with 3886944 additions and 12 deletions
+5
View File
@@ -0,0 +1,5 @@
/**
* React hook which returns the latest callback without changing the reference.
*/
declare function useLatestCallback<T extends Function>(callback: T): T;
export = useLatestCallback;
+28
View File
@@ -0,0 +1,28 @@
"use strict";
var React = require("react");
/**
* Use `useEffect` during SSR and `useLayoutEffect` in the Browser & React Native to avoid warnings.
*/
var useClientLayoutEffect = typeof document !== 'undefined' ||
(typeof navigator !== 'undefined' && navigator.product === 'ReactNative')
? React.useLayoutEffect
: React.useEffect;
/**
* React hook which returns the latest callback without changing the reference.
*/
// eslint-disable-next-line @typescript-eslint/ban-types
function useLatestCallback(callback) {
var ref = React.useRef(callback);
var latestCallback = React.useRef(function latestCallback() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return ref.current.apply(this, args);
}).current;
useClientLayoutEffect(function () {
ref.current = callback;
});
return latestCallback;
}
module.exports = useLatestCallback;