Pergunta

I'm using the Firebase JS API in my trigger.io app.

My app must be able to start up and operate in Airplane Mode. Would it be acceptable for me to reference a local copy of the Firebase JS file, or must this always be loaded from the CDN url?

Alternatively, is there a way the file could be cached locally and requested on a scheduled basis to get the latest version, or is there another mechanism I should use that I'm missing out on.

Foi útil?

Solução

If you referenced a local copy of the firebase.js lib, it would work as well as the remote copy, at least initially. Since Firebase is in beta, changes can be pushed to that lib at any time, making your local copy obsolete.

Utilizing a local copy wouldn't, by itself, solve the issue you are hoping to address. While Firebase will survive temporary outages and spotty coverage, there is no locally stored copy of the data, so you'll need to either connect to Firebase initially and obtain that data, or use set() to create some sort of local default if offline.

More robust offline support is on the Firebase road map.

Some additional and very informative reading can be found here:

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top