Last active
November 24, 2020 14:42
Revisions
-
Avaq revised this gist
Dec 24, 2018 . 1 changed file with 8 additions and 6 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,11 +3,13 @@ const request = require('./request'); const {encase} = require('fluture'); const eventualName = ( request({url: 'https://api.github.com/users/avaq', headers: {'User-Agent': 'Avaq'}}) .map(res => res.body) .chain(encase(JSON.parse)) .map(user => user.name) ); const cancel = eventualName.fork(console.error, console.log); process.on('SIGINT', cancel); -
Avaq revised this gist
Sep 22, 2016 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,11 @@ const request = require('./request'); const {encase} = require('fluture'); const name_ = request({url: 'https://api.github.com/users/avaq', headers: {'User-Agent': 'Avaq'}}) .map(res => res.body) .chain(encase(JSON.parse)) .map(user => user.name); const cancel = name_.fork(console.error, console.log); process.on('SIGINT', cancel); -
Avaq revised this gist
Sep 22, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ 'use strict'; const request = require('./request'); const {encase} = require('fluture'); request({url: 'https://api.github.com/users/avaq', headers: {'User-Agent': 'Avaq'}}) -
Avaq revised this gist
Sep 22, 2016 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ 'use strict'; const request = require('./src/util/request'); const {encase} = require('fluture'); request({url: 'https://api.github.com/users/avaq', headers: {'User-Agent': 'Avaq'}}) .map(res => res.body) .chain(encase(JSON.parse)) .map(user => user.name) .fork(console.error, console.log); -
Avaq created this gist
Sep 22, 2016 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ 'use strict'; const request = require('request'); const Future = require('fluture'); module.exports = o => Future((l, r) => { const socket = request(o, (err, res) => err ? l(err) : r(res)); return () => socket.abort(); });