2015-08-10から1日間の記事一覧

bluebird の using の使い方

bluebirdにはusingというAPIがある。 https://github.com/petkaantonov/bluebird/blob/master/API.md#promiseusingpromisedisposer-promise-promisedisposer-promise--function-handler---promiseこれはファイルオープン、DB接続の管理などのリソース管理に…

node + bluebird + typescript で spread, finally を利用したら undefined is not a function

タイトルの通り、bluebird の spread, finally を利用すると、 undefined is not a function が発生してしまった。しかも、特定のケースのみ発生する。原因はTypeScriptの import のミスだった。今回の実装では以下のように bluebird を読み込んでるけど・・…