Skip to content

Commit fe8eb86

Browse files
committed
docs: Readme and LICENCE update
1 parent 6effecc commit fe8eb86

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Maxim Krouk
3+
Copyright (c) 2021 CaptureContext
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# swift-capture
22

3-
[![SwiftPM 5.3](https://img.shields.io/badge/📦_spm-5.3-ED523F.svg?style=flat)](https://swift.org/download/) [![@maximkrouk](https://img.shields.io/badge/contact-@maximkrouk-1DA1F2.svg?style=flat&logo=twitter)](https://twitter.com/maximkrouk)
3+
[![SwiftPM 5.3](https://img.shields.io/badge/📦_swiftpm-5.3-ED523F.svg?style=flat)](https://swift.org/download/) [![@maximkrouk](https://img.shields.io/badge/contact-@capturecontext-1DA1F2.svg?style=flat&logo=twitter)](https://twitter.com/capture_context)
44

55
A mechanism for safe capturing & weakifying objects in Swift.
66

77
## Usage Examples
88

99
```swift
10-
Without weak
10+
Without Capture
1111
```
1212

1313
```swift
14-
With weak
14+
With Capture
1515
```
1616

1717
----
@@ -76,6 +76,21 @@ let object.dataSource = { [weak self] in
7676
let object.dataSource = capture(or: [], in: \.data)
7777
```
7878

79+
----
80+
81+
Weak assign
82+
83+
```swift
84+
{ [weak self] value in
85+
self?.value = value
86+
}
87+
```
88+
89+
```swift
90+
captureAssign(to: \.value)
91+
captureAssign(to: \.value, removeDuplicates: ==)
92+
```
93+
7994
## Installation
8095

8196
### Basic

0 commit comments

Comments
 (0)