nubank / nuvigator

A powerful routing abstraction over Flutter Navigator, with nested Navigator and Deeplinks
Apache License 2.0
277 stars 33 forks source link

Removing observer duplicated #115

Closed wesleyjesus-dev closed 1 month ago

wesleyjesus-dev commented 3 months ago

What?

It was identified that for root navigation, when there is an observer that must be inherited, and it has already been registered in the observer property, it is registered twice. We need to ensure that there is only one observer record per navigation.

How?

A function has been implemented that only allows you to register an observer if it does not exist.

This function has O(n) complexity and guarantees efficiency regardless of the number of observers.