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

Refine LiveFile and LiveJson usage model #57

Open
3Nigma opened this issue Apr 11, 2022 · 0 comments
Open

Refine LiveFile and LiveJson usage model #57

3Nigma opened this issue Apr 11, 2022 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@3Nigma
Copy link
Contributor

3Nigma commented Apr 11, 2022

LiveFile (inherited by LiveJson) is exposing a getContents() method to retrieve the underlying content as a Promise<Uint8Array>.

We need to have:

  • add a parameter to getContents called update which is a boolean defaulting to false that, when set to true does a FileContentsQuery network action, updating the underlying content in the process. If it's false, it retrieves the stored data in Uint8Array format.
  • both LiveJson and LiveFile should use the query result to update it's internal data reference
  • Implement LiveJson.toString() which will stringify its data
  • Implement LiveFile.toString() which will return its internal data (if it's a string) or <binary File content> if the data is a Uint8Array.

toString() implementations will allow for fluent formatting in structures such as This is the file: ${liveFile}.

@3Nigma 3Nigma added enhancement New feature or request question Further information is requested labels Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant