Action icon indicating copy to clipboard operation
Action copied to clipboard

Flatten out underlyingErrors

Open bobgodwinx opened this issue 8 years ago • 3 comments

Currently

The current implementation of Action doesn't allow you to receive the Swift.Error when .execution is called. But we get an ActionError type which is not really useful because you always have to switch within it to the underlyingError.

Proposal

I think it would be nice for the framework to have something like var underlyingErrors: Observable<Swift.Error> which will only emit when .execution actually has an error

bobgodwinx avatar Oct 27 '17 15:10 bobgodwinx

That makes sense to me, I believe ReactiveSwift's Command type has something similar. Let's do it!

ashfurrow avatar Oct 27 '17 15:10 ashfurrow

Should .errors will be Observable<Swift.Error> while .executionErrors/actionErrors will be Observable<ActionError>? @bobgodwinx

dangthaison91 avatar Jan 08 '18 09:01 dangthaison91

@dangthaison91 exactly, the idea is to separate the errors related to the output from the executionErrors this will make sure that on .errors we will be getting only Swift.Error. Do plan on submitting a PR?

bobgodwinx avatar Jan 08 '18 15:01 bobgodwinx