Closed JarrodMFlesch closed 4 years ago
:wave: Hello @JarrodMFlesch , thanks for the contribution. It looks like your branch history is a little messed up, can you rebase just the commits you want us to look at on top of master? Looks like https://github.com/Shopify/storefront-api-examples/pull/108/commits/a66c5406d7e37f94bbd090509f44e6861298c97f is the first commit, but I might be wrong.
This will make it much easier to see what you're trying to accomplish (and also will make it possible for us to eventually merge it in 😄 )
@DrTeePot Yeah what a mess lol. I actually just opened a clean PR here and I am just going to close this one. AH hang on.... I will clean that one up
DISCLAIMER: I am not sure if this would qualify as a separate branch, but I would love to discuss if that is something we want to pursue.
Overview
eslint.rc
and.editorconfig
-- but can be removed.StoreProvider
, where all functions related to the store and apollo mutations will occur.withStoreContext
HOC allowing any component (under a StoreContext Provider) to access pieces of the store, all of the store and to interact with this examples functions exposed. This piece of it could definitely be expanded on if that is of interest (areas like updating customer information).hip
.Reason for PR
I was recently working on a client app, and the cart needed to be interacted with from many different parts of the app. It was so much easier to abstract all of the logic into a provider and access it via the HOC. The current example is perfect for a simple dedicated store, but makes it a little difficult to migrate into an existing project without some major refactoring, especially given my teams linter and the current state of react in 2020.
Real Goal
I would like to help make everyone's dev life easier.