braid-http 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/readme.md +5 -7
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -51,7 +51,7 @@ fetch('https://braid.org/chat', {subscribe: true}).then(
|
|
|
51
51
|
(new_version) => {
|
|
52
52
|
console.log('We got a new version!', new_version)
|
|
53
53
|
// {
|
|
54
|
-
// version: "me",
|
|
54
|
+
// version: ["me"],
|
|
55
55
|
// parents: ["mom", "dad"],
|
|
56
56
|
// patches: [{unit: "json", range: ".foo", content: "3"}]
|
|
57
57
|
// body: "3"
|
|
@@ -153,7 +153,7 @@ require('http').createServer(
|
|
|
153
153
|
|
|
154
154
|
// Send the current version
|
|
155
155
|
res.sendUpdate({
|
|
156
|
-
version: 'greg',
|
|
156
|
+
version: ['greg'],
|
|
157
157
|
body: JSON.stringify({greg: 'greg'})
|
|
158
158
|
})
|
|
159
159
|
}
|
|
@@ -184,14 +184,14 @@ app.get('/', (req, res) => {
|
|
|
184
184
|
|
|
185
185
|
// Send the current version
|
|
186
186
|
res.sendUpdate({
|
|
187
|
-
version: 'greg',
|
|
187
|
+
version: ['greg'],
|
|
188
188
|
parents: ['gr','eg'],
|
|
189
189
|
body: JSON.stringify({greg: 'greg'})
|
|
190
190
|
})
|
|
191
191
|
|
|
192
192
|
// Or you can send patches like this:
|
|
193
193
|
// res.sendUpdate({
|
|
194
|
-
// version: 'greg',
|
|
194
|
+
// version: ['greg'],
|
|
195
195
|
// parents: ['gr','eg'],
|
|
196
196
|
// patches: [{range: '.greg', unit: 'json', content: '"greg"'}]
|
|
197
197
|
// })
|
|
@@ -234,7 +234,7 @@ function connect () {
|
|
|
234
234
|
(res) => {
|
|
235
235
|
res.on('version', (version) => {
|
|
236
236
|
// {
|
|
237
|
-
// version: "me",
|
|
237
|
+
// version: ["me"],
|
|
238
238
|
// parents: ["mom", "dad"],
|
|
239
239
|
// patches: [{unit: "json", range: ".foo", content: "3"}]
|
|
240
240
|
// body: "3"
|
|
@@ -272,5 +272,3 @@ automatically reconnect. (See
|
|
|
272
272
|
[issue #980](https://github.com/node-fetch/node-fetch/issues/980) and
|
|
273
273
|
[#753](https://github.com/node-fetch/node-fetch/issues/753).) We recommend
|
|
274
274
|
using the `http` library (below) for requests on nodejs instead.
|
|
275
|
-
|
|
276
|
-
|