YoannCHB / firebaseLoader

Manage firebase in javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

firebaseLoader

Manage firebase in javascript

  • auto imports firebase modules
  • database integration

WARNING: error not supported in min.js version

##instructions

  • constructor(config: firebaseConfigJson, callback: funtion)
  • constructor(config: firebaseConfigJson, callback: funtion, imp: array)
  • getModError(): int
  • getModLoaded(): int
  • getDatabase(): firebase
  • getModuleStats(): boolean
  • getCallback(): function
  • getImportFiles(): array
  • getValuesDatabase(callback: function): void
  • getValueKeyDatabase(key: String, callback: function): void
  • writeDatabase(key: String, values: json)
  • importAllModule(): void //imports modules from firebase
  • importModule(url: String): void //import one specific module
/*
  Example write and read database from firebase
*/
var firebaseConfig = {
    apiKey: "",
    authDomain: "",
    databaseURL: "",
    projectId: "",
    storageBucket: "",
    messagingSenderId: "",
    appId: "",
    measurementId: ""
};
var g = new firebaseLoader(firebaseConfig, function(e){

    /*
      Get values from database
    */
    e.getValuesDatabase(function(key,val){
        console.log(key,val);
    });
    
    
    
    /*
      Write on the database
    */
    e.writeDatabase("animes",{val: "Hey"});
    
    
});

/*
  Imports module of firebase and launch the function above
  WARNING: obligatory function to launch the script !
*/
g.importAllModule();

About

Manage firebase in javascript

License:Apache License 2.0


Languages

Language:JavaScript 100.0%