optimizely / swift-sdk

Swift SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
https://www.optimizely.com/products/full-stack/
Apache License 2.0
21 stars 28 forks source link

[ENHANCEMENT] Async-await start to return result #553

Open MoridinBG opened 1 month ago

MoridinBG commented 1 month ago

Description

Currently the async-await start implementation is a wrapper for the asynchronous completion handler start function. It resumes when the data file is downloaded, but discards the file data. A simple change would be to make start return Data and replace

case .success:
    continuation.resume()

with

case .success(let datafile):
    continuation.resume(returning: datafile)

Benefits

This will simplify SDK usage in modern Swift code

Detail

No response

Examples

No response

Risks/Downsides

No response

muzahidul-opti commented 1 month ago

@MoridinBG thanks for your feedback. We will review it.