3.0.2 • Published 7 years ago

poss v3.0.2

Weekly downloads
25
License
-
Repository
github
Last release
7 years ago

poss

"This poss might work..."

Slightly better-looking error handling for generators and async/await.

Instead of this:

try {
  var resource = await fetch(token)
} catch (err) {
  // do something with the error
}
// do something with the resource

You can do this:

const [err, resource] = await poss(fetch(token))
if (err !== null) {
  // do something with the error
}

// do something with the resource

Installation

npm install poss

License

MIT

3.0.2

7 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago