タグ

2019年6月15日のブックマーク (2件)

  • React+Reduxアプリのオレオレフォルダ構成 | Web Frontend Blog フロントエンド専門の開発会社

    投稿者:K 投稿公開日:2018年11月29日 投稿カテゴリー:フロントエンド 投稿コメント:0件のコメント React + Reduxで作るアプリケーションをいくつか作っていて、フォルダ構成に悩みました。 調べてみると、以下の方法にしてる人が多いみたいです。 A: コンポーネントやコンテナなどのフォルダ分けする B: ドメイン単位で分ける 私がしっくり来たのはドメインで分ける方法です。 以下のURL構造のSPAのフォルダ構成を例にします。 https://example.com/posts https://example.com/post/:id https://example.com/posts/new パターンAのフォルダ構成は以下になります。 /components - Posts.tsx - Post.tsx - NewPost.tsx /containers - Post.ts

    anton072
    anton072 2019/06/15
    “フォルダ内のファイルが増えるとcomponentとcontaienrのセット見つけるのがめんどうになります。”
  • Basic Reducer Structure · Redux

    Basic Reducer Structure​ First and foremost, it's important to understand that your entire application really only has one single reducer function: the function that you've passed into createStore as the first argument. That one single reducer function ultimately needs to do several things: The first time the reducer is called, the state value will be undefined. The reducer needs to handle this ca

    Basic Reducer Structure · Redux
    anton072
    anton072 2019/06/15
    “Basic Reducer Structure and State Shape ”