Skip to content

Commit

Permalink
Renaming StoreEvent.initial to initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
mergesort committed Oct 31, 2024
1 parent 337704c commit cbd86f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Demo/Demo/App/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private extension ContentView {
for await event in self.imagesController.$images.events {
switch event.operation {

case .initial:
case .initialized:
print("[Store Event: initial] Our Images Store has initialized")

case .loaded:
Expand Down
4 changes: 2 additions & 2 deletions Sources/Boutique/StoreEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ public struct StoreEvent<Item: StorableItem>: StorableItem {
public let items: [Item]

public enum Operation: StorableItem {
case initial, loaded, insert, remove
case initialized, loaded, insert, remove
}
}

internal extension StoreEvent {
static var initial: StoreEvent<Item> {
StoreEvent(operation: .initial, items: [])
StoreEvent(operation: .initialized, items: [])
}

static func loaded(_ items: [Item]) -> StoreEvent<Item> {
Expand Down
2 changes: 1 addition & 1 deletion Tests/BoutiqueTests/StoreEvent.Tests.Requirements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Testing
extension Store {
func validateStoreEvent(event: StoreEvent<BoutiqueItem>) throws {
if self.items.isEmpty {
try #require(event.operation == .initial || event.operation == .loaded || event.operation == .remove)
try #require(event.operation == .initialized || event.operation == .loaded || event.operation == .remove)
} else {
try #require(event.operation == .insert)
}
Expand Down

0 comments on commit cbd86f0

Please sign in to comment.