[Feature Request] Fall through pattern matching
See original GitHub issueHi! I’ve noticed that ruta3
library which redux-saga-router
is based on supports matching multiple patterns to one location. It can be useful when we want to have some general saga to be applied alongside detailed ones. For instance:
const routes = {
'/profile/:id/': getProfileData,
'/profile/:id/friends/': getProfileFriends,
'/profile/:id/projects/': getProfileProjects,
}
It is easy to imagine, that on every subpage of /profile/:id
we’d like to have some basic data fetched when visiting for the first time (e.g. username, photo, etc.) and also some detailed data.
I’d suggest adding such feature as an optional setting - and I am issuing a pull request for that.
BTW My pull request also includes updated README.md
with detailed information on what patterns are available.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Pattern matching feature request - solved - Prodigy Support
Feature Request Say you're building seed patterns to detect the names of drugs like you do in the named entity video tutorial.
Read more >Pattern Matching - Reason
Pattern matching provides a way to conditionally execute code when the shape of some data matches a particular pattern. It is similar to...
Read more >Feature request: dependent pattern matching let in do blocks ...
The lack of dep. pattern matching for a let in a do-block feels arbitrary. Regaining it via case_of_ is heavy, in the sense...
Read more >"Fallthrough" or "or" in pattern matching? : r/haskell - Reddit
Is there some way how to express first 3 appEvent pattern matches better, so drawThumbnailAndContinue st is only present once?
Read more >Java Feature Spotlight: Pattern Matching - InfoQ
Pattern matching addresses a long-standing gap in the object model by bringing destructuring -- the dual of construction -- into the object ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Released in v2.1.0. Thanks again, @TeoTN!
I think at this time, it would be better to avoid the extra complexity as you mention. I may want to explore that behavior in the future, but let’s keep it simple for now. We’ll need to make sure devs are aware of that behavior, so they can write their sagas appropriately.
What are your thoughts on renaming the option, though? I’m not a huge fan of
shouldFallThrough
. What do you think ofmatchAll
instead?