Create "Complete" promise implementation
- 主要言語
- 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 はまだ評価されていません。