Bahn-X / swift-composable-navigator

An open source library for building deep-linkable SwiftUI applications with composition, testing and ergonomics in mind
MIT License
581 stars 25 forks source link

Add onDismiss PathBuilder #32

Closed ohitsdaniel closed 3 years ago

ohitsdaniel commented 3 years ago

Resolves #18.

Problem

Currently, there is no way to a set a detail state to nil when a screen is dismissed.

Solution

This PR adds the higher order .onDismiss path builder which keeps track of the screen it last built and whenever the built screen changes, performs an action, either passing or ignoring the previously built screen.