geofirex icon indicating copy to clipboard operation
geofirex copied to clipboard

Why do we need to init?

Open ollyde opened this issue 6 years ago • 3 comments

I can't use this lib because of the init function. Init is global (on the index's file) and some large projects don't let you change this.

// Init GeoFireX
import * as geofirex from 'geofirex';
const geo = geofirex.init(firebase);

Why do we need to init?

ollyde avatar Feb 02 '19 18:02 ollyde

cannot get past the init function within a Vue app. Any updates?

jparish3 avatar Mar 04 '20 19:03 jparish3

Same problem here´.

"export 'default' (imported as 'geofirex') was not found in 'geofirex'

areindl avatar May 12 '20 14:05 areindl

I'm using geofirex in a VueJS project and this seems to work for me:

import firebase from 'firebase/app'
import 'firebase/firestore';
import * as geofirex from 'geofirex';

const firebaseConfig = {/* ... */}

firebase.initializeApp(firebaseConfig)
const geo = geofirex.init(firebase)
const db = firebase.firestore()

But :( I have to do this for each component I'm using geofirex in... I'm unable to import geo from another file.

LaundroMat avatar May 13 '20 12:05 LaundroMat