This repository has been archived by the owner on Dec 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 386
poc: connectGeoSeach with createConnector #1073
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploy preview for react-instantsearch ready! Built with commit 8d41d23 https://deploy-preview-1073--react-instantsearch.netlify.com |
Haroenv
reviewed
Mar 12, 2018
}; | ||
|
||
onIdle = () => { | ||
const { isRefineOnMapMove } = this.props; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think this needs the is Prefix
samouss
commented
Mar 14, 2018
uiState: initialUiState, | ||
props: this.getProvidedProps({ | ||
...props, | ||
...initialUiState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that, we should not merge that in the props
. We should pass the uiState
as an argument to the connector definition (getProvidedProps
, ...) but at the same time they already have a lots of arguments.
samouss
force-pushed
the
poc/connect-geo-search
branch
from
April 3, 2018 10:39
83c53c1
to
29937a6
Compare
samouss
force-pushed
the
poc/connect-geo-search
branch
from
April 4, 2018 09:06
0eab37d
to
8d41d23
Compare
Closing in favour of #1171. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a POC, it's not intended to be merged.
I played a bit around the connector API in order to handle a "'stateful" instance. This lets us the possibility to implement the UI logic directly in the connector.
initialUiState
: You can define a new property on the connector declaration. This property takes a function that returns the initial UI state for the connector. The function takesprops
as argument.setUiState
: You can access this function in every method of the connector. It's wrapper around thesetState
function that lets you update only theuiState
. It means that now we can trigger new render on the fly to respond to users interactions.It's definitely not a final API, but it can fit pretty easily with the current implementation without rewriting everything. Happy to have your feedback!
You can play with the GeoSearch example on Storybook.
Note: the test are failing it's completely normal.