Skip to content

Using async/await features to simulate callbacks #2

@frabert

Description

@frabert

How would one use c# async features to simulate js-style callbacks? (see: node.js fs API )

Imagine I have the following C# method:

async Task<string> ReadFileAsync(string path)
{
  return await DoWhatever(path);
}

How would I register a js function which takes a string and a callback as arguments and calls it asynchronously?

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