Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.0 Release #6

Merged
merged 48 commits into from
Nov 22, 2023
Merged

2.0.0 Release #6

merged 48 commits into from
Nov 22, 2023

Conversation

SwiftedMind
Copy link
Owner

New

  • In the closures passed to the methods of ProcessSupport and LoadableSupport, you now don't need to provide explicit self anymore, since those closures are simply passed into a Task, 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 the ProcessSupport protocol are now isolated to the MainActor
  • 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 underlying LoadableState and ProcessState: $process.binding and $loadable.binding.
  • Added @TaskIdentifier property wrapper, which is a convenience wrapper around a UUID 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 and Failure Alert Process
  • Added error types ResetProcess and ResetLoadable that can be thrown to reset a process or loadable
  • Added typealias typealias SingleProcessState = ProcessState<SingleProcess> for convenience

Changed

  • Renamed generic process type ProcessID to ProcessKind 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 and CancelLoadable error behavior in ProcessSupport and LoadableSupport; they used to perform a reset instead of a cancel
  • Added a missing Task priority argument in an overload of the Process.run method
  • Fixed a few typos in the documentation.

@SwiftedMind SwiftedMind self-assigned this Nov 22, 2023
@SwiftedMind SwiftedMind merged commit 21d3d1c into main Nov 22, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant