Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 redux states for fetched entities and shown entities #62

Closed
hyzhak opened this issue Nov 21, 2018 · 2 comments
Closed

2 redux states for fetched entities and shown entities #62

hyzhak opened this issue Nov 21, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@hyzhak
Copy link
Member

hyzhak commented Nov 21, 2018

  • fetched fire evidences (update from wss and fetched directly)
  • shown entities (sort, subset of fetched entities)

because we can fetch a lot of items and in different orders. Even in realtime. But playlist should reflect what actually we show to user.

@hyzhak hyzhak added the enhancement New feature or request label Nov 21, 2018
@hyzhak hyzhak added this to the nov 19 - 25 milestone Nov 21, 2018
@hyzhak hyzhak self-assigned this Nov 23, 2018
@hyzhak
Copy link
Member Author

hyzhak commented Nov 28, 2018

  • use normalized state:
{
  entities: {
    category: {
      1: {},
      2: {},
    },
    somethingElse: {}
  }
}
  • use UI state
{
  entities: {},
  ui: {
    feed: {
      items: [],
      sortBy: 'date'
    }
  }
}
reduceReducers(
  combineReducers({
    entities: combineReducers({
       category1,
       category2
    })
  }),
  uiReducers({
    feeder,
    usersProfile
  })
)

uiReducers - would add global state as 3rd argument. So we be able to use selectors there or (alternative) we should just pass entities state slice and get needed data manually (problem - we may duplicate selectors there)

  • ? How to deal with UI state? Are there any good redux practices?

@hyzhak
Copy link
Member Author

hyzhak commented Dec 12, 2018

I have decided to use redux saga for business logic.
So in sage I process incoming data and split data flow in to groups:

  • entities
  • ui

@hyzhak hyzhak closed this as completed Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant