pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
https://rxdb.info/
Apache License 2.0
21.37k stars 1.04k forks source link

es5 and es6 #39

Closed roushanj closed 7 years ago

roushanj commented 7 years ago

ES6:

import * as RxDB from 'rxdb'; RxDB.create('heroesDB', 'websql', 'myLongAndStupidPassword', true) // create database .then(db => db.collection('mycollection', mySchema)) // create collection .then(collection => collection.insert({name: 'Bob'})) // insert document

ES5:

var RxDB = require('rxdb'); RxDB.create('heroesDB', 'websql', 'myLongAndStupidPassword', true) // create database .then(function(db) {return db.collection('mycollection', mySchema);}) // create collection .then(function(collection) {collection.insert({name: 'Bob'});}) // insert document

where i suppose to put this code ,

pubkey commented 7 years ago

@roushanj please check one of the examples.