From c34df35ccbcc5151b91875549d04ac6269800d8c Mon Sep 17 00:00:00 2001 From: ramabit Date: Fri, 22 Jan 2016 15:50:46 -0300 Subject: [PATCH] #14 update readme and comments --- README.md | 12 ++++++------ .../com/inaka/killertask/ExampleFunctionsRefactor.kt | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c9b3c38..ab102a1 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ repositories { dependencies { // ... - compile 'com.github.inaka:killertask:v1.0' + compile 'com.github.inaka:killertask:v1.1' // ... } ``` @@ -44,18 +44,18 @@ dependencies { } init { - KillerTask(doWork(), onSuccess, onFailed).go() + KillerTask(doWork, onSuccess, onFailed).go() } - fun doWork(): String { - return "test" + val doWork: () -> String = { + "test" // implicit return } ``` or simply: ```kotlin - KillerTask( - "test", // task + KillerTask( + { "test" }, // task {result: String -> Log.wtf("result", result)}, // onSuccess actions {e: Exception? -> Log.wtf("result", e.toString())} // onFailed actions ).go() diff --git a/library/src/main/java/com/inaka/killertask/ExampleFunctionsRefactor.kt b/library/src/main/java/com/inaka/killertask/ExampleFunctionsRefactor.kt index 319eb3f..813970e 100644 --- a/library/src/main/java/com/inaka/killertask/ExampleFunctionsRefactor.kt +++ b/library/src/main/java/com/inaka/killertask/ExampleFunctionsRefactor.kt @@ -42,7 +42,7 @@ private class ExampleFunctionsRefactor { httpConn.connectTimeout = 3000; httpConn.readTimeout = 5000; - // return + // implicit return httpConn.responseCode.toString() + " " + httpConn.responseMessage }