Skip to content

[Bug]: ObservableMixin requires full initialization #4360

@Nextra

Description

@Nextra

Describe the bug 🐞

In #4257 ObservableMixins.cs had a static constructor added, which enforces ReactiveUI to be fully initialized. This leads to innocuous helpers like ObservableMixins.WhereNotNull to suddenly break if used before RxAppBuilder.BuildApp is called.

As far as I can tell none of the helpers in ObservableMixins require initialization, but I am not sure if other Mixins (especially those in platform-specific modules) are affected.

Step to reproduce

  1. Use ObservableMixins.WhereNotNull before ReactiveUI initialization
  2. Exception is thrown

Reproduction repository

No response

Expected behavior

Mixins that provide functionality not tied to ReactiveUI features should not require app initialization.

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

No response

Version

No response

Device

No response

ReactiveUI Version

23.2.27

Additional information ℹ️

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions