import { observable, action } from 'mobx'
import {
  DialogData,
  PromptDialogOptions,
  DialogTypes,
  MessageBoxDialogOptions
} from './interfaces'

let id = 0
export default class DialogStore {
  @observable currentData?: DialogData

  @action
  setData(data?: DialogData) {
    this.currentData = data
  }

  prompt(options: PromptDialogOptions) {
    this.setData({
      id: id++,
      type: DialogTypes.Prompt,
      ...options
    })
  }

  messageBox(options: MessageBoxDialogOptions) {
    this.setData({
      id: id++,
      type: DialogTypes.MessageBox,
      ...options
    })
  }

  closeDialog() {
    this.setData()
  }
}

import { observable, action } from 'mobx'
import {
  DialogData,
  PromptDialogOptions,
  DialogTypes,
  MessageBoxDialogOptions
} from './interfaces'

let id = 0
export default class DialogStore {
  @observable currentData?: DialogData

  @action
  setOptions(data?: DialogData) {
    this.currentData = data
  }

  prompt(options: PromptDialogOptions) {
    this.setOptions({
      id: id++,
      type: DialogTypes.Prompt,
      ...options
    })
  }

  messageBox(options: MessageBoxDialogOptions) {
    this.setOptions({
      id: id++,
      type: DialogTypes.MessageBox,
      ...options
    })
  }

  closeDialog() {
    this.setOptions()
  }
}

--- 
+++ 
@@ -11,12 +11,12 @@
   @observable currentData?: DialogData
 
   @action
-  setOptions(data?: DialogData) {
+  setData(data?: DialogData) {
     this.currentData = data
   }
 
   prompt(options: PromptDialogOptions) {
-    this.setOptions({
+    this.setData({
       id: id++,
       type: DialogTypes.Prompt,
       ...options
@@ -24,7 +24,7 @@
   }
 
   messageBox(options: MessageBoxDialogOptions) {
-    this.setOptions({
+    this.setData({
       id: id++,
       type: DialogTypes.MessageBox,
       ...options
@@ -32,6 +32,6 @@
   }
 
   closeDialog() {
-    this.setOptions()
+    this.setData()
   }
 }
Rename setOptions method to setData
