stencil-router icon indicating copy to clipboard operation
stencil-router copied to clipboard

Generic interfaces for MatchResults, route state, query, etc

Open val-o opened this issue 6 years ago • 0 comments

Resources: Before submitting an issue, please consult our docs.

Stencil version: (run npm list @stencil/core from a terminal/cmd prompt and paste output below):

 insert the output from npm list @stencil/core here

I'm submitting a ... (check one with "x") [ ] bug report [x] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior: It would be really nice to have generic versions of router interfaces such as MathResults, location query, state, hash. So you can strongly type those objects, currenly I am doing something like this, it works fine, but looks a bit unfriendly image So basically I can now use it in my component wich has @Prop() match: MyTimeoffMatch, and I get intelliscene and type checking

So instead of having such ugly consruction we could do something like this

type MyParams = {tab: TabEnum}
@Prop match: MatchResult<MyParams>;

and same for other route dictionaries in LocationSegments. What do you think? Expected behavior:

Steps to reproduce:

Related code:

insert any relevant code here

Other information:

val-o avatar Feb 17 '19 19:02 val-o