Home Using web worker inside redux selector
Reply: 0

Using web worker inside redux selector

user647
1#
user647 Published in May 25, 2018, 6:27 pm

I have a state which contains some data, that I currently compute synchronously in a selector using reselect library.

Since this is heavy computation, I thought about doing it in a web worker. Problem is the selector will then return an asynchronous result

Do you know how do handle this ?

The best solution would be that once the worker has finished the job, to somehow return the value to the component and cache the result in the selector. But I am puzzled as to how to call the component asynchronously using mapStateToProps (without modifying the global state in the store)

Any idea ? Thanks,

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.307609 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO