Skip to content

roblevy/async-and-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

awaitable and callable functions

How do you create a function which can be awaited, in which case it has one set of behaviour, or called directly, in which case it has another?

I asked this very question on Stack Overflow and got a great answer. This is the answer.

The first commit is the answer posted. The second commit is the answer in the comments.

About

A function which can be awaited _and_ invoked!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages