createOrUpdate

abstract suspend fun createOrUpdate(feature: Feature)(source)

Create or update a feature (upsert operation).

If the feature exists, it will be updated. If it doesn't exist, it will be created. This is useful when you don't know whether the feature already exists in the store.

Implementations should ensure this operation is atomic to prevent race conditions.

Example:

store.createOrUpdate(Feature("my-feature", isEnabled = true))

Parameters

feature

Feature to create or update