From 2964586cb9482cada2bc7e0a3fc1ec5957495bf0 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 8 Dec 2024 09:42:02 +0600 Subject: [PATCH] add defaults to remove/set --- .../dev/inmo/tgbotapi/webapps/cloud/CloudStorage.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/cloud/CloudStorage.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/cloud/CloudStorage.kt index b1410c61bf..869e5bf999 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/cloud/CloudStorage.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/cloud/CloudStorage.kt @@ -80,24 +80,24 @@ fun CloudStorage.get( fun CloudStorage.remove( key: CloudStorageKey, - callback: (result: Result) -> Unit + callback: (result: Result) -> Unit = {} ) = removeItem(key) { e, v -> callback(resultsToResult(e, v)) } fun CloudStorage.remove( key: String, - callback: (result: Result) -> Unit + callback: (result: Result) -> Unit = {} ) = remove(CloudStorageKey(key), callback) fun CloudStorage.remove( keys: Array, - callback: (result: Result) -> Unit + callback: (result: Result) -> Unit = {} ) = removeItems( keys ) { e, v -> callback(resultsToResult(e, v)) } fun CloudStorage.remove( keys: Array, - callback: (result: Result) -> Unit + callback: (result: Result) -> Unit = {} ) = remove( Array(keys.size) { CloudStorageKey(keys[it]) @@ -109,7 +109,7 @@ fun CloudStorage.remove( key: String, key2: String, vararg otherKeys: String, - callback: (result: Result) -> Unit + callback: (result: Result) -> Unit = {} ) = remove( arrayOf(key, key2) + otherKeys, callback