createThreadSafeStore(reducer, preloadedState, enhancer)
Creates a Redux store that is may be accessed from any thread.
This is the recommended way to create a store.
There is some performance overhead in using
createThreadSafeStore() due to
synchronization, however it is small and mostly likely not impact UI.
Some quick benchmarks on an Android app have shown that:
getStatewas always < 1ms with or without synchronization
dispatchcalls to 1-3ms longer with synchronization
- During a cold launch of app differences were more dramatic. Some calls to
dispatchtook +100ms more than an store that was not synchronized.
createStore() for usage.