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

allow custom storer interface #11

Merged
merged 7 commits into from
Jun 30, 2024
Merged

allow custom storer interface #11

merged 7 commits into from
Jun 30, 2024

Conversation

BolajiOlajide
Copy link
Owner

This is the last feature we need to add before going GA.

This allows people to pass their own custom store function (SQL, Airtable e.t.c) that satisfies our IStorer interface.

@BolajiOlajide BolajiOlajide self-assigned this Jun 29, 2024
README.md Outdated
streamerArgs: {
clientId: 'foo',
clientSecret: 'bar',
refreshToken: 'baz',
},
storer: // (optional) custom
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also what do you think about exposing the IStorer interface? If we do that, we can update the example to something like this.

import { NowPlaying, Providers, IStorer } from '@BolajiOlajide/now-playing'

let myCustomStorer: IStorer

const np = new NowPlaying(Providers.SPOTIFY, {
  useCache: false, // (optional) default is true
  cacheDuration: 30000, // (optional) in milliseconds
  streamerArgs: {
    clientId: 'foo',
    clientSecret: 'bar',
    refreshToken: 'baz',
  },
  storer: myCustomStorer // (optional) custom storage implementation
})

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! THis is clearer I guess.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@lilpolymath lilpolymath merged commit a863661 into main Jun 30, 2024
3 checks passed
@lilpolymath lilpolymath deleted the bo/allow-custom-istorer branch June 30, 2024 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants