mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 08:42:08 +10:00
Firebase Stub: debounce callback called by "on" function
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
import DatabaseConstants from '../constants/database';
|
||||
import DataSnapshot from './dataSnapshot';
|
||||
@ -108,7 +109,8 @@ class Reference {
|
||||
snapshot = new DataSnapshot(eventType, () => this.getData());
|
||||
}
|
||||
|
||||
callback(snapshot);
|
||||
const debouncedCallback = debounce(callback, 100);
|
||||
debouncedCallback(snapshot);
|
||||
}
|
||||
|
||||
async once(eventType) {
|
||||
|
||||
Reference in New Issue
Block a user