Skip to content

Commit

Permalink
Prepare release 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jsor committed Jan 7, 2016
1 parent 595eed4 commit d7e6955
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
29 changes: 25 additions & 4 deletions dist/carty.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Carty - v0.5.0 - 2016-01-05
* Carty - v0.5.1 - 2016-01-07
* http://sorgalla.com/carty/
* Copyright (c) 2015-2016 Jan Sorgalla; Licensed MIT
*/
Expand Down Expand Up @@ -133,9 +133,9 @@ return /******/ (function(modules) { // webpackBootstrap
var _items = [];
var _ready;

cart.on(['load', 'add', 'update', 'remove', 'clear'], emit.bind(undefined, 'change'));
cart.on(['loaded', 'added', 'updated', 'removed', 'cleared'], emit.bind(undefined, 'changed'));
cart.on(['loadfailed', 'addfailed', 'updatefailed', 'removefailed', 'clearfailed'], emit.bind(undefined, 'changefailed'));
cart.on(['load', 'add', 'update', 'remove', 'clear', 'checkout'], emit.bind(undefined, 'change'));
cart.on(['loaded', 'added', 'updated', 'removed', 'cleared', 'checkedout'], emit.bind(undefined, 'changed'));
cart.on(['loadfailed', 'addfailed', 'updatefailed', 'removefailed', 'clearfailed', 'checkoutfailed'], emit.bind(undefined, 'changefailed'));

cart.options = options.bind(cart, _options);

Expand Down Expand Up @@ -189,6 +189,12 @@ return /******/ (function(modules) { // webpackBootstrap
return cart;
};

cart.checkout = function(data) {
ready(checkout.bind(cart, data));

return cart;
};

cart.load = function() {
if (!_ready) {
_ready = load();
Expand Down Expand Up @@ -429,6 +435,21 @@ return /******/ (function(modules) { // webpackBootstrap
});
}

function checkout(data) {
return emit('checkout').then(function() {
return resolve(
_options.storage && _options.storage.checkout && _options.storage.checkout(data, cart)
).then(emit.bind(cart, 'checkedout'), function(e) {
emit('checkoutfailed', e);
return reject(e);
})['catch'](function() {
// Catch checkedout event listener rejections
});
}, function() {
// Catch checkout event listener rejections
});
}

function normalize(attr) {
if (type(attr) === 'function') {
attr = attr(cart);
Expand Down
Loading

0 comments on commit d7e6955

Please sign in to comment.