Last active
October 25, 2019 09:34
-
-
Save Zmetser/3dd5f2f23cd452253e7966b4f2a6f80c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
type Slide = {| id: number |} | |
class Test { | |
slidesWithAds: Array<Slide> = [{id: 2}]; | |
getNonAdSlideIndex(indexWithAds: number): ?Slide { | |
return this.slidesWithAds[indexWithAds]; | |
} | |
} | |
const test = new Test(); | |
const slide = test.getNonAdSlideIndex(0); | |
slide.id // < Cannot get `slide.id` because property `id` is missing in null or undefined [1]. | |
// https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoALgTwA4FMwDKMAlgCb4C8YA3gD5hkBcYAdgK4C2ARrgE5i0AvqgDGMAIYBnSWAAquSehqoAkJJLlJAdWLoAFgEFSk5gd69xmADxEyuAHxgqAbWpMwAJkEAaGu4AsggC6ANyqAOa46ABycCxGtuQAkizkAB4AFMSpuGk6+kYmrJw8vACUzAD8ifjUqGANDSq8UWy8LGD6xJIAdOp22rqGxs7Z6fnDkqFg9Y3CwqiicYqdCkpULLhI8ooZZWEiy0r95E6rij2RMXEJGrgp6Rn++6gnuD1kQA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment