import { observable, action, computed } from 'mobx'; export default class WithdrawStore { @observable isLoading = false; @observable data = { amount: '', bank_account_number: '', bank_name: '', destination_user_bank_id : '' }; @observable bank = { name: '', account_number: '' } constructor(context) { this.context = context; this.http = context.http; } @action createWithdraw() { this.isLoading = true; return this.http.post("withdraw/create", this.data) .then(res => { this.isLoading = false; return res; }) .catch(err => { this.isLoading = false; throw err; }) } }