Fix circular dependency in `shared` and `store` modules
The following discussion from !4 (merged) should be addressed:
-
@pslaughter started a discussion: suggestion:
hasStorageSupport
was previously a nice pure function with no side effects. It's probably better to throw this side effect intouseGracefulStorage
(or some other caller).issue: There's now a cyclic dependency between
store/state
andstore/storage_utils
. Cyclic dependencies are not only hard to follow, but also open up a world of hard to detect bugs (for instance ifsetUsingGracefulStorageFlag
used `localStorage).IMO a
util
module shouldn't be dependent on our application specificstore
. What if this module simply returned a value for the store to consume and initialize it's state with?This is not a big issue, so let's resolve it in a follow up MR.