This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
realm.module("app.services.ToDo", ["realm.router.BridgeRequest"], function(BridgeRequest) { | |
var $_exports; | |
$_exports = { | |
'add': function() { | |
return BridgeRequest.connect("app.services.ToDo", "add", arguments) | |
} | |
} | |
return $_exports; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use realm bridge"; | |
class ToDo { | |
static add(name) {} | |
} | |
export Todo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use realm"; | |
import MainController, LoginController from app.controllers; | |
import User from models; | |
import lodash as _ from app.utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use realm"; | |
class Controller { | |
} | |
export Controller; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use realm bridge" | |
import request from app.utils; | |
class GoogleBlog { | |
static getFeed(value) { | |
return new Promise(function(resolve, reject) { | |
request.get({ | |
url: "https://ajax.googleapis.com/ajax/services/feed/find?v=1.0", | |
json: true, | |
qs: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
realm.module("app.blogs.GoogleFeed", ["app.utils.request"], function(request) { | |
var $_exports; | |
class GoogleBlog { | |
// code here | |
} | |
$_exports = GoogleBlog; | |
return $_exports; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
realm.module("app.blogs.GoogleFeed", ["realm.router.BridgeRequest"], function(BridgeRequest) { | |
var $_exports; | |
$_exports = { | |
'getFeed': function() { | |
return BridgeRequest.connect("app.blogs.GoogleFeed", "getFeed", arguments) | |
} | |
} | |
return $_exports; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pwd, email, user; | |
UserFlow.validateEmail(email) | |
.then(UserFlow.checkUserExists) // Check if user exists | |
.then(function(existingUser){ // Spitting custom exception | |
if( existingUser ){ | |
throw Error('User exists') | |
} | |
}).then(() => { | |
return UserFlow.hashPassword(pwd); // Hash password | |
}).then((hashedPwd)=>{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const UserFlow = { | |
fetchUser : (criteria) => { | |
return User.find(criteria).first() // Fetching a record | |
}, | |
checkUserExists : (email) => { | |
return this.fetchUser({email : email}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyChain { | |
setFoo() { | |
// I am the first one. And i set this.foo = "foo1" | |
return "foo1"; | |
} | |
setBar() { | |
// I am the second one, and i have "this.foo" at my disposal | |
// And i set this.bar = "bar1" | |
return "bar1"; | |
} |
OlderNewer