Implement async functions · Issue #27 · bromne/typescript-optional · GitHub
Skip to content

Implement async functions #27

Open

Description

@benkeil

First of all, I love what you did!

It would be nice to use async functions in e.g. ifPresent and wait for them with async

Activity

  1. bromne commented on Jul 8, 2021

    @bromne
    Owner

    Thank you for your support!

    Do you mean something like the following?

    const optional: Optional<string> = Optional.ofNullable("foo");
    
    optional.ifPresent(async (value) => console.log(value));
    optional.ifPresentOrElse(async (value) => console.log(value), async () => console.log("empty"));
  2. benkeil commented on Jul 21, 2021

    @benkeil
    Author

    Correct

  3. benkeil commented on Aug 23, 2021

    @benkeil
    Author

    Any chance to doing this? I can also participate.

  4. bromne commented on Aug 24, 2021

    @bromne
    Owner

    @benkeil
    Sorry for no updates...
    I welcome your participation.

  5. mgohin commented on Jan 3, 2024

    @mgohin

    Would be very nice to have this feature, it's almost 'mandatory' for any backend developments.

  6. hamidouikene commented on May 3, 2024

    @hamidouikene

    That would be very nice, any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions