Closed erikian closed 1 year ago
Thanks. I'll check it out :)
Looks good. Just one thing: Could be nice to allow to override other axios options too if desired.
const instance = new PushReceiver({
axios: {
proxy: {
protocol: 'http',
host: 'somehost',
port: 1234,
auth: {
username: 'foo',
password: 'bar',
},
},
// ...other axios options
},
// ...other options
})
I actually had this initially:
axiosConfig?: Omit<
AxiosRequestConfig,
'url' | 'method' | 'headers' | 'data' | 'responseType'
>
This would prevent users from passing in options that shouldn't be overridden (well, as long as Typescript is used as intended). What do you think?
I've changed it to axiosConfig
and placed it before the options that shouldn't be overridden.
Sounds perfect. Thanks. I'll do some short testing and merge it.
Not sure if you accept PRs here, but since I had to fork this project to add a feature I need, I thought to contribute back.
This allows users to specify the proxy options to be passed to axios when doing FCM/GCM requests:
I also fixed the signatures for the
doRegister
andpostRegister
functions.