question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"when" on TypeScript types

See original GitHub issue

I have a snippet for TypeScript which “promisifies” values, and it works great for custom types

- MyType.promisify
+ Promise<MyType>

However, I cannot target built-in types such as boolean, void, etc. in "when": [...].

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ipatalascommented, Feb 28, 2021

Ok, the release is out! Enjoy 😃

Added additional when option: type which can be used for other custom templates like this but you should not need this for promisify as this is also a new built-in template 😃

1reaction
vladdeSVcommented, Feb 27, 2021

what do you say?

That will be a great addition! Looking forward to the next release 😋

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handbook - Basic Types - TypeScript
Basic Types · Boolean · Number · String · Array · Tuple · Enum · Unknown · Any.
Read more >
Documentation - Advanced Types - TypeScript
TypeScript has two special types, null and undefined , that have the values null and undefined respectively. We mentioned these briefly in the...
Read more >
Documentation - Everyday Types - TypeScript
JavaScript has three very commonly used primitives: string , number , and boolean . Each has a corresponding type in TypeScript. As you...
Read more >
Documentation - Type Compatibility - TypeScript
Type compatibility in TypeScript is based on structural subtyping. Structural typing is a way of relating types based solely on their members.
Read more >
Documentation - Type Declarations - TypeScript
TypeScript includes declaration files for all of the standardized built-in APIs available in JavaScript runtimes. This includes things like methods and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found