Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Commits
473295a2
Commit
473295a2
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix/cancellable' into feature/example-network-health-monitor
parents
47d1a2b3
5808d986
No related branches found
No related tags found
1 merge request
!11
[Example App] Monitor network health
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/ElixxirDAppsSDK/Cancellable.swift
+9
-2
9 additions, 2 deletions
Sources/ElixxirDAppsSDK/Cancellable.swift
with
9 additions
and
2 deletions
Sources/ElixxirDAppsSDK/Cancellable.swift
+
9
−
2
View file @
473295a2
public
final
class
Cancellable
{
public
init
(
cancel
:
@escaping
()
->
Void
)
{
self
.
c
ancel
=
cancel
self
.
onC
ancel
=
cancel
}
deinit
{
cancel
()
}
public
let
cancel
:
()
->
Void
public
func
cancel
()
{
guard
isCancelled
==
false
else
{
return
}
isCancelled
=
true
onCancel
()
}
private
var
isCancelled
=
false
private
let
onCancel
:
()
->
Void
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment