Skip to content

Swift Result type with lazy attribute.

Notifications You must be signed in to change notification settings

ytyubox/LazyResult

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"),
],