Skip to content

EN-10353: Add include to to stops, allowing patternHrefs in stop objects #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

wisc-gmv
Copy link
Contributor

@wisc-gmv wisc-gmv commented May 22, 2025

You can now do the following

const stops = api
  .customer(code)
  .stops()
  .include('patternHrefs') // Get href list of patterns that use this stop
  .getPage()
  .then(stops => /* stops now have .patternHrefs (string[]) that use the stop) */);

This lets you figure out what pattern the stop is associated to without getting patterns which returns an href of the stop with the pattern in the stop href instead of the direct stop href. This may allow O(1) searches on the client for patterns related to a stop (if patterns are in a hashmap) instead of iterating through stop arrays in each pattern.

Cooper Scott added 3 commits May 16, 2025 09:40
* add .include to stopsContext
* add { include: string } option to stop .fetch()
* add tests in get_stops.test.js
* update readme to use development tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants