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.

[Feature Request] Fall through pattern matching

See original GitHub issue

Hi! 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:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jfairbankcommented, May 3, 2017

Released in v2.1.0. Thanks again, @TeoTN!

1reaction
jfairbankcommented, Apr 17, 2017

Another story is that it’d be a kind of ‘conditional fall through’ which may be slightly confusing

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 of matchAll instead?

Read more comments on GitHub >

github_iconTop 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 >

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