isIdentityChangeProvider --> isIdentityDerivationProvider (#128)

This commit is contained in:
PaleHazy 2022-04-23 14:32:12 -05:00 committed by GitHub
parent b10ae71b92
commit a4c9b8d75a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -266,7 +266,7 @@ export const valueDerivation = <P extends PointerType<$IntentionalAny>>(
let derivation = identityDerivationWeakMap.get(meta) let derivation = identityDerivationWeakMap.get(meta)
if (!derivation) { if (!derivation) {
const root = meta.root const root = meta.root
if (!isIdentityChangeProvider(root)) { if (!isIdentityDerivationProvider(root)) {
throw new Error( throw new Error(
`Cannot run valueDerivation() on a pointer whose root is not an IdentityChangeProvider`, `Cannot run valueDerivation() on a pointer whose root is not an IdentityChangeProvider`,
) )
@ -278,8 +278,7 @@ export const valueDerivation = <P extends PointerType<$IntentionalAny>>(
return derivation as $IntentionalAny return derivation as $IntentionalAny
} }
// TODO: Rename it to isIdentityDerivationProvider function isIdentityDerivationProvider(
function isIdentityChangeProvider(
val: unknown, val: unknown,
): val is IdentityDerivationProvider { ): val is IdentityDerivationProvider {
return ( return (