Skip to content

Instantly share code, notes, and snippets.

@Jtmaca9
Created May 21, 2016 02:11
Show Gist options
  • Save Jtmaca9/31b36c2ff654540ca84c63fc422c0838 to your computer and use it in GitHub Desktop.
Save Jtmaca9/31b36c2ff654540ca84c63fc422c0838 to your computer and use it in GitHub Desktop.
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