Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 622 Bytes

README.md

File metadata and controls

27 lines (22 loc) · 622 Bytes

LazyResult

Using Result type lazily (Result) in Swift

LazyResult looks like this:

func getInt() throws -> Int {
	...
}

var lazyResult = LazyResult(catching: getInt)
lazyResult.preform()
try lazyResult.get()

Install

Swift Package Manager

Add To Your Project In Xcode 11:

File > Swift Packages > Add Package Dependency

Add As A Dependency In Package.swift:
dependencies: [
    .package(url: "https://github.com/ytyubox/LazyResult", from: "1.0.0"),
],