-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
README.md
Outdated
streamerArgs: { | ||
clientId: 'foo', | ||
clientSecret: 'bar', | ||
refreshToken: 'baz', | ||
}, | ||
storer: // (optional) custom |
There was a problem hiding this comment.
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
})
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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.