plugin-axios icon indicating copy to clipboard operation
plugin-axios copied to clipboard

Merge configs

Open innovate-invent opened this issue 4 years ago • 1 comments

Currently object unpacking is being used to combine all of the configs. This does not allow setting axios settings higher up in the config stack that are objects. For example, if I want a global param for all requests I would expect to be able to go:

VuexORM.use(VuexORMAxios, {
	params: {
		key: "foo"
	}
});

Currently any lower config specifying params will overwrite this. Something along the lines of lodash merge should be used. If I wanted to unset a setting higher up I can simply do something like:

Model.get('url', {
	params: {
		key: null
	}
});

innovate-invent avatar Jan 08 '20 21:01 innovate-invent

Thanks! Yea good idea. And thanks for the PR too! I'll check the PR.

kiaking avatar Feb 26 '20 05:02 kiaking