popcodeorg / popcodeorg/popcode

Implement reducers with handleActions

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

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

code quality
主要言語
JavaScript
スター
191
フォーク
143
平均マージ
4日 11時間
マージ済み PR(30日)
5

説明

Currently most of our reducers are implemented as a big switch statement, which is unwieldy and hard to read. Instead, use the handleActions() helper in redux-actions to implement the reducer as a map of action names to reducer functions.

We should follow the pattern of using the action creator function itself as the map key, allowing us to avoid hard-coding string literals containing the action name.

See the console reducer for an example of the desired implementation.

Testing

Since our goal here is merely to refactor the reducers, not change their behavior, all existing tests should pass after a reducer is refactored.

However, it might make sense to also port the reducer test to Jest after completing the refactor and confirming that the old tests pass with the new reducer implementation (this should be in separate commits).

Reducers to migrate
  • clients
  • compiledProjects
  • console
  • currentProject
  • errors
  • googleClassroom
  • index
  • projects
  • resizableFlex
  • ui
  • user

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

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

はじめの一歩

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

調査の方向性

src/reducers/console.js にある完成済みの例から始め、次に未確認の clients、compiledProjects、currentProject、errors、googleClassroom、index、projects、user の各 reducer を見つけます。動作を維持したまま redux-actions を使ってリファクタリングし、既存のすべてのテストを実行して引き続きパスすることを確認します。Jest テストの移行は別の変更として行います。

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

評価

技術スタック
javascript, redux
領域
frontend
issue の種類
リファクタリング
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

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

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