Is there any other way then `compose multiplatform...
# multiplatform
d
Is there any other way then
compose multiplatform ressources
when you want to load/read a json file on all platforms? We have a mock server we use for offline testing/development and we currently add json as strings in a kotlin file but would be nice if we can change this to loading a specific json file when the mock server needs to respond instead of using the string
val
.
t
You can use Res.readBytes() or Res.readUri() It reads content at "composeResources/res-package/<path-you-provided>
d
yeah I know that but is there also an easy solution for without having to depend on compose multiplatform.
j
Depends on what you mean by all platforms, you can always do what the target platform offers and use own expect/actual readers This works easily on jvm/android/ios