forked from infinitered/apisauce
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): Removes ramda.js (infinitered#281 by @jamonholmgren)
- Loading branch information
1 parent
3c66fdc
commit 638df8b
Showing
7 changed files
with
97 additions
and
134 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 characters
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 characters
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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,27 @@ | ||
import apisauce from '../lib/apisauce' | ||
import R from 'ramda' | ||
import RS from 'ramdasauce' | ||
const apisauce = require('../dist/apisauce.js') | ||
|
||
const REPO = 'skellock/apisauce' | ||
const REPO = 'infinitered/apisauce' | ||
|
||
const api = apisauce.create({ | ||
baseURL: 'https://api.github.com', | ||
headers: { | ||
Accept: 'application/vnd.github.v3+json' | ||
} | ||
Accept: 'application/vnd.github.v3+json', | ||
}, | ||
}) | ||
|
||
// attach a monitor that fires with each request | ||
api.addMonitor( | ||
R.pipe( | ||
RS.dotPath('headers.x-ratelimit-remaining'), | ||
R.concat('Calls remaining this hour: '), | ||
console.log | ||
) | ||
) | ||
api.addMonitor(response => { | ||
const info = `Calls remaining this hour: ${response.headers['x-ratelimit-remaining']}` | ||
console.log(info) | ||
}) | ||
|
||
// show the latest commit message | ||
api | ||
.get(`/repos/${REPO}/commits`) | ||
.then(RS.dotPath('data.0.commit.message')) | ||
.then(R.concat('Latest Commit: ')) | ||
.then(console.log) | ||
api.get(`/repos/${REPO}/commits`).then(response => { | ||
const info = `Latest Commit: ${response.data[0].commit.message}` | ||
console.log(info) | ||
}) | ||
|
||
// call a non-existant API to show that the flow is identical! | ||
api | ||
.post('/something/bad') | ||
.then(R.props(['ok', 'status', 'problem'])) | ||
.then(console.log) | ||
api.post('/something/bad').then(({ ok, status, problem }) => { | ||
console.log({ ok, status, problem }) | ||
}) |
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 characters
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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
{ | ||
"version": "2.1.3", | ||
"author": "Steve Kellock <[email protected]>", | ||
"author": { | ||
"name": "Infinite Red", | ||
"email": "[email protected]", | ||
"url": "https://github.com/infinitered/ignite" | ||
}, | ||
"ava": { | ||
"require": [ | ||
"babel-core/register" | ||
] | ||
}, | ||
"dependencies": { | ||
"axios": "^0.21.4", | ||
"ramda": "^0.25.0" | ||
"axios": "^0.21.4" | ||
}, | ||
"description": "Axios + standardized errors + request/response transforms.", | ||
"devDependencies": { | ||
|
@@ -19,14 +22,14 @@ | |
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.3", | ||
"babel-eslint": "^8.2.3", | ||
"babel-plugin-ramda": "^1.6.1", | ||
"babel-preset-es2015": "^6.24.1", | ||
"husky": "^1.3.1", | ||
"lint-staged": "^8.1.0", | ||
"np": "3.0.4", | ||
"npm-run-all": "^4.1.5", | ||
"nyc": "^11.8.0", | ||
"prettier": "^1.15.3", | ||
"ramda": "^0.25.0", | ||
"ramdasauce": "^2.1.0", | ||
"rollup": "^0.59.1", | ||
"rollup-plugin-babel": "^3.0.4", | ||
|
@@ -56,7 +59,7 @@ | |
"name": "apisauce", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/skellock/apisauce.git" | ||
"url": "https://github.com/infinitered/apisauce.git" | ||
}, | ||
"scripts": { | ||
"build": "BABEL_ENV=production rollup -c", | ||
|
@@ -70,7 +73,8 @@ | |
"test:unit": "ava -s", | ||
"ci:publish": "yarn semantic-release", | ||
"semantic-release": "semantic-release", | ||
"format": "prettier --write \"{**/*.ts,.circleci/**/*.js}\" --loglevel error && tslint -p . --fix" | ||
"format": "prettier --write \"{**/*.ts,.circleci/**/*.js}\" --loglevel error && tslint -p . --fix", | ||
"example": "node ./examples/github.js" | ||
}, | ||
"prettier": { | ||
"semi": false, | ||
|
Oops, something went wrong.