Questions tagged [publisher]
325 questions
2
votes
1 answer
Why does this Swift Publisher never fire?
I'm really confused why this Publisher is not firing, I would very much appreciate someone experienced shedding light on what is going on here.
I'm trying to build a service that exposes a Combine interface for accessing some data in Core Data.
I…

muskrat
- 31
- 4
2
votes
1 answer
Add delay between values emitted by publisher in Combine Framework in iOS
I have one publisher let subject = PassthroughSubject() that emits the following objects,
subject.send(Human(fName: "John", lName: "Abraham"))
subject.send(Human(fName: "Jane", lName: "Anne"))
I need there to be a delay between these…

D.Yasiru Jayatissa
- 21
- 1
2
votes
0 answers
Swift Combine - Publisher works only with extension for computed variables? Why?
Recently I read this article about observing variable changes using combine. It's working great but I like to wrap UserDefaults in another class just not to mix UserDefaults functions with my custom made ones and once I used the same code not in an…

gbread
- 21
- 1
2
votes
0 answers
Is there a way for publisher(affiliates) to create their own affiliate link for their sellers?
by any chance that there is any way for publishers (affiliates) to create their own affiliate link to their sellers without the help of an affiliate marketing platform out there?
For example, I have a seller who have a great interest on promoting…

user3409396
- 23
- 3
2
votes
1 answer
Upgrading S3Client to S3AsyncClient how to get Publisher?
I am upgrading S3Client in aws cloud service to S3AsyncClient.
I have this function to convert to async:
public PutObjectResponse uploadFileByUrl(String fileUrl, String builderId, PbModel category, String categoryId)
URL url = new…

Michael
- 13,950
- 57
- 145
- 288
2
votes
2 answers
SwiftUI Combine Publisher targetstruct for decoding data
I have some difficulty using Combine in SwiftUI with making an API request and then decoding the data and returning it. When calling the API Service, it states in the 'AnyPublisher' that the result will be of such type.…

Björn
- 338
- 1
- 13
2
votes
1 answer
Jenkins publishers postBuildScripts doesn't work
I have a groovy script to setup a scheduled job in Jenkins.
I want to execute some shell scripts on failed build.
If I had the scripts manually after the job creation after the job is updated by groovy script, they run.
But the groovy script does…

matisa
- 497
- 3
- 25
2
votes
1 answer
How to make a Combine publisher that publish values continuously?
I need a publisher that publish values from 1 to 360 continuously with a certain time interval between values.
I have this publisher that publish one value from 1 to 360 at every second, but once it reaches 360 it stops, basically…

Sorin Lica
- 6,894
- 10
- 35
- 68
2
votes
1 answer
How to attach subscriber to State or Binding in SwiftUI/Combine?
With a Combine Publisher, I can use the following to call a closure whenever a value changes:
let cancellable = x.sink { value in … }
How can I achieve the same behaviour with a variable marked @State or @Binding?

Div
- 1,363
- 2
- 11
- 28
2
votes
2 answers
SwiftUI @Binding value can not change and called init
I want to make a picker use SwiftUI, when I change the value in ChildView, it will not change and called ChildView init.
class ViewModel: ObservableObject {
@Published var value: Int
init(v: Int) {
self.value = v
}
}
struct…

hanamaruby
- 73
- 7
2
votes
3 answers
how to avoid .flatMap(x-> reactiveAction(x).thenReturn(x))
During some reactive programming in Java using project reactor library, I stumbled upon a pattern for which I'm wondering if there is out of box support?
So I want the code below:
Mono.just("hello")
.flatMap(hello ->…

Mahdi Amini
- 402
- 1
- 3
- 17
2
votes
2 answers
How do I resume a published timer in SwiftUI after navigating to a different page?
In the following Playground example, the UI updates with the current date correctly, however when navigating away from the page and coming back the timer does not resume ticking:
import SwiftUI
import PlaygroundSupport
struct MainTabView:…

chustar
- 12,225
- 24
- 81
- 119
2
votes
3 answers
@Published and .assign not reacting to value update
SwiftUI and Combine noob here, I isolated in a playground the problem I am having. Here is the playground.
final class ReactiveContainer {
@Published var containedValue: T?
}
class AppContainer {
static let shared =…

Guillaume L.
- 979
- 8
- 15
2
votes
2 answers
Duplicate API is getting created in WSO2 API Manager Publisher
I've published an API named as "DocumentAPI", after publishing I can find two API's with the name "DocumentAPI" in publisher. Can find only one API with name "DocumentAPI" in store. Tried deleting, recreating and republishing the API and also…

RaviKumar
- 163
- 11
2
votes
1 answer
Swift Combine: One publisher consumes another, how to get both streams back out
I'd like some help understanding why my publishers aren't emitting elements through the combineLatest operator. I have a publisher that emits video frames, and another publisher that consumes these video frames and extracts faces from these frames.…

Christina
- 51
- 2