Skip to content
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

Add a context method #176

Open
KenEucker opened this issue Mar 8, 2022 · 0 comments
Open

Add a context method #176

KenEucker opened this issue Mar 8, 2022 · 0 comments

Comments

@KenEucker
Copy link
Owner

KenEucker commented Mar 8, 2022

Is your feature request related to a problem? Please describe.

Add a context method that returns a BikeTagClient object with referrer methods for helpful mutations of data that are being used outside of the biketag-api.

Describe the solution you'd like

Add the following interface:

const authorization = 'someauthvalue'
const source = 'imgur'
const opts = {
  game: 'portland',
  source,  
}

const biketag = new BikeTagClient(opts)
const portland =
const {
  game,
  currentBikeTag,
  tags,
  ambassadors,
  profile,
} = biketag.context({ source, authorization })

Describe alternatives you've considered
The community of BikeTag Developers (me, also me. LoL) are already solving for these solutions by using the API and for a single page application, all of these items are needed while multiple requests to the given source might be made for the same resources.

Additional context
See the biketag-vue project's implementation for currentBikeTag and use of authorization values for getting the profile information, for example.

https://github.com/KenEucker/biketag-vue/blob/production/functions/current.ts
https://github.com/KenEucker/biketag-vue/blob/develop/functions/profile.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant