Skip to content

Using a generic without a schema #998

Answered by cyrilletuzi
DaSchTour asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

The watch() signature is the same as the get() signature and is working as intended.

The schema is optional, but then an Observable<unknown> is returned, which is the intended behavior. Because if a runtime time check was not done with a schema, it is not right to rely on a compilation cast: indeed, it is client-side storage, so the data could have been forged, which could lead to bugs and security issues.

I invite you to read again the "Validation" documentation, and especially the "Why a schema and a cast?" section for a longer description of the behavior.

Converting this to a discussion as it is not a bug.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DaSchTour
Comment options

Answer selected by cyrilletuzi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #997 on April 27, 2023 10:44.