I would like to write a function that works with no argument or with 3 arguments but it wouldn't work if the user pass one o two arguments. It is possible?
Asked
Active
Viewed 39 times
1 Answers
0
Well I figured out how to do it:
I used an object as optional argument with 3 required key:
initialFetchPosts(query?:{field:string,comparison:any,value:string}){...}

Pablo
- 2,137
- 1
- 17
- 16