Skip to content

Conversation

rrbox
Copy link
Owner

@rrbox rrbox commented Sep 27, 2025

Description

  • Add feature flags

Usage

struct FeatureFlags: OptionSet {
    let rawValue: UInt8

    static let newFeatureFlag: FeatureFlags = .init(rawValue: 1 << 0)

    static let enabled: FeatureFlags = [
        .newFeatureFlag
    ]

    func isEnabled(_ flags: FeatureFlags) -> Bool {
        Self.enabled.contains(flags)
    }
}
if FeatureFlags.isEnabled(.newFeatureFlag) {
    // your new feature logic here
}

@rrbox rrbox self-assigned this Sep 27, 2025
@rrbox rrbox added this to the v0.4 milestone Sep 27, 2025
@rrbox rrbox merged commit 2654f7d into develop Sep 27, 2025
2 checks passed
@rrbox rrbox deleted the feat/feature_flags branch September 27, 2025 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant