Open Bug 1773461 Opened 2 years ago Updated 2 years ago

Consistent pattern for actions that use the `connector` layer

Categories

(DevTools :: Netmonitor, task, P3)

task

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

  1. Using the middleware and passing the connector
    https://searchfox.org/mozilla-central/rev/ace2c59e6c56b2dcba25af1aa8903a5e7f9a5857/devtools/client/netmonitor/src/middleware/recording.js#22,31,33

  2. Passing the connector to the action
    https://searchfox.org/mozilla-central/rev/ace2c59e6c56b2dcba25af1aa8903a5e7f9a5857/devtools/client/netmonitor/src/actions/requests.js#87,101,127

  3. 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

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.