I have a one-page React application that consists of many files, complete with gulp / browsify.
Firebase javascript is built into this package.
I would like to know if there is an easy way to execute some Firebase actions in another workflow?
What I tried:
Setting up the worker and sending the Firebase object or instance via worker.postMessage(xxx) . In both cases, it throws the error message the object cannot be cloned . Example below with a Firebase object.
var blobURL = URL.createObjectURL(new Blob([ '(', (function() { var onmessage = function(event) { var FB = new event.data.Firebase('my firebase URL');
In the above example, the worker works (ha ha) until I try to pass Firebase.
What I would like to avoid:
Installing two completely different bundles: one with the main application and one dedicated to all Firebase operations, using the auxiliary library to send operations from each other.
Note. The reason for this question is because my interface is slowed down by Firebase operations. For example, I have a list of elements displayed on the page, and when I scroll, each time the element is visible, the view count of this object is updated by Firebase. Scrolling the page is smooth without these operations and becomes sharp when I add them.
Edit: Also, I get the following warning: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user experience.
source share