var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _initializerDefineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/initializerDefineProperty"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _applyDecoratedDescriptor2=_interopRequireDefault(require("@babel/runtime/helpers/applyDecoratedDescriptor"));var _initializerWarningHelper2=_interopRequireDefault(require("@babel/runtime/helpers/initializerWarningHelper"));var _mobx=require("mobx");var _reactNative=require("react-native");var _api=require("../../services/api");var _class,_descriptor,_descriptor2;var Store=(_class=function(){function Store(){(0,_classCallCheck2.default)(this,Store);(0,_initializerDefineProperty2.default)(this,"isLoading",_descriptor,this);(0,_initializerDefineProperty2.default)(this,"data",_descriptor2,this);}return(0,_createClass2.default)(Store,[{key:"getNotification",value:function getNotification(){var response,_t;return _regenerator.default.async(function(_context){while(1)switch(_context.prev=_context.next){case 0:this.isLoading=true;_context.prev=1;_context.next=2;return _regenerator.default.awrap(_api.Api.getInstance().getNotification());case 2:response=_context.sent;this.isLoading=false;if(response.kind==='ok'){if(response.data.meta.errorCode===200){this.data=response.data.data;}else{_reactNative.Alert.alert('Thông báo',response.data.meta.errorMessage);}}else{}_context.next=4;break;case 3:_context.prev=3;_t=_context["catch"](1);this.isLoading=false;console.log(_t);case 4:case"end":return _context.stop();}},null,this,[[1,3]],Promise);}}]);}(),_descriptor=(0,_applyDecoratedDescriptor2.default)(_class.prototype,"isLoading",[_mobx.observable],{configurable:true,enumerable:true,writable:true,initializer:function initializer(){return false;}}),_descriptor2=(0,_applyDecoratedDescriptor2.default)(_class.prototype,"data",[_mobx.observable],{configurable:true,enumerable:true,writable:true,initializer:function initializer(){return[];}}),(0,_applyDecoratedDescriptor2.default)(_class.prototype,"getNotification",[_mobx.action],Object.getOwnPropertyDescriptor(_class.prototype,"getNotification"),_class.prototype),_class);var notificationStore=new Store();var _default=exports.default=notificationStore;
//# sourceMappingURL=store.js.map