benski/BAPromise

Whats the point to have BAPromiseClient class separate from Promise class?

Closed this issue · 4 comments

@benski

Could I ask the reasons to have separated class for producer API?

I want to combine them, because if these are combined, promises can be created by something like following. (No factory method name. No factory class name.)

BAPromise<Type>({fulfill, reject in
    // business logic 
}).then ....

which is much cleaner and natural way to make promises in my opinion.

Actually even parenthesis can be removed thanks to auto closure in Swift

BAPromise<Type> { fulfill, reject in
    // business logic 
}.then { value in ...

I had originally done it in an effort to keep the producer and consumer sides of the API separate. I'm happy to accept a Pull Request to merge it into one

@benski here we go #7

Thanks @benski ! Closing.