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.
- In the closures passed to the methods of
ProcessSupport
andLoadableSupport
, you now don't need to provide explicitself
anymore, since those closures are simply passed into aTask
, so reference cycles are no real concern - Added concept of "interrupts" for both
@Loadable
and@Process
(as well as their protocol counterparts) - The closures passed to the
run
methods of theProcessSupport
protocol 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
@Loadable
and@Process
that give access to a SwiftUI binding to the underlyingLoadableState
andProcessState
:$process.binding
and$loadable.binding
. - Added
@TaskIdentifier
property wrapper, which is a convenience wrapper around aUUID
SwiftUI 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 Interrupts
andFailure Alert Process
- Added error types
ResetProcess
andResetLoadable
that can be thrown to reset a process or loadable - Added typealias
typealias SingleProcessState = ProcessState<SingleProcess>
for convenience
- Renamed generic process type
ProcessID
toProcessKind
to better communicate its purpose. This should not affect your code at all.
- Removed redundancies in the
ProcessSupport
protocol code to simplify implementation - Fixed incorrect
CancelProcess
andCancelLoadable
error behavior inProcessSupport
andLoadableSupport
; they used to perform a reset instead of a cancel - Added a missing
Task
priority
argument in an overload of theProcess.run
method - Fixed a few typos in the documentation.
Initial release