PHP Classes

File: client/src/app/stores/ErrorsStore.ts

Recommend this page to a friend!
  Classes of mohammad anzawi   PHP Wallet API and Application   client/src/app/stores/ErrorsStore.ts   Download  
File: client/src/app/stores/ErrorsStore.ts
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Wallet API and Application
Application to manage a wallet by calling an API
Author: By
Last change:
Date: 2 years ago
Size: 682 bytes
 

Contents

Class file image Download
import {makeAutoObservable, runInAction} from "mobx"; import ErrorResponse from "../models/ErrorResponse"; export default class ErrorsStore { hasErrors: boolean = false; errors: ErrorResponse | null = null constructor() { makeAutoObservable(this) } // set errors setErrors = (errors: ErrorResponse ) => { runInAction(() => { this.hasErrors = true this.errors = errors }) } // get errors getErrors = () => { return this.errors } // reset errors reset = () => { runInAction(() => { this.hasErrors = false this.errors = null }) } }