[Discussion] Change Griddle's internal store name
See original GitHub issueWe should consider changing the Griddle store name to be ‘griddle’ (as a default – this name should be a prop) instead of using the default ‘store’. This store is for griddle’s internal state management but causes trouble when people are building custom components and want to connect
to their app’s store. There is a work around right now that I’m using in some of my apps where I build an HoC to pass ‘store’ as a prop to the custom component but this is perhaps not as clear as it could be?
This is a breaking change and should cause a bump in major version if we go this route because anyone that has a custom component / plugin that connects on ‘store’ to get Griddle’s data would have to take action to work with this change.
Issue Analytics
- State:
- Created 6 years ago
- Comments:25 (11 by maintainers)
Top Results From Across the Web
Griddle - Cook up something delicious. - GitHub
Griddle - Cook up something delicious. Griddle is a system of Sass functions and mixins with an accompanying visual grid overlay to help...
Read more >How To Store A Blackstone Griddle in 4 Quick Methods
Storing the Blackstone griddle isn't all that hard. Certain things can change based on your home or yard size, but the basics always...
Read more >Griddle Vs Grill — What's the Difference? How and What to ...
What are the differences between a grill and a griddle? They are important as to how they cook, and what you cook on...
Read more >How to Buy Flat Top Grills & Griddles | Buying Guide - BBQGuys
Things like portability, installation, and refueling are huge considerations in the fuel-type discussion, so let's take a close look at what separates propane ......
Read more >Does anyone like the built in griddle on their gas range top?
I have the dual fuel 6 burners with the griddle between. The finish on the griddle plate peals off after one year and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There are two parts to using the current implementation:
storeKey
for each<Griddle>
instance, or setGriddle.storeKey
globally (c.f. https://github.com/GriddleGriddle/Griddle/pull/751)connect
:<Griddle>
's store:You can see this in action here (note use of
reduxConnect
, imported fromreact-redux
, compared with plain Griddleconnect
for other stories’ custom Griddle components).cc @peroperje @archy-bold
I’m sure you’ll find varying opinions on this, but I would say Redux is supposed to be the sole source of truth for application state, which doesn’t necessarily encompass view state like grid pagination and form inputs. That’s not to say you can’t use Redux for these things, but it’s far from universal.
Though Griddle obviously requires Redux to work, it seems reasonable that it should Just Work™️ when used in an app that doesn’t otherwise use Redux. So requiring
redux-form
-style integration seems a non-starter.More generally, though, important extensibility comes from having a store per instance: plugins are able to modify
initialState
and provide their ownreducers
. I’m not sure how to achieve this plugin pattern with a single store, short of putting per-instance reducers into Redux (which breaks serializability).thank you @dahlbyk !!! importing
connect
fromgriddle-react
fixed my issue