Releases: SwiftedMind/Processed
Releases · SwiftedMind/Processed
2.2.0
2.1.0
2.0.1
Fixed
- Fixed a small bug that would return an Optional
LoadableState<Value>
when using themap
function. It does not need to be Optional
2.0.0
New
- 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
Changed
- Renamed generic process type
ProcessID
toProcessKind
to better communicate its purpose. This should not affect your code at all.
Fixed
- 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.
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.
1.0.0
Update README.md
0.6.2
Add more missing documentation
0.6.1
Fix documentation
0.6.0
Refactor internals and add missing documentation
0.5.3
Fix commit messages
0.5.2
- Restrict
@Loadable
and@Process
to@MainActor
They are only ever going to be used from SwiftUI Views, so this makes the code a lot more convenient. Also, it's easy to await a Task.detached if needed