Skip to content

Difference between function's no return type and Promise(Never, Void) #455

Answered by gdotdesign
jiggneshhgohel asked this question in Q&A
Discussion options

You must be logged in to vote

Hi 👋

I believe these two points can help you better understand what is going on:

  • The return type definition can be omitted and in that case it's inferred from the body of the function (since a function can only have one expression)
  • The return type of a next { } expression is Promise(Never, Void) because it mutates the state asynchronously.

the functions to be invoked on onClick event i.e. decrement and increment have function type Function() (that's based on my understanding of the documentation under section Type of a function on page mint-lang.com/guide/reference/functions) however looking at the functions defined in mint-realworld Forms.SignIn I can see the functions defined to have…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jiggneshhgohel
Comment options

@gdotdesign
Comment options

Answer selected by gdotdesign
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants