Skip to content

Commit

Permalink
docs: Readme and LICENCE update
Browse files Browse the repository at this point in the history
  • Loading branch information
maximkrouk committed Dec 30, 2021
1 parent 6effecc commit fe8eb86
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Maxim Krouk
Copyright (c) 2021 CaptureContext

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# swift-capture

[![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)
[![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)

A mechanism for safe capturing & weakifying objects in Swift.

## Usage Examples

```swift
Without weak
Without Capture
```

```swift
With weak
With Capture
```

----
Expand Down Expand Up @@ -76,6 +76,21 @@ let object.dataSource = { [weak self] in
let object.dataSource = capture(or: [], in: \.data)
```

----

Weak assign

```swift
{ [weak self] value in
self?.value = value
}
```

```swift
captureAssign(to: \.value)
captureAssign(to: \.value, removeDuplicates: ==)
```

## Installation

### Basic
Expand Down

0 comments on commit fe8eb86

Please sign in to comment.