Skip to content

Instantly share code, notes, and snippets.

@alyssoncm
Created September 29, 2020 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alyssoncm/692df3908103e88b5f578a8a98e25047 to your computer and use it in GitHub Desktop.
Save alyssoncm/692df3908103e88b5f578a8a98e25047 to your computer and use it in GitHub Desktop.
subscription.on('open', async () => {
console.log('subscription opened');
todos = {};
todos = (await query.find()).reduce((todos, todo) => ({
...todos,
[todo.id]: todo
}), todos);
printTodos();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment