vapor / async-kit

Sugary extensions for the SwiftNIO library
MIT License
71 stars 25 forks source link

Add guard future extension #27

Closed niazoff closed 5 years ago

niazoff commented 5 years ago

Mimics the simple guard statement in Swift. Useful for verifying a condition of the future before moving forward.

Example usage:

.guard({ order.userID == user.id }, else: AccessError.unauthorized)

Checklist

penny-coin commented 5 years ago

Hey @niazoff, you just merged a pull request, have a coin!

You now have 1 coins.