2.0.0
New
- In the closures passed to the methods of
ProcessSupportandLoadableSupport, you now don't need to provide explicitselfanymore, since those closures are simply passed into aTask, so reference cycles are no real concern - Added concept of "interrupts" for both
@Loadableand@Process(as well as their protocol counterparts) - The closures passed to the
runmethods of theProcessSupportprotocol are now isolated to theMainActor - Added new method
LoadableState<Value>.map(transform:)to allow convenient mapping of loadable values. - Added new properties to the projected values of
@Loadableand@Processthat give access to a SwiftUI binding to the underlyingLoadableStateandProcessState:$process.bindingand$loadable.binding. - Added
@TaskIdentifierproperty wrapper, which is a convenience wrapper around aUUIDSwiftUI state that helps with task restarts, e.g..task(id: taskIdentifier) { ... } - Reworked the demo app and fixed a few bugs and issues
- The demo app now has more examples:
Restartable Loadable,Refreshable Loadable,Process Interrrupts,Loadable InterruptsandFailure Alert Process - Added error types
ResetProcessandResetLoadablethat can be thrown to reset a process or loadable - Added typealias
typealias SingleProcessState = ProcessState<SingleProcess>for convenience
Changed
- Renamed generic process type
ProcessIDtoProcessKindto better communicate its purpose. This should not affect your code at all.
Fixed
- Removed redundancies in the
ProcessSupportprotocol code to simplify implementation - Fixed incorrect
CancelProcessandCancelLoadableerror behavior inProcessSupportandLoadableSupport; they used to perform a reset instead of a cancel - Added a missing
Taskpriorityargument in an overload of theProcess.runmethod - Fixed a few typos in the documentation.
Warning
This is a release that introduces breaking changes, due to a few unfortunate bugs in 1.0.0. The migration process should not be complicated, though. You can read more about it in the migration guide.