-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v 1.0.7. Boost the performance of getting
mvbScope
.
- Loading branch information
WilliamKwokX
committed
Sep 24, 2023
1 parent
8010f2d
commit 3e760af
Showing
47 changed files
with
320 additions
and
237 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package pers.shawxingkwok.mvb | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import androidx.fragment.app.testing.launchFragment | ||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.lifecycleScope | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.launch | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import pers.shawxingkwok.mvb.android.mvbScope | ||
import java.util.concurrent.CopyOnWriteArrayList | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
internal class Scope { | ||
|
||
@Test | ||
fun useAppContext() { | ||
launchFragment<MyFragment>() | ||
} | ||
|
||
class MyViewModel : ViewModel(){} | ||
|
||
class MyFragment : Fragment(){ | ||
val scopes = CopyOnWriteArrayList<CoroutineScope>() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
repeat(10){ | ||
lifecycleScope.launch(Dispatchers.Default) { | ||
scopes += mvbScope | ||
} | ||
} | ||
} | ||
|
||
override fun onDestroy() { | ||
super.onDestroy() | ||
assert(scopes.size == 10) | ||
scopes.single() | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
package pers.shawxingkwok.mvb.android | ||
|
||
import androidx.lifecycle.ViewModelStoreOwner | ||
import androidx.lifecycle.viewModelScope | ||
import kotlinx.coroutines.CoroutineScope | ||
|
||
/** | ||
* See [doc](https://shawxingkwok.github.io/ITWorks/docs/multiplatform/mvb/android/#mvbscope). | ||
*/ | ||
public val ViewModelStoreOwner.mvbScope: CoroutineScope get() = getMVBVm().scope | ||
public val ViewModelStoreOwner.mvbScope: CoroutineScope get() = getMVBVm().viewModelScope |
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab
Binary file not shown.
Binary file modified
BIN
+7.3 KB
(190%)
...uild/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab
Binary file not shown.
Binary file modified
BIN
+6 Bytes
(110%)
.../kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ild/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab
Binary file not shown.
Binary file modified
BIN
+166 Bytes
(110%)
.../compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ild/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
.../compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...pileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len
Binary file not shown.
Binary file modified
BIN
+4.54 KB
(190%)
.../compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...d/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab
Binary file not shown.
Binary file modified
BIN
+2.86 KB
(160%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab
Binary file not shown.
Binary file modified
BIN
+4.1 KB
(190%)
...kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab
Binary file not shown.
Binary file modified
BIN
+95 Bytes
(120%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab
Binary file not shown.
Binary file modified
BIN
+66 Bytes
(120%)
.../build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
7 | ||
9 | ||
0 |
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab
Binary file not shown.
Binary file modified
BIN
+12 Bytes
(110%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len
Binary file not shown.
Binary file modified
BIN
+166 Bytes
(130%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len
Binary file not shown.
Binary file modified
BIN
+8.38 KB
(180%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
demo/build/kotlin/compileDebugKotlin/cacheable/last-build.bin
Binary file not shown.
Binary file modified
BIN
+34 Bytes
(210%)
demo/build/kotlin/compileDebugKotlin/local-state/build-history.bin
Binary file not shown.
Oops, something went wrong.