Skip to content

Commit

Permalink
chore: Bump to v1.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Trinh authored and Scott Trinh committed Feb 22, 2017
1 parent 6a42de3 commit 3640421
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 25 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<a name="1.3.4"></a>
# 1.3.4 (2017-02-22)


## Features

- Add defineDriver method for upstream consistency
([ac1c3b9c](https://github.com/ocombe/angular-localForage/commit/ac1c3b9cbd40ffa0fa6bd428d34d7bc9bd4d7a71),
[#105](https://github.com/ocombe/angular-localForage/issues/105))


## Performance Improvements

- Do not copy value on setItem
([6a42de38](https://github.com/ocombe/angular-localForage/commit/6a42de381e6969a13dfac07e2e04f1b9cd806b3a))


<a name="1.3.3"></a>
# 1.3.3 (2017-01-07)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-localforage",
"main": "dist/angular-localForage.js",
"version": "1.3.3",
"version": "1.3.4",
"homepage": "https://github.com/ocombe/angular-localForage",
"authors": [
"Olivier Combe <[email protected]>"
Expand Down
42 changes: 21 additions & 21 deletions dist/angular-localForage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* angular-localforage - Angular service & directive for https://github.com/mozilla/localForage (Offline storage, improved.)
* @version v1.3.3
* @version v1.3.4
* @link https://github.com/ocombe/angular-localForage
* @license MIT
* @author Olivier Combe <[email protected]>
Expand Down Expand Up @@ -120,34 +120,34 @@
throw new Error('If you set an array of keys, the values should be an array too');
}

var promises = [];
angular.forEach(key, function(k, index) {
promises.push(self.setItem(k, value[index]))
});

return $q.all(promises);
return $q.all(key.map(function (k, index) {
return self.setItem(k, value[index]);
}));
} else {
var deferred = $q.defer(),
args = arguments,
localCopy = typeof Blob !== 'undefined' && typeof ArrayBuffer !== 'undefined' && (value instanceof Blob || value instanceof ArrayBuffer) ? value : angular.copy(value);
localCopy = value;

//avoid $promises attributes from value objects, if present.
if(angular.isObject(localCopy) && angular.isDefined(localCopy.$promise)) {
delete localCopy.$promise; //delete attribut from object structure.
localCopy = angular.extend({}, value);
delete localCopy.$promise;
}

self._localforage.setItem(self.prefix() + key, localCopy).then(function success() {
if(notify.setItem) {
$rootScope.$broadcast('LocalForageModule.setItem', {
key: key,
newvalue: localCopy,
driver: self.driver()
});
}
deferred.resolve(localCopy);
}, function error(data) {
self.onError(data, args, self.setItem, deferred);
});
self._localforage.setItem(self.prefix() + key, localCopy)
.then(function success() {
if(notify.setItem) {
$rootScope.$broadcast('LocalForageModule.setItem', {
key: key,
newvalue: localCopy,
driver: self.driver()
});
}
deferred.resolve(localCopy);
})
.catch(function withError(error) {
self.onError(data, args, self.setItem, deferred);
});

return deferred.promise;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-localForage.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-localforage",
"version": "1.3.3",
"version": "1.3.4",
"description": "Angular service & directive for https://github.com/mozilla/localForage (Offline storage, improved.)",
"license": "MIT",
"main": "dist/angular-localForage.js",
Expand Down

0 comments on commit 3640421

Please sign in to comment.