Skip to content

Improve .create ergonomics and add cancelation-handling#24

Merged
freak4pc merged 1 commit intomasterfrom
create-improvements
Apr 17, 2020
Merged

Improve .create ergonomics and add cancelation-handling#24
freak4pc merged 1 commit intomasterfrom
create-improvements

Conversation

@freak4pc
Copy link
Member

This PR includes two improvements to AnyPublisher.create:

  1. Instead of providing a raw closure, provides a subscriber-like argument with the familiar event-sending syntax of send(_:), send(completion:).

  2. Allow providing a Cancelable-conforming object as the return of that closure, which is useful to provide cleanup-logic to your custom publisher.

Thanks to @mbrandonw for the great ideas and feedback 🥇🥳

@freak4pc freak4pc added the enhancement New feature or request label Apr 17, 2020
@freak4pc freak4pc self-assigned this Apr 17, 2020
@freak4pc freak4pc force-pushed the create-improvements branch 2 times, most recently from 9a782f2 to e320613 Compare April 17, 2020 20:15
@codecov
Copy link

codecov bot commented Apr 17, 2020

Codecov Report

Merging #24 into master will increase coverage by 0.22%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #24      +/-   ##
==========================================
+ Coverage   96.72%   96.94%   +0.22%     
==========================================
  Files          34       34              
  Lines        1617     1638      +21     
==========================================
+ Hits         1564     1588      +24     
+ Misses         53       50       -3     
Impacted Files Coverage Δ
Sources/Operators/Create.swift 100.00% <100.00%> (+12.50%) ⬆️
Tests/CreateTests.swift 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ed4677...6a87026. Read the comment docs.

@freak4pc freak4pc force-pushed the create-improvements branch 2 times, most recently from f376d67 to daa932f Compare April 17, 2020 20:23
@freak4pc freak4pc force-pushed the create-improvements branch from daa932f to 6a87026 Compare April 17, 2020 20:32
@freak4pc freak4pc merged commit ad2aef2 into master Apr 17, 2020
@freak4pc freak4pc deleted the create-improvements branch April 17, 2020 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant