Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add write operations to Resource #237

Merged
merged 2 commits into from
Jul 23, 2022
Merged

Add write operations to Resource #237

merged 2 commits into from
Jul 23, 2022

Conversation

JD557
Copy link
Owner

@JD557 JD557 commented Jul 23, 2022

Adds a new withOutputStream operation on Resource that saves data to a file on JVM/Native and to localStorage on JS.
While OutputStream is not a very convenient interface, it is good enough for now... I'm not sure what a higher level interface should look like (writeString? writeBytes?).

This helps implementing a hot reload stratagy like the one proposed in #45

Also, this PR the order resources are loaded to always try a file/localStorage first. This way an application can, for example, have an init.conf in the resources with the default configuration and let the user save it's configuration also to init.conf. If the file is deleted, the application will load back the default config.

@JD557 JD557 added this to the 0.4.1 milestone Jul 23, 2022
@JD557 JD557 changed the title Save resource Add write operations to Resource Jul 23, 2022
@JD557 JD557 merged commit 5e6279a into master Jul 23, 2022
@JD557 JD557 deleted the save-resource branch July 23, 2022 16:47
@JD557 JD557 mentioned this pull request Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant