How to use the react-redux-firebase/lib/utils.getEventsFromInput function in react-redux-firebase

To help you get started, we’ve selected a few react-redux-firebase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Venryx / DebateMap / Source / Frame / Database / DatabaseHelpers.ts View on Github external
let result;

	let requestedPathsSoFar = {};
	let requestedPathsSoFar_last;
	do {
		requestedPathsSoFar_last = Clone(requestedPathsSoFar);

		ClearRequestedPaths();
		result = dbGetterFunc();
		let newRequestedPaths = GetRequestedPaths().Except(requestedPathsSoFar.VKeys());

		if (!dbDataLocked) {
			StartBufferingActions();
			//let oldNodeRenderCount = NodeUI.renderCount;
			unWatchEvents(firebase, store.dispatch, getEventsFromInput(newRequestedPaths)); // do this just to trigger re-get
			// start watching paths (causes paths to be requested)
			watchEvents(firebase, store.dispatch, getEventsFromInput(newRequestedPaths));
			//Assert(NodeUI.renderCount == oldNodeRenderCount, "NodeUIs rendered during unwatch/watch event!");
			StopBufferingActions();
		}

		for (let path of newRequestedPaths) {
			requestedPathsSoFar[path] = true;
			// wait till data is received (assuming we don't have a state-override that's just locking the content of firebase.data anyway)
			if (!dbDataLocked) {
				await WaitTillPathDataIsReceived(path);
			}
		}

		// stop watching paths (since we already got their data)
		// todo: find correct way of unwatching events; the way below seems to sometimes unwatch while still needed watched
github Venryx / DebateMap / Source / Frame / Database / DatabaseHelpers.ts View on Github external
let requestedPathsSoFar = {};
	let requestedPathsSoFar_last;
	do {
		requestedPathsSoFar_last = Clone(requestedPathsSoFar);

		ClearRequestedPaths();
		result = dbGetterFunc();
		let newRequestedPaths = GetRequestedPaths().Except(requestedPathsSoFar.VKeys());

		if (!dbDataLocked) {
			StartBufferingActions();
			//let oldNodeRenderCount = NodeUI.renderCount;
			unWatchEvents(firebase, store.dispatch, getEventsFromInput(newRequestedPaths)); // do this just to trigger re-get
			// start watching paths (causes paths to be requested)
			watchEvents(firebase, store.dispatch, getEventsFromInput(newRequestedPaths));
			//Assert(NodeUI.renderCount == oldNodeRenderCount, "NodeUIs rendered during unwatch/watch event!");
			StopBufferingActions();
		}

		for (let path of newRequestedPaths) {
			requestedPathsSoFar[path] = true;
			// wait till data is received (assuming we don't have a state-override that's just locking the content of firebase.data anyway)
			if (!dbDataLocked) {
				await WaitTillPathDataIsReceived(path);
			}
		}

		// stop watching paths (since we already got their data)
		// todo: find correct way of unwatching events; the way below seems to sometimes unwatch while still needed watched
		// for now, we just never unwatch
		//unWatchEvents(firebase, store.dispatch, getEventsFromInput(newRequestedPaths));
github Venryx / DebateMap / Source / Frame / Database / FirebaseConnect.ts View on Github external
setImmediate(()=> {
				s._firebaseEvents = getEventsFromInput(requestedPaths);
				let removedPaths = oldRequestedPaths.Except(...requestedPaths);
				// todo: find correct way of unwatching events; the way below seems to sometimes unwatch while still needed watched
				// for now, we just never unwatch
				//unWatchEvents(firebase, DispatchDBAction, getEventsFromInput(removedPaths));
				let addedPaths = requestedPaths.Except(...oldRequestedPaths);
				watchEvents(firebase, DispatchDBAction, getEventsFromInput(addedPaths));
				// for debugging, you can check currently-watched-paths using: store.firebase._.watchers
			});
			s.lastRequestedPaths = requestedPaths;
github Venryx / DebateMap / Source / Frame / Database / FirebaseConnect.ts View on Github external
setImmediate(()=> {
				s._firebaseEvents = getEventsFromInput(requestedPaths);
				let removedPaths = oldRequestedPaths.Except(...requestedPaths);
				// todo: find correct way of unwatching events; the way below seems to sometimes unwatch while still needed watched
				// for now, we just never unwatch
				//unWatchEvents(firebase, DispatchDBAction, getEventsFromInput(removedPaths));
				let addedPaths = requestedPaths.Except(...oldRequestedPaths);
				watchEvents(firebase, DispatchDBAction, getEventsFromInput(addedPaths));
				// for debugging, you can check currently-watched-paths using: store.firebase._.watchers
			});
			s.lastRequestedPaths = requestedPaths;