mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 23:27:26 +01:00
commit
849dc4bbe3
5 changed files with 22 additions and 20 deletions
2
__mocks__/react-native-image-picker.js
vendored
2
__mocks__/react-native-image-picker.js
vendored
|
@ -1,4 +1,4 @@
|
|||
import {NativeModules} from 'react-native';
|
||||
import { NativeModules } from 'react-native';
|
||||
|
||||
// Mock the ImagePickerManager native module to allow us to unit test the JavaScript code
|
||||
NativeModules.ImagePickerManager = {
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
/**
|
||||
* Let's keep config vars, constants and definitions here
|
||||
*/
|
||||
|
||||
export const groundControlUri = 'https://groundcontrol-bluewallet.herokuapp.com/';
|
5
blue_modules/constants.ts
Normal file
5
blue_modules/constants.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* Let's keep config vars, constants and definitions here
|
||||
*/
|
||||
|
||||
export const groundControlUri: string = 'https://groundcontrol-bluewallet.herokuapp.com/';
|
|
@ -1,14 +0,0 @@
|
|||
// https://levelup.gitconnected.com/debounce-in-javascript-improve-your-applications-performance-5b01855e086
|
||||
const debounce = (func, wait) => {
|
||||
let timeout;
|
||||
return function executedFunction(...args) {
|
||||
const later = () => {
|
||||
timeout = null;
|
||||
func(...args);
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
};
|
||||
|
||||
export default debounce;
|
16
blue_modules/debounce.ts
Normal file
16
blue_modules/debounce.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
// https://levelup.gitconnected.com/debounce-in-javascript-improve-your-applications-performance-5b01855e086
|
||||
const debounce = <T extends (...args: any[]) => void>(func: T, wait: number) => {
|
||||
let timeout: NodeJS.Timeout | null;
|
||||
return function executedFunction(this: ThisParameterType<T>, ...args: Parameters<T>) {
|
||||
const later = () => {
|
||||
timeout = null;
|
||||
func.apply(this, args);
|
||||
};
|
||||
if (timeout) {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
};
|
||||
|
||||
export default debounce;
|
Loading…
Add table
Reference in a new issue