Skip to content

Commit

Permalink
Merge pull request #14 from danimal141/chore/release
Browse files Browse the repository at this point in the history
Chore/release
  • Loading branch information
hiroara committed Jul 20, 2018
2 parents f11cd12 + 246a07d commit 5983d84
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2018-07-20
### Added
- Define error classes and improve error handling.
- Allow timeouts greater than 25s when recognising images.
- Support `publicAPIKey`.

## [0.1.0] - 2017-12-08
### Added
- Initial release.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scnnr",
"version": "0.1.0",
"version": "1.0.0",
"description": "Official #CBK scnnr client library for JavaScript",
"main": "dist/scnnr.umd.js",
"module": "dist/scnnr.esm.js",
Expand Down
5 changes: 2 additions & 3 deletions src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ function buildMessage(title, detail, type) {
if (title) {
message = `[${title}]`
}

if (detail) {
message = `${message} ${detail}`
}

if (type) {
message = `${message} (${type})`
}


return message
}
Expand Down
12 changes: 6 additions & 6 deletions src/polling.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ function poll(config) {
if (conditionChecker(result)) {
return resolve(result)
}

const newRemainingTime = remainingTime - timeout

const newConfig = {
requestFunc,
conditionChecker,
remainingTime: newRemainingTime,
const newConfig = {
requestFunc,
conditionChecker,
remainingTime: newRemainingTime,
}

return resolve(poll.call(this, newConfig))
})
})
Expand Down

0 comments on commit 5983d84

Please sign in to comment.