-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add kotlin wasmJs target * Add wasm test strategy to GitHub action * Fix to run wasm test tasks in ci
- Loading branch information
Showing
14 changed files
with
1,009 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,5 +108,3 @@ allprojects { | |
koverMerged { | ||
enable() | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
kstore-storage/src/commonMain/kotlin/io/github/xxfast/kstore/storage/Storage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.github.xxfast.kstore.storage | ||
|
||
public expect abstract class Storage | ||
|
||
internal expect operator fun Storage.get(key: String): String? | ||
|
||
internal expect operator fun Storage.set(key: String, value: String) | ||
|
||
internal expect fun Storage.remove(key: String) | ||
|
||
internal expect fun Storage.delete() | ||
|
||
public expect val localStorage: Storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
kstore-storage/src/jsMain/kotlin/io/github/xxfast/kstore/storage/Storage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.github.xxfast.kstore.storage | ||
|
||
import org.w3c.dom.Storage | ||
import org.w3c.dom.get | ||
import org.w3c.dom.set | ||
|
||
public actual typealias Storage = Storage | ||
|
||
internal actual operator fun Storage.get(key: String): String? = this[key] | ||
|
||
internal actual operator fun Storage.set(key: String, value: String){ | ||
this[key] = value | ||
} | ||
|
||
internal actual fun Storage.remove(key: String) = this.removeItem(key) | ||
|
||
internal actual fun Storage.delete() = this.clear() | ||
|
||
public actual val localStorage: Storage = kotlinx.browser.localStorage |
19 changes: 19 additions & 0 deletions
19
kstore-storage/src/wasmJsMain/kotlin/io/github/xxfast/kstore/storage/Storage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.github.xxfast.kstore.storage | ||
|
||
import org.w3c.dom.Storage | ||
import org.w3c.dom.get | ||
import org.w3c.dom.set | ||
|
||
public actual typealias Storage = Storage | ||
|
||
internal actual operator fun Storage.get(key: String): String? = this[key] | ||
|
||
internal actual operator fun Storage.set(key: String, value: String){ | ||
this[key] = value | ||
} | ||
|
||
internal actual fun Storage.remove(key: String) = this.removeItem(key) | ||
|
||
internal actual fun Storage.delete() = this.clear() | ||
|
||
public actual val localStorage: Storage = kotlinx.browser.localStorage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
kstore/src/wasmJsMain/kotlin/io/github/xxfast/kstore/utils/Dispatchers.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.github.xxfast.kstore.utils | ||
|
||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
internal actual val StoreDispatcher: CoroutineDispatcher = Dispatchers.Default |