Consistent pattern for actions that use the `connector` layer
Categories
(DevTools :: Netmonitor, task, P3)
Tracking
(Not tracked)
People
(Reporter: bomsy, Unassigned)
References
(Blocks 1 open bug)
Details
We use different patterns for handling actions which have to call the connector
-
Using the middleware and passing the
connector
https://searchfox.org/mozilla-central/rev/ace2c59e6c56b2dcba25af1aa8903a5e7f9a5857/devtools/client/netmonitor/src/middleware/recording.js#22,31,33 -
Passing the
connector
to the action
https://searchfox.org/mozilla-central/rev/ace2c59e6c56b2dcba25af1aa8903a5e7f9a5857/devtools/client/netmonitor/src/actions/requests.js#87,101,127 -
Using the
connector
which is available as an argument to any async thunk functions created for the actions
https://searchfox.org/mozilla-central/rev/ace2c59e6c56b2dcba25af1aa8903a5e7f9a5857/devtools/client/netmonitor/src/actions/request-blocking.js#88,92
We should be consistently use a specific pattern which aligns best with the react/redux flow.
I'm in favour of the 3rd option as we do not need the middleware for simple actions calls, and no need to always pass the connector
as an argument
Updated•2 years ago
|
Description
•