Created
May 21, 2016 02:11
-
-
Save Jtmaca9/31b36c2ff654540ca84c63fc422c0838 to your computer and use it in GitHub Desktop.
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
module.exports = function() { | |
const app = this; | |
const gameService = app.service('game'); | |
gameService.create(null, "tiwas", "tiwas"); | |
gameService.create(null, "rp", "rp"); | |
gameService.create(null, "", "tiwas"); | |
gameService.get("rp").then((game) => {console.log(game.time)}); | |
gameService.get("tiwas").then((game) =>{console.log(game)}); | |
function timer(){ | |
var finish = false; | |
// | |
console.log(time); | |
if(!finish) setTimeout(timer, 1000); | |
} | |
//timer(); | |
} | |
// app.service('game').patch('', { | |
// users: ["Bob", "Bob", "Jerry"], | |
// }).then(() => { | |
// app.service('game').find({}).then((game) => console.log("game", game.users.toArray())); | |
// }); | |
// | |
// gameService.find({}).then(({ time }) => { | |
// console.log("They found me !~!") | |
// gameService.patch(null, { time: time + 1 }); | |
// }) | |
// | |
// | |
// gameService.on('patched', (game) => { console.log(game.time)}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment