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

fix(async): create new cache object for each instance by default #1241

Merged
merged 1 commit into from
Oct 21, 2016

Conversation

TheSharpieOne
Copy link
Contributor

@TheSharpieOne TheSharpieOne commented Sep 22, 2016

fix #1236
Previously, the same object was being used by for async cache by
default when no cache was passed to the component. This same object
was used for every instance.
Now, an object is used to determine if the default is being used
and will create a new object for each instance in which no prop
was passed.

If the user wants to have shared cache, they will need to opt-in by providing the same object to the component via the cache prop.

fix JedWatson#1236
Previously, the same object was being used by for async cache by
default when no cache was passed to the component. This same object
was used for every instance.
Now, an object is used to determine if the default is being used
and will create a new object for each instance in which no prop
was passed.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 93.023% when pulling ddd1fbc on TheSharpieOne:fix/remove-shared-cache into 2b14448 on JedWatson:master.

@TheSharpieOne
Copy link
Contributor Author

@bvaughn, this is related to a change you made recently with #1226. I'm not sure if the shared cache thing was intentional or not. If it was, you can just close this. If it was not intentional, please take a look and hopefully get this in before rc3 (or v1 if there isn't another rc planned).

@somsub
Copy link

somsub commented Oct 20, 2016

We are having the same issue and need this change above? Is there a timeframe on this being available?

Thank you @TheSharpieOne for fixing this

@Seldaek
Copy link

Seldaek commented Oct 21, 2016

@somsub as a workaround for now you can just specify your own cache on every instance:

var yourCache = {};
<Select.Async [...]
            cache={yourCache}
/>

Just make sure you somehow define that variable smartly enough that you do get a cache still, but not so broadly that the cache is shared across instances.

@bvaughn
Copy link
Collaborator

bvaughn commented Oct 21, 2016

D'oh! Sorry. This fell through the cracks on my end.

@bvaughn bvaughn merged commit ddd1fbc into JedWatson:master Oct 21, 2016
@bvaughn
Copy link
Collaborator

bvaughn commented Oct 21, 2016

Merged with a minor change to move cache prop setting from componentWillMount to the constructor.

@TheSharpieOne TheSharpieOne deleted the fix/remove-shared-cache branch October 21, 2016 13:25
@somsub
Copy link

somsub commented Oct 21, 2016

Thanks for merging @bvaughn. When will this be released for consumption from npm ?

@bvaughn
Copy link
Collaborator

bvaughn commented Oct 21, 2016

Not sure. I'm at Connect Tech right now (presenting) so I won't be making a release any time over the next few days> Jed or someone else might.

@cpruijsen
Copy link

@bvaughn is a release planned? Not having much luck building from sources and requiring locally to use the patched version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Async shared cache (probably not wanted)
6 participants