Skip to content

Commit

Permalink
Merge pull request #13 from MahdiFakhr/master
Browse files Browse the repository at this point in the history
fix singleton pattern cause  multiple instances
  • Loading branch information
mediv0 authored Jul 27, 2020
2 parents d1fc5b9 + a904d3e commit 3c2fc84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xmodal-vue",
"version": "1.0.1",
"version": "1.0.2",
"private": false,
"description": "🚀 a simplistic and easy to use wrapper around your components that will help you create custom modals, from your components",
"author": "Mahdi Fakhr",
Expand Down
8 changes: 5 additions & 3 deletions src/store.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
class Store {
constructor() {
if (Store.instance == null) {
this.modals = new Map();
if (Store.exists) {
return Store.instance;
}
return Store.instance;
Store.exists = true;
Store.instance = this;
this.modals = new Map();
}

// save new modal in the map
Expand Down

0 comments on commit 3c2fc84

Please sign in to comment.