You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.
The points in the Motivations section of the README are outdated or not applicable with TypeScript.
Finding an individual element in the document tree and operating on it can lead to null pointer exceptions.
TypeScript now supports optional chaining, and with strictNullChecks enabled, this should never be an issue.
Even if found, the element may be of the wrong type.
The TypeScript definitions for these methods accept a type parameter, which will assert the return type. Obviously, if the fetched element is actually of a different type, it can still lead to runtime errors. On the plus side, there's no runtime cost for the check. But in my experience, this kind of runtime error is extremely rare. Furthermore, this library will just throw an Error anyway, so it's still going to end up being a runtime error.
Why deprecate?
This will discourage new users and point them to the vanilla patterns.
Why keep it?
This library may still be useful for Flow users.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The points in the
Motivations
section of the README are outdated or not applicable with TypeScript.TypeScript now supports optional chaining, and with
strictNullChecks
enabled, this should never be an issue.The TypeScript definitions for these methods accept a type parameter, which will assert the return type. Obviously, if the fetched element is actually of a different type, it can still lead to runtime errors. On the plus side, there's no runtime cost for the check. But in my experience, this kind of runtime error is extremely rare. Furthermore, this library will just throw an Error anyway, so it's still going to end up being a runtime error.
Why deprecate?
This will discourage new users and point them to the vanilla patterns.
Why keep it?
This library may still be useful for Flow users.
The text was updated successfully, but these errors were encountered: