Open schwartzmj opened 4 years ago
So there is useClientUnsafe
, which is a hook that lets you access the buy client (https://gatsbythemeshopifymanager.com/#useclientunsafe). Are you thinking of doing something different than that?
It’s called useClientUnsafe
so that the user knows that it falls outside the “normal” scope of the plugin.
I think that's exactly what I'm looking for and it is also a good name for it 😅. Thanks!
If you think it's a good idea, maybe they could be added within the initial listing of the hooks in the docs in their own small subsection? Definitely my fault for overlooking them but I think it could help when referencing the docs.
That's not a bad idea. Maybe after the 'main' list, there is a blurb that is something like:
In addition to these hooks, there are two more experimental hooks: ...
Still working on the wording with that. What do you think?
Just getting the links down the page is sufficient. If while in there it'd be a good idea to update the plug-in settings to make it clear false
is not the // default
for the two plug-in specific options.
What are your thoughts on exposing the ShopifyBuy client via a simple useClient hook? It could look very similar to the current useCart hook.
I think it would be nice to be able to have quick access to certain things like
client.product.helpers.variantForOptions
(link) which helps you convert a selection of options into a Shopify Variant ID.I think this could give us an easy hook into more advanced functionality when needed, while still keeping gatsby-theme-shopify simple and tidy in scope.