Hello in some function I've got code which save object {} to localForage which is nothing but asynchronous localStorage
if(vm.convertedColors[vm.convertedColors.length - 1].colorInRGB &&
vm.convertedColors[vm.convertedColors.length - 1].colorInHSL &&
vm.convertedColors[vm.convertedColors.length - 1].colorInHEX) {
$localForage.setItem('colors', {
inHSL: vm.convertedColors[vm.convertedColors.length - 1].colorInHSL,
inHEX: vm.convertedColors[vm.convertedColors.length - 1].colorInHEX,
inRGB: vm.convertedColors[vm.convertedColors.length - 1].colorInRGB
}).then(function() {
$rootScope.$emit('localForageUpdated');
});
}
This run ones after button click and store object colors. It is working good but when I change color and click button again I want it to save new colorsobject instead of replacing it how it's working now.
So I would like to save colors1 colors2 colors3 and so on. It can be array of objects. s.o.s