Commit Graph

78 Commits

Author SHA1 Message Date
Brandon Williams
af3eed801a Move send(_:animation:) to ViewStore.swift. (#1075) 2022-05-02 17:44:45 -07:00
Thomas Grapperon
85050a28a9 Fix WithViewStore issues with Views using escaping closures (#1015)
* Use a new instance of `ViewStore` in `WithViewStore`'s `body`

* Use explicit `self` for style coherence

* Remove `viewCancellable` additional reference in `newInstance()`

* Revert "Remove `viewCancellable` additional reference in `newInstance()`"

This reverts commit cb6a22ae4f.

* Change `viewCancellable` capture list

* Update `GeometryReader`'s workarounds
2022-03-11 15:23:42 -05:00
Stephen Celis
ff41e51a4e Limit async/await to Swift 5.5.2 (Xcode 13.2) (#923) 2021-12-16 16:32:02 -05:00
stephencelis
b85fb40057 Run swift-format 2021-12-13 19:12:18 +00:00
Stephen Celis
23155a04fe Support concurrency backdeployment (#916) 2021-12-13 14:03:15 -05:00
iampatbrown
46d0ca40fb ObservedViewStore for projectedBindings (#770)
* Added observedSelf property to ViewStore

* Created ObservedViewStore

* Try projectedBinding first for ViewStore bindings

* Replaced @ObservedObject with @ObservedViewStore

* Revert "Replaced @ObservedObject with @ObservedViewStore"

This reverts commit 6aadf373db.

* Revert "Try projectedBinding first for ViewStore bindings"

This reverts commit 0e2fae1cbf.

* Revert "Created ObservedViewStore"

This reverts commit 7f99a718b9.

* Revert "Added observedSelf property to ViewStore"

This reverts commit 65dc3837b3.

* Replaced self.binding with projectedValue

* Revert "Replaced self.binding with projectedValue"

This reverts commit cc2b69777e.

* Derive bindings using WrappedState helper

* wip

* wip

* wip

* avoid potential retain cycle

* Revert "Derive bindings using WrappedState helper"

This reverts commit f3fb18f445.

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2021-09-20 10:13:16 -04:00
iampatbrown
4b8db86edb Alternative to CurrentValueSubject in ViewStore (#755)
* Replaced CurrentValueSubject with CurrentValueRelay

* Added final to DemandBuffer

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2021-09-17 16:33:13 -04:00
Brandon Williams
33279f4c38 Update to thread warnings. (#773)
* Update to thread warnings.

* fix tests

* clean up

* rename variable
2021-09-07 11:56:46 -04:00
Brandon Williams
a38e04da7d Modernize some things (#713)
* Modernize some things.

* clean up

* wip

* wip

* clean up

* wip

* wip
2021-08-12 18:13:40 -04:00
Brandon Williams
bf3fc47ee8 Add some docs about ViewStore publisher. (#699)
* Add some docs about ViewStore publisher.

* clean up
2021-08-06 12:20:43 -04:00
Stephen Celis
b6ce7143cc Clarify view store thread safety (#692)
* Update ViewStore.swift

* Update ViewStore.swift

* wip

* Update ViewStore.swift
2021-08-02 11:36:28 -04:00
Stephen Celis
adb1f25ab4 Store publisher should retain its view store (#652)
* Make the StorePublisher own the ViewStore.

* cleanup

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2021-07-12 13:25:27 -04:00
iampatbrown
5ca2b43bc7 Added multicast to ViewStore publisher to reduce equality checks (#624)
* Added multicast to ViewStore publisher to reduce equality checks

* Replaced multicast with ViewStore CurrentValueSubject

* Added guard check to weak self

* Clean up and add test.

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2021-07-08 12:53:30 -04:00
stephencelis
7bdd351a07 Run swift-format 2021-07-08 15:21:45 +00:00
Stephen Celis
e4225bee93 Add test for view store state access (#642) 2021-07-08 11:14:34 -04:00
Maxim Krouk
b3cf8209ba Change ViewStore state update behavior (#634)
* fix: change ViewStore state behavior

ViewStore now takes state directly from the Store

* Run swift-format

Co-authored-by: maximkrouk <maximkrouk@users.noreply.github.com>
2021-07-08 10:53:02 -04:00
Stephen Celis
e7e222f1ff Store.scope/StorePublisher Performance Improvements (#616)
* Scope fix

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* revert

* wip

* wip

* wip

* fix

* wip

* wip

* wip

* wip

* wip

* wip

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2021-06-27 21:30:43 -04:00
Brandon Williams
9716a3247a Improve some docs. (#597)
* Improve some docs.

* wip

* Update Sources/ComposableArchitecture/Store.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/Store.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/Store.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/Store.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/Store.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/Store.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* Update Sources/ComposableArchitecture/ViewStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>

* 110 column

* update link

* add docc to switchstore

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2021-06-15 10:33:52 -04:00
Wendy Liga
1a8bccc62e Support DocC Xcode 13 (#591)
* wip

* finish

* revert back code snippet identation to 5

* Update Sources/ComposableArchitecture/Effect.swift

Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>

Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
2021-06-14 14:10:08 -04:00
Krzysztof Siejkowski
1d1ce31471 Convenience initialised for stateless ViewStore (#349) 2021-03-19 11:48:55 -04:00
Nick Sillik
3ab944e6aa Explicitly define objectWillChange on ViewStore. (#353)
* Explicitly define `objectWillChange` on `ViewStore`.

Because the `ViewStore` no longer uses `@Published` variables, the
conformance to `ObservableObject` no longer sythesizes the
`objectWillChange` property on `ViewStore` in iOS 13.0 or 13.1.

This caused `ViewStore` changes to not propagate, leading to views never
updating on these OS versions. This fixes issues #334 and (the already
closed) #238.

* Apply suggestions from code review

* Update Sources/ComposableArchitecture/ViewStore.swift

Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
2021-01-18 17:09:44 -05:00
Stephen Celis
2b8fb04782 Fix Binding animations (#338) 2021-01-08 14:08:39 -05:00
Brandon Williams
c1f88bd860 Fix docs for ViewStore.binding overload. (#321)
* Fix docs for ViewStore.binding overload.

* wip

* Update Sources/ComposableArchitecture/ViewStore.swift

Co-authored-by: Stephen Celis <stephen@stephencelis.com>
2020-11-15 17:38:43 -05:00
Stephen Celis
13cb3c3165 Update CI to include Xcode 12 (#266)
* Update CI to include Xcode 12

* Use CurrentValueSubject
2020-08-27 12:23:12 -04:00
Stephen Celis
e75904c180 Store can use @Published again (#239)
* Store can use @Published again

As of the third beta, assign(to:) takes an `inout Publisher.Publisher`,
so it no longer surfaces an escape hatch through which one could mutate
a store's state.

Fixes #238.

* Fix tests.

* Update ci.yml
2020-07-29 13:48:57 -04:00
Stephen Celis
a8a7c40029 Xcode 11.6/12 CI (#206)
* Run CI against Xcode 12

* Also run against 11.6

* CurrentValueSubject

* Fix

* Update ci.yml
2020-07-07 11:09:51 -04:00
Stephen Celis
2ce84cce79 Don't use @Published for ViewStore state (#199)
* Don't use @Published for ViewStore state

* Update ci.yml

* Update format.yml
2020-06-25 12:51:02 -04:00
Danny Hertz
fc42693ac3 Move ViewStore into root ComposableArchitecture directory (#189) 2020-06-18 07:07:33 -05:00