KRO Open source Kubernetes resource manager from GCP, AWS, Azure
cloud.google.com3 pointsby drabinowitz0 comments
const maybePets: Array<Pet | undefined> = [...]
const pets: Array<Pet> = maybePets.filter((v: Pet | undefined): v is Pet => v != undefined)
Will compile without errors. function MyReactComponent() {
const [
[width, setWidth],
[name, setName],
] = React.use(
[useWidth],
[useName, 'alice'],
);
return <div>{width} {name}</div>
}
admittedly, this is much less clean looking than the current proposal, but, in my mind at least, it makes it a bit more clear that you have to pass the functions in with a specific order at the top of the component.