/**
 * Created by rockyl on 2019-09-25.
 */

export default function (props = {}) {
	const {mutationTypes = []} = props;
	return (store) => {
		store.subscribe((mutation, state) => {
			if (mutationTypes.includes(mutation.type)) {
				store.dispatch('saveToLocal')
			}
		})
	}
}
