Repository URL to install this package:
|
Version:
2.0.4 ▾
|
"use strict";
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
var c = arguments.length,
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", {
value: true
});
const mobx_1 = require("xmobx/mobx");
const exotic_1 = require("exotic");
class ShippingAddressFormState {
constructor() {
this.shippingAddress = {};
this.handleShippingAddressFormBlur = () => {
const {
validateForm,
state,
props
} = this.shippingAddress;
const {
onValidFormBlur
} = props;
const isValidForm = validateForm();
if (isValidForm === true) {
console.log('[Shipping Address] onBlur serialized data', state.toSerialized());
if (exotic_1.isFunction(onValidFormBlur)) {
onValidFormBlur(props, state);
}
}
};
}
setShippingAddressForm(form) {
this.shippingAddress = form;
console.log('[Shipping Address] setShippingAddressForm()', this);
}
}
__decorate([mobx_1.observable], ShippingAddressFormState.prototype, "shippingAddress", void 0);
__decorate([mobx_1.action], ShippingAddressFormState.prototype, "setShippingAddressForm", null);
__decorate([mobx_1.action.bound], ShippingAddressFormState.prototype, "handleShippingAddressFormBlur", void 0); // Object Creation
const shippingAddressFormState = new ShippingAddressFormState();
exports.shippingAddressFormState = shippingAddressFormState;
exports.default = shippingAddressFormState; //# sourceMappingURL=state.js.map