我正在尝试将firebase-storage集成到我的firebase类中,但是我不知道该怎么做
我尝试创建一个专门用于存储的单独的初始化程序,并将其添加到firebase类之外
import app from 'firebase/app';
import 'firebase/auth';
import 'firebase/database';
import 'firebase/storage';
const config = { ... }
class Firebase {
constructor() {
app.initializeApp(config);
/* Firebase APIs */
this.auth = app.auth();
this.db = app.database();
}
// *** Auth API ***
doCreateUserWithEmailAndPassword = (email, password) =>
this.auth.createUserWithEmailAndPassword(email, password);
doSignInWithEmailAndPassword = (email, password) =>
this.auth.signInWithEmailAndPassword(email, password);
doSignOut = () => this.auth.signOut();
// *** User API ***
user = uid => this.db.ref(`users/${uid}`);
users = () => this.db.ref('users');
}