Skip to content

Commit

Permalink
Remvoe IIFE from data.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit2sharma95 committed Nov 20, 2020
1 parent 123e298 commit 61c1c5d
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions js/src/dom/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,16 @@
* ------------------------------------------------------------------------
*/

const mapData = (() => {
const map = new Map()
return {
set(element, data) {
map.set(element, data)
},
get(element) {
return map.get(element) || null
},
delete(element) {
map.delete(element)
}
}
})()
const mapData = new Map()

const Data = {
setData(instance, data) {
mapData.set(instance, data)
export default {
setData(element, data) {
mapData.set(element, data)
},
getData(instance) {
return mapData.get(instance)
getData(element) {
return mapData.get(element) || null
},
removeData(instance) {
mapData.delete(instance)
removeData(element) {
mapData.delete(element)
}
}

export default Data

0 comments on commit 61c1c5d

Please sign in to comment.