Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

refresh() instance method on PromiseState

オープン
#182 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, react
領域
api, frontend

調査の方向性

docs/api.md の PromiseState セクションから始め、ドキュメントに記載されている静的な refresh() メソッドと、この issue に示されている手動の refresh パターンを比較します。既存の PromiseState の実装と、存在する場合はそのテストを追跡し、インスタンスメソッドがどのように動作すべきかを判断します。props.userFetch.refresh() が要求された refresh の動作を提供し、PromiseState のドキュメントとテストでそれがカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

I'm new to the library but i've been using the manual refresh pattern from the readme a lot because each of my screens have a refresh button.

connect(props => {
 const url = `/users/${props.userId}`

 return {
   userFetch: url,
   refreshUser: () => ({
     userFetch: {
       url,
       force: true,
       refreshing: true
     }
   })
 }
})(Profile)

Reading through the documentation for PromiseState i noticed that there is a refresh() static method but not an instance method. I think adding it as an instance method would be hugely helpful to a lot of people. It would reduce the above to:

connect(props => ({
   userFetch: `/users/${props.userId}`,
 })(Profile)

and then call the refresh using props.userFetch.refresh()

Am i missing something? It doesn't look like anyone has mentioned it before, do they just write the extra code?

主要言語
JavaScript
スター
3.4k
フォーク
137
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

heroku/react-refetch のほかの issue

heroku/react-refetch の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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