Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Get rid of multiple dispatch invocations #663

Closed
voidxnull opened this issue Sep 28, 2016 · 0 comments
Closed

Get rid of multiple dispatch invocations #663

voidxnull opened this issue Sep 28, 2016 · 0 comments

Comments

@voidxnull
Copy link
Member

voidxnull commented Sep 28, 2016

Each time dispatch is invoked redux re-renders the whole application. So what we have now is the index page (/) re-renders itself 8 times causing massive lags on mobile devices.

Examples of problematic code:

https://github.com/Lokiedu/libertysoil-site/blob/stable/src/pages/list.js#L87 (7 dispatches + 1 from App)
https://github.com/Lokiedu/libertysoil-site/blob/stable/src/pages/geotag.js#L70 (4 + 1)

Possible solution:

  1. Use hydrate API methods to optimize the most important pages Create 'hydrate' api methods for each important page #664.
  2. Batch actions where hydration is not feasible: https://github.com/tshelburne/redux-batched-actions (see Batching actions reduxjs/redux#911 (comment))

We should probably start with batching.
I'm not sure if it's possible to solve this issue without ditching triggers in favor of something more integrated with redux (see #667).

@voidxnull voidxnull mentioned this issue Sep 28, 2016
5 tasks
@xekc xekc added the Icebox label Nov 18, 2016
@xekc xekc closed this as completed Nov 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants