Skip to content
By using Twitter’s services you agree to our Cookies Use. We and our partners operate globally and use cookies, including for analytics, personalisation, and ads.

For the best Twitter experience, please use Microsoft Edge, or install the Twitter app from Microsoft Store.

  • Home Home Home, current page.
  • About

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
MatthewGerstman's profile
Matthew
Matthew
Matthew
@MatthewGerstman

Tweets

Matthew

@MatthewGerstman

👨🏻‍🦲Matthew not Matt. 👨🏻‍💻Engineer @Dropbox. ⚛️Organizer @useReactNYC. 🎭Broadway Fan https://amzn.to/2Qik5mz  🐍Slytherin 💃🏻#DevSwifty 👋 he/him

New York, NY
matthewgerstman.com
Joined April 2009

Tweets

  • © 2020 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Imprint
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    Matthew‏ @MatthewGerstman Jan 27
    • Report Tweet

    Give me your best real world use cases of conditional types and inference types in TypeScript. Can be open source or not. Retweets appreciated.

    5:50 AM - 27 Jan 2020
    • 14 Retweets
    • 15 Likes
    • JS Reader Nick Taylor (he/him) Ethan Arrowood 👻 nasir uddin Joachim Viide Kumar Abhirup Magdalena Rosłaniec Rendall John Reilly
    7 replies 14 retweets 15 likes
      1. New conversation
      2. Josh Goldberg‏ @JoshuaKGoldberg Jan 27
        • Report Tweet
        Replying to @MatthewGerstman

        I'm working on a function that returns { setTimeout } when called in an environment where Jest does not exist, and { setTimeout: jest.fn() } when it does. declare namespace jest {} export type JestExists = typeof jest extends { fn: Function } ? true : false; 1/?

        1 reply 0 retweets 1 like
      3. Josh Goldberg‏ @JoshuaKGoldberg Jan 27
        • Report Tweet
        Replying to @JoshuaKGoldberg @MatthewGerstman

        The function's return type is something like: JestExists ? Pick<Window, 'setTimeout'> : { setTimeout: jest.Mock }. Relies on *.test.* files being included in a separate tsconfig project than your source files Pretty cool IMO 😎 2/2

        1 reply 0 retweets 4 likes
      4. 1 more reply
      1. New conversation
      2. Simon Korzunov‏ @twopSK Jan 27
        • Report Tweet
        Replying to @MatthewGerstman

        working on a library to add side effects to "useReducer". That allows to write this code. All of it is typechecked thanks to conditional types.pic.twitter.com/dMcVyhy7Bl

        1 reply 0 retweets 2 likes
      3. 4 more replies
      1. Josh Goldberg‏ @JoshuaKGoldberg Jan 27
        • Report Tweet
        Replying to @MatthewGerstman

        Oh also, for a library that needs to replace everything on the Console object, this type removes the non-Function parts to leave a type with just the member functions: https://github.com/Codecademy/console-fail-test/blob/24e0841ba50176bf6e78419a6a757f063a112d80/src/types.ts#L11 …

        0 replies 0 retweets 1 like
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. Joachim Viide‏ @jviide Jan 27
        • Report Tweet
        Replying to @MatthewGerstman @jonihasanen

        Matchkin (https://github.com/jviide/matchkin ) contorts conditional & inference types to implement statically checked exhaustive matching. Maybe it would've been possible to get something similar w/o those specific TS features. It has its uses, though. Sorry for the potato quality video 🙂pic.twitter.com/OORQoiSxA0

        0 replies 0 retweets 1 like
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. Ethan Arrowood  👻‏ @ArrowoodTech Jan 27
        • Report Tweet
        Replying to @MatthewGerstman

        Oh do I have some content for you - will message when I get home

        0 replies 0 retweets 1 like
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. Eric Zorn‏ @zornwebdev Jan 27
        • Report Tweet
        Replying to @MatthewGerstman

        Well the best case I’ve seen is when an API I was using sent back an integer value as both a number and a string. It completely occurred randomly

        0 replies 0 retweets 0 likes
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. Guy Balaam‏ @iambalaam Jan 27
        • Report Tweet
        Replying to @MatthewGerstman

        We had an api client that had methods for our backend services. We wanted to be able to load test new features on our production hosts without leaking the names of endpoints. Using conditional types helped us keep type safety without exposing a runtime artifact

        0 replies 0 retweets 0 likes
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo

    Loading seems to be taking a while.

    Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

      Promoted Tweet

      false

      • © 2020 Twitter
      • About
      • Help Center
      • Terms
      • Privacy policy
      • Imprint
      • Cookies
      • Ads info