Skip to content

Commit

Permalink
README.md update
Browse files Browse the repository at this point in the history
  • Loading branch information
tcldr committed Jun 28, 2019
1 parent e4d1333 commit a88e1e4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
12 changes: 6 additions & 6 deletions Assets/Entwine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Part of [Entwine](https://github.com/tcldr/Entwine) – A collection of accessor

---

### CONTENTS
## Contents
- [About](#about)
- [Getting Started](#getting-started)
- [Installation](#installation)
Expand All @@ -14,7 +14,7 @@ Part of [Entwine](https://github.com/tcldr/Entwine) – A collection of accessor

---

### ABOUT
## About

_Entwine Utilities_ are a collection of operators, tools and extensions to make working with _Combine_ even more productive.

Expand All @@ -27,7 +27,7 @@ be sure to checkout the [documentation](http://tcldr.github.io/Entwine/EntwineDo

---

### GETTING STARTED
## Getting started

Ensure to `import Entwine` in each file you wish to the utilities with.

Expand Down Expand Up @@ -62,7 +62,7 @@ Each operator, subject and utility is documented with examples. check out the [f

---

### INSTALLATION
## Installation
### As part of another Swift Package:
1. Include it in your `Package.swift` file as both a dependency and a dependency of your target.

Expand Down Expand Up @@ -93,12 +93,12 @@ let package = Package(

---

### DOCUMENTATION
## Documentation
Full documentation for _Entwine_ can be found at [http://tcldr.github.io/Entwine/EntwineDocs](http://tcldr.github.io/Entwine/EntwineDocs).

---

### COPYRIGHT AND LICENSE
## Copyright and license
Copyright 2019 © Tristan Celder

_Entwine_ is made available under the [MIT License](http://github.com/tcldr/Entwine/blob/master/LICENSE)
Expand Down
22 changes: 11 additions & 11 deletions Assets/EntwineTest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Part of [Entwine](https://github.com/tcldr/Entwine) – A collection of accessor

---

### CONTENTS
## Contents
- [About _EntwineTest_](#about-entwinetest)
- [Getting Started](#getting-started)
- [TestScheduler](#testscheduler)
Expand All @@ -19,21 +19,21 @@ Part of [Entwine](https://github.com/tcldr/Entwine) – A collection of accessor

---

### ABOUT _ENTWINE TEST_
## About _EntwineTest_

_EntwineTest_ packages a concise set of tools that are designed to work together to help you test your _Combine_ sequences and operators.

In addition, _EntwineTest_ includes tools to help you to determine whether your publishers are complying with subscriber demand requests (backpressure) so that you can ensure your publisher is behaving like a good _Combine_ citizen before releasing it out in the wild.

---

### GETTING STARTED
## Getting Started

The _EntwineTest_ packages consists of three major components – together, they help you write better tests for your _Combine_ sequences.

Let's go through them one by one before finally seeing how they all fit together:

## `TestScheduler`:
### `TestScheduler`:

At the heart of _Combine_ is the concept of schedulers. Without them, no work gets done. Essentially they are responsible for both _where_ an action is excuted (main thread, a dipatch queue, or the current thread), and _when_ it is is executed (right now, after the current task has finished, five minutes from now).

Expand Down Expand Up @@ -61,7 +61,7 @@ scheduler.resume() // the clock is paused until this is called

```
Notice that as we've scheduled "bosh" to print at `300`, and "bish" to print at `100`, when we start the scheduler by calling `.resume()`, "bish" is printed first.
## `TestablePublisher`:
### `TestablePublisher`:

Now that we have our scheduler, we can think about how we're going to simulate some _Combine_ sequences. If we want to simulate a sequence, we'll need a publisher that lets us define _what_ each element a sequence should be, and _when_ that element should be emitted.

Expand Down Expand Up @@ -109,7 +109,7 @@ scheduler.resume()
```
Notice how the events events scheduled by the relative publisher fired _after_ the events scheduled by the absolute publisher. As we had set the time of our scheduler to `200` in its initializer, when we subscribed to our relative publisher with the `sink(_:)` method, our publisher took the current time and added that value to each scheduled event.

## `TestableSubscriber`:
### `TestableSubscriber`:

The final piece in the jigsaw is the `TestableSubscriber`. Its role is to gather the output of a publisher so that it can be compared against some expected output. It also depends on the `TestScheduler`, so to get one we call `createTestableSubscriber(_:_:)` on our scheduler.

Expand Down Expand Up @@ -145,7 +145,7 @@ print("sequences match: \(expected == subscriber.sequence)")
// sequences match: true
```

## Putting it all together
### Putting it all together
Now that we have our `TestScheduler`, `TestPublisher`, and `TestSubscriber` let's put them together to test our operators and sequences.

But first, there's one additional method that you should be aware of. That's the `start(create:)` method on `TestScheduler`.
Expand Down Expand Up @@ -194,7 +194,7 @@ Hopefully this should be everything you need to get you started with testing you

---

### INSTALLATION
## Installation
### As part of another Swift Package:
1. Include it in your `Package.swift` file as both a dependency and a dependency of your target.

Expand Down Expand Up @@ -225,17 +225,17 @@ let package = Package(

---

### DOCUMENTATION
## Documentation
Full documentation for _EntwineTest_ can be found at [http://tcldr.github.io/Entwine/EntwineTestDocs](http://tcldr.github.io/Entwine/EntwineTestDocs).

---

### ACKNOWLEDGEMENTS
## Acknowledgments
_EntwineTest_ is inspired by the great work done in the _RxTest_ library by the contributors to [_RxSwift_](https://github.com/ReactiveX/RxSwift).

---

### COPYRIGHT AND LICENSE
## Copyright and license
Copyright 2019 © Tristan Celder

_EntwineTest_ is made available under the [MIT License](http://github.com/tcldr/Entwine/blob/master/LICENSE)
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Accessories for [Apple's Combine Framework](https://developer.apple.com/document

---

### ABOUT
## About
Entwine consists of three libraries (over two repositories) to be used in conjuction with Apple's Combine framework:
- The [_Entwine Utilities library_](https://github.com/tcldr/Entwine/blob/master/Assets/Entwine/README.md) includes additional operators, subjects and utilities for working with Combine sequences.
The package currently includes a `ReplaySubject`, a `withLatest(from:)` operator and a `Publishers.Factory` for rapidly defining publishers inline from any source.
Expand All @@ -31,8 +31,8 @@ _Note: EntwineRx is maintained as a separate Swift package to minimize the SPM d

---

### QUICK START GUIDE
# Create _Combine_ publishers from any source
## Quick start guide
### Create _Combine_ publishers from any source
Use the [`Publishers.Factory`](https://tcldr.github.io/Entwine/EntwineDocs/Extensions/Publishers/Factory.html) publisher from the _Entwine_ package to effortlessly create a publisher that
meets Combine's backpressure requirements from any source. [Find out more about the _Entwine Utilities_ library.](https://github.com/tcldr/Entwine/blob/master/Assets/Entwine/README.md)

Expand All @@ -56,7 +56,7 @@ let photoKitAuthorizationStatus = Publishers.Factory<PHAuthorizationStatus, Neve
return AnyCancellable {}
}
```
# Unit test _Combine_ publisher sequences
### Unit test _Combine_ publisher sequences
Use the `TestScheduler`, `TestablePublisher` and `TestableSubscriber` to simulate _Combine_ sequences and test against expected output. [Find out more about the _EntwineTest_ library](https://github.com/tcldr/Entwine/blob/master/Assets/EntwineTest/README.md)

_Testing Combine's `map(_:)` operator:_
Expand Down Expand Up @@ -91,33 +91,33 @@ func testMap() {
}
```

# Bridge your _RxSwift_ view models to _Combine_ and use with _SwiftUI_
### Bridge your _RxSwift_ view models to _Combine_ and use with _SwiftUI_
First, make sure you add the [_EntwineRx Swift Package_](https://github.com/tcldr/EntwineRx) (located in an external repo) as a dependency to your project.

_Example coming soon_

---

### REQUIREMENTS
## Requirements
Entwine sits on top of Apple's Combine framework and therefore requires _Xcode 11_ and is has minimum deployment targets of _macOS 10.15_, _iOS 13_, _tvOS 13_ or _watchOS 6_.

---

### INSTALLATION
## Installation
Entwine is delivered via a Swift Package and can be installed either as a dependency to another Swift Package by adding it to the dependencies section of a `Package.swift` file
or to an Xcode 11 project by via the `File -> Swift Packages -> Add package dependency...` menu in Xcode 11.

---

### DOCUMENTATION
## Documentation
Documentation for each package is available at:
- [Entwine Documentation](https://tcldr.github.io/Entwine/EntwineDocs/) (Operators, Publishers and Accessories)
- [EntwineTest Documentation](https://tcldr.github.io/Entwine/EntwineTestDocs/) (Tools for testing _Combine_ sequence behavior)
- [EntwineRx Documentation](https://tcldr.github.io/Entwine/EntwineRxDocs/) (Bridging operators for _RxSwift_)

---

### COPYRIGHT AND LICENSE
## Copyright and license

This project is released under the [MIT license](https://github.com/tcldr/Entwine/blob/master/LICENSE)

Expand Down

0 comments on commit a88e1e4

Please sign in to comment.