Shopify / storefront-api-examples

Example custom storefront applications built on Shopify's Storefront API
https://help.shopify.com/api/storefront-api
MIT License
1.12k stars 329 forks source link

React apollo with context provider #108

Closed JarrodMFlesch closed 4 years ago

JarrodMFlesch commented 4 years ago

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

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.

tristan-potter commented 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 😄 )

JarrodMFlesch commented 4 years ago

@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