Skip to content

Configurations

Sezer Ekinci edited this page Sep 5, 2017 · 5 revisions

You can set/change flatte settings where ever you want as below. After configure you can use "db" or "do" functions.

flatte.settings({
  debug: false,
  baseRef: "/",
  con: firebase,
  manifest: {},
  predefined: {}
});

Settings can be used with different ways as below:

/********* One option editing.*********/
flatte.settings().con = firebaseCon;

/********* Multiple options defining *********/
flatte.settings({con : firebaseCon});

/********* if sent with true, flatte will replace all settings with the new object. *********/
flatte.settings({con : firebaseCon}, true);

debug

Allows you to see progress of "flatte.do" in console. Action will return results. All actions will be stored inside flatte. You can get these action informations by writing "flatte.do.getDebug()" command.

Available Options: true / false.

baseRef

flatte uses this as baseRef of actions. Manifest will be affected with baseRef. (If you have users you can set baseRef depends on these users db path.)

Available Options: String.

  • Example1: "/".
  • Example1: "/app".
  • Example1: "/user/<!your userID>".

con

Your firebase connection object.

Available Options: firebase / customFirebase.

Example:

var config = {
	apiKey: "<your-apiKey>",
	authDomain: "<your-authDomain>",
	databaseURL: "<your-databaseURL>",
	projectId: "<your-projectId>",
	storageBucket: "<your-storageBucket>",
	messagingSenderId: "<your-messagingSenderId>"
};
var firebaseCon = firebase.initializeApp(config);
flatte.settings().con = firebaseCon;

manifest

You should set your manifest. You can store your manifest in either json file, database, angular const or any variable.

Detailed information for creating manifest please see:

Available Options: Object.

predefined

Predefined is containing some templates to use in manifest. We have set some basic predefined template for you as default in "flatte.js" file.

Detailed information for creating predefined please see:

Available Options: Object.

Clone this wiki locally