Skip to content

Commit

Permalink
Test more types in demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziodemaria committed Apr 15, 2024
1 parent bee8208 commit 527e55b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
27 changes: 24 additions & 3 deletions ConfidenceDemoApp/ConfidenceDemoApp/ConfidenceDemoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,30 @@ extension ConfidenceDemoApp {
structure: MutableStructure.init(attributes: ["country": .string("SE")]))
Task {
await OpenFeatureAPI.shared.setProviderAndWait(provider: provider, initialContext: ctx)
confidence.send(
definition: "abcd",
payload: ["my_key": ConfidenceValue(string: "hello_from_world")])
}
confidence.send(
definition: "all-types",
payload: [
"my_string": ConfidenceValue(string: "hello_from_world"),
"my_timestamp": ConfidenceValue(timestamp: Date()),
"my_bool": ConfidenceValue(boolean: true),
"my_date": ConfidenceValue(date: DateComponents(year: 2024, month: 4, day: 3)),
"my_int": ConfidenceValue(integer: 2),
"my_double": ConfidenceValue(double: 3.14),
"my_list": ConfidenceValue(booleanList: [true, false]),
"my_struct": ConfidenceValue(structure: [
"my_nested_struct" : ConfidenceValue(structure: [

Check warning on line 54 in ConfidenceDemoApp/ConfidenceDemoApp/ConfidenceDemoApp.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Colon Spacing Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals (colon)
"my_nested_nested_struct": ConfidenceValue(structure: [
"my_nested_nested_nested_int": ConfidenceValue(integer: 666)
]),
"my_nested_nested_list": ConfidenceValue(dateList: [
DateComponents(year: 2024, month: 4, day: 4),
DateComponents(year: 2024, month: 4, day: 5)
])
]),
"my_nested_string": ConfidenceValue(string: "nested_hello")
])
]
)
}
}
2 changes: 1 addition & 1 deletion Sources/Confidence/Confidence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ extension Confidence {
clientSecret: clientSecret,
uploader: uploader,
storage: eventStorage,
flushPolicies: [SizeFlushPolicy(batchSize: 5)])
flushPolicies: [SizeFlushPolicy(batchSize: 1)])
return Confidence(
clientSecret: clientSecret,
timeout: timeout,
Expand Down

0 comments on commit 527e55b

Please sign in to comment.