@graphql-live/client
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -33,2 +33,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
record.latestResult = applyPatch(previousResult, patch).newDocument; | ||
console.log("Patched", previousResult, "with", patch); | ||
record.observer.next(record.latestResult); | ||
@@ -49,2 +50,5 @@ if (isFinal) { | ||
}; | ||
setTimeout(() => { | ||
socket.disconnect(); | ||
}, 15000); | ||
const execute = (operation, observer) => { | ||
@@ -67,3 +71,3 @@ const id = currentId++; | ||
operations.set(id, record); | ||
void record.execute(); | ||
record.execute(); | ||
return () => { | ||
@@ -70,0 +74,0 @@ socket.emit("graphql:unsubscribe", id); |
{ | ||
"name": "@graphql-live/client", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "The client part of the GraphQLive package", | ||
@@ -33,2 +33,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/node": "^14.14.35", | ||
"typescript": "^4.2.3", | ||
@@ -35,0 +36,0 @@ "urql": "^2.0.1" |
@@ -67,2 +67,3 @@ import { io, ManagerOptions, SocketOptions } from "socket.io-client"; | ||
record.latestResult = applyPatch(previousResult, patch).newDocument; | ||
console.log("Patched", previousResult, "with", patch); | ||
record.observer.next(record.latestResult); | ||
@@ -86,2 +87,6 @@ if (isFinal) { | ||
setTimeout(() => { | ||
socket.disconnect(); | ||
}, 15000); | ||
const execute = (operation: Operation, observer: ResultObserver) => { | ||
@@ -102,3 +107,3 @@ const id = currentId++; | ||
operations.set(id, record); | ||
void record.execute(); | ||
record.execute(); | ||
return () => { | ||
@@ -105,0 +110,0 @@ socket.emit("graphql:unsubscribe", id); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
192568
282
3