From 17d38c6b735f0b59c1a6fd6ef6aed89bb683dbab Mon Sep 17 00:00:00 2001 From: Eric Rabil Date: Fri, 17 Sep 2021 14:40:59 -0400 Subject: [PATCH] Add Promise->Publisher --- .../Pwomise/Extensions/Promise+Publisher.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Sources/Pwomise/Extensions/Promise+Publisher.swift diff --git a/Sources/Pwomise/Extensions/Promise+Publisher.swift b/Sources/Pwomise/Extensions/Promise+Publisher.swift new file mode 100644 index 0000000..b092e0b --- /dev/null +++ b/Sources/Pwomise/Extensions/Promise+Publisher.swift @@ -0,0 +1,18 @@ +//// File.swift +// +// +// Created by Eric Rabil on 9/17/21. +// +// + +import Foundation +import Combine + +@available(macOS 10.15, *) +public extension Promise { + var publisher: Future { + Future { resolve in + let _ = self.observeAlways(resolve) + } + } +}