Reducer Protocol: Dependencies, Part 2

Episode #206 • Sep 26, 2022 • Subscriber-Only

We now have a SwiftUI-inspired system for plucking dependencies out of thin air to provide them to reducers, but we can’t control them or separate interface from implementation. Once we do, we’ll have something far better than ever before.

Dependencies, Part 2
Introduction
00:05
Overriding dependencies
01:13
Override order and performance
16:36
Next time: testing
32:34

Unlock This Episode

Our Free plan includes 1 subscriber-only episode of your choice, plus weekly updates from our newsletter.

Introduction

There’s one last feature of our dependencies that we previously mentioned but haven’t yet implemented. And that’s the ability to override dependencies for a specific reducer. We previously alluded that this can be powerful for overriding dependencies for a child feature in order to alter the environment it operates in, such as onboarding experiences. This is definitely true, and can be incredibly powerful, but we can also see a simpler use case for this functionality in the code we’ve already written.

A moment ago when we were deleting all the initializing code of our reducers to no longer pass in dependencies, we removed the ability to pass special dependencies to the reducer for previews.

Let’s take a look at that.

This episode is for subscribers only.

Subscribe to Point-Free

Access this episode, plus all past and future episodes when you become a subscriber.

See plans and pricing

Already a subscriber? Log in

Downloads