Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
import * as tslib_1 from "tslib";
import { action, observable } from 'xmobx/mobx';
import { isFunction } from '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 (isFunction(onValidFormBlur)) {
          onValidFormBlur(props, state);
        }
      }
    };
  }

  setShippingAddressForm(form) {
    this.shippingAddress = form;
    console.log('[Shipping Address] setShippingAddressForm()', this);
  }

}

tslib_1.__decorate([observable], ShippingAddressFormState.prototype, "shippingAddress", void 0);

tslib_1.__decorate([action], ShippingAddressFormState.prototype, "setShippingAddressForm", null);

tslib_1.__decorate([action.bound], ShippingAddressFormState.prototype, "handleShippingAddressFormBlur", void 0); // Object Creation


const shippingAddressFormState = new ShippingAddressFormState();
export { shippingAddressFormState };
export default shippingAddressFormState; //# sourceMappingURL=state.js.map