Skip to content

Commit

Permalink
0.34.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dankinsoid committed Mar 19, 2024
1 parent b7e3752 commit aeb92d3
Show file tree
Hide file tree
Showing 17 changed files with 537 additions and 214 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Package.resolved~main_0
.build
.idea
**/.DS_Store
*.xcuserstate
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Examples/Todos/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Todos

This simple todo application built with the Composable Architecture includes a few bells and whistles:
This simple todo application built with the VDStore includes a few bells and whistles:

* Filtering and rearranging todo items.
* Automatically sort completed todos to the bottom of the list.
Expand Down
2 changes: 2 additions & 0 deletions Examples/Todos/Todos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_TESTING_SEARCH_PATHS = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -361,6 +362,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTING_SEARCH_PATHS = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
Binary file not shown.
17 changes: 12 additions & 5 deletions Examples/Todos/Todos/Todos.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ extension Store<Todos> {
}
}

extension Store<Todo> {

var updateOnCompleted: Store<Todo> {
onChange(of: \.isComplete) { _, _, _ in
Task {
try await di.store(for: Todos.self)?.todoIsCompletedChanged()
}
}
}
}

struct AppView: View {

@ViewStore var todos: Todos
Expand All @@ -90,11 +101,7 @@ struct AppView: View {
List {
ForEach(todos.filteredTodos) { todo in
TodoView(
store: $todos.todos[id: todo.id].or(todo).onChange(of: \.isComplete) { _, _, _ in
Task {
try await $todos.todoIsCompletedChanged()
}
}
store: $todos.todos[id: todo.id].or(todo).updateOnCompleted
)
}
.onDelete { $todos.delete(indexSet: $0) }
Expand Down
Loading

0 comments on commit aeb92d3

Please sign in to comment.