Skip to content
This repository was archived by the owner on Dec 15, 2018. It is now read-only.
This repository was archived by the owner on Dec 15, 2018. It is now read-only.

persistQuery option doesn't work #172

@jakewisse

Description

@jakewisse

It looks like the persistQuery option was first implemented in the Link component through referencing the existing state in the Redux store, but then later it was copied over to the reducer. However, I don't know how this was supposed to work since the middleware will call the history lib's push() function with the given search (updating the URL with the new query [empty or otherwise], wiping out the previous one), way before the data flow reaches the reducer.

It seems to me that the only way to resolve this for all possible implementations of the history API is to produce the actions module in install() which has the desired history impl. injected into it. Then, we could do the query merging1 up front by referencing the state in history.state.

--
1: FWIW, when working on this it wasn't clear to me in the README whether persistQuery would merge the two queries (see #132), or if it would simply not throw away the previous one if not specifying a pathname.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions