braid-http
Advanced tools
Comparing version 0.3.20 to 0.3.21
@@ -69,3 +69,3 @@ var assert = require('assert') | ||
parse_update(req, update => { | ||
if (update.body) | ||
if (typeof update.body === 'string') | ||
// Return body as an "everything" patch | ||
@@ -72,0 +72,0 @@ cb([{unit: 'everything', range: '', content: update.body}]) |
{ | ||
"name": "braid-http", | ||
"version": "0.3.20", | ||
"version": "0.3.21", | ||
"description": "An implementation of Braid-HTTP for Node.js and Browsers", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -106,6 +106,6 @@ # Braid-HTTP | ||
var subscription_iterator = fetch('/chat', {subscribe: true}).subscription | ||
for await (var v of subscription_iterator) { | ||
for await (var update of subscription_iterator) { | ||
// Updates might come in the form of patches: | ||
if (v.patches) | ||
chat = apply_patches(v.patches, chat) | ||
if (update.patches) | ||
chat = apply_patches(update.patches, chat) | ||
@@ -115,3 +115,3 @@ // Or complete snapshots: | ||
// Beware the server doesn't send these yet. | ||
chat = JSON.parse(v.body) | ||
chat = JSON.parse(update.body) | ||
@@ -118,0 +118,0 @@ render_stuff() |
48766