adding web sockets (part 1) #15

Merged
bones7242 merged 6 commits from master into master 2017-05-26 10:37:42 +02:00
bones7242 commented 2017-05-26 10:37:29 +02:00 (Migrated from github.com)

I added websockets implementation (using socket.io) to cover the retrieval of claims at spee.ch/name and spee.ch/name/claim_id

still needed: web sockets implementation for the publish functionality

I added websockets implementation (using socket.io) to cover the retrieval of claims at spee.ch/name and spee.ch/name/claim_id still needed: web sockets implementation for the publish functionality
kauffj (Migrated from github.com) reviewed 2017-05-31 20:38:11 +02:00
@ -40,0 +46,4 @@
).then(function (getUriResponse) {
console.log(">> 'get claim' success...");
//check to make sure the daemon didn't just time out
if (getUriResponse.data.result.error === "Timeout"){
kauffj (Migrated from github.com) commented 2017-05-31 20:38:11 +02:00

It's a good idea to define strings that have special values as constants.

It's a good idea to define strings that have special values as constants.
kauffj (Migrated from github.com) reviewed 2017-05-31 20:43:38 +02:00
kauffj (Migrated from github.com) left a comment

Just a few late comments on this, I hadn't looked at it in detail until today.

Just a few late comments on this, I hadn't looked at it in detail until today.
@ -40,0 +55,4 @@
/*
note: put in a check to make sure we do not resolve until the download is actually complete
*/
resolve(getUriResponse.data.result.download_path);
kauffj (Migrated from github.com) commented 2017-05-31 20:39:59 +02:00

If you find yourself accessing the same field repeatedly, like getUriResponse.data, it can be good to just dereference it.

Additionally, assuming you're writing ES6 (which is probably a good idea), you can just write:

.then(({data}) => { if (data.result.error === "Timeout") //etc. })

If you find yourself accessing the same field repeatedly, like getUriResponse.data, it can be good to just dereference it. Additionally, assuming you're writing ES6 (which is probably a good idea), you can just write: `.then(({data}) => { if (data.result.error === "Timeout") //etc. })`
@ -109,0 +132,4 @@
.catch(function(error){
console.log(">> error:", error);
// reject the promise with an approriate message
reject(error.response.data.error);
kauffj (Migrated from github.com) commented 2017-05-31 20:40:55 +02:00

This should probably be defined as a constant.

This should probably be defined as a constant.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/spee.ch#15
No description provided.