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 #113

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.

JarrodMFlesch commented 4 years ago

Plz ignore, having quite a day.