amatiasq / amatiasq/promise

Create "Complete" promise implementation

オープン
#4 コメント 0 件 リアクション 0 件 担当者 0 名 @amatiasq が担当を希望しています GitHub で見る
enhancement main-feature
主要言語
JavaScript
スター
4
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

説明

It will be useful to have sugar syntax methods to modify the promise value:
- _get(key)_: Will return a new promise who will be fulfilled extracting `[key]` from the original promise's value. Same as `.then(function(value) { return value[key]; })`
- _set(key, obj)_: Will modify promise's value setting `key` property. Same as `.then(function(value) { value[key] = obj; return value });`
- _method(name, args)_: Will invoke promise's value `name` method and fulfill the returned promise with method's return value. Same as `.then(function(value) { return value[method].apply(value, args); });`
- _invoke(args)_: Will invoke the value passing `args` as it's arguments, the returned value will be used to fulfill the new promise. Same as `.then(function(value) { return value.apply(null, args) };`
- _flat()_: If the promise value is an multi-dimension array it will reduce it to a one-dimension array.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。