nubank / nuvigator

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

Removing observer duplicated #115

Closed wesleyjesus-dev closed 2 weeks ago

wesleyjesus-dev commented 2 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.