Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. export default class Session {
  2.  
  3. static changes = []
  4.  
  5. static getState() {
  6. return new Promise((resolve, reject) => {
  7. resolve(this.changes.reduce((a, x) => Object.assign(a,x),{}))
  8. })
  9. }
  10.  
  11. static update(value) {
  12. this.changes.push(value)
  13. }
  14.  
  15. static showChanges() {
  16. this.changes.forEach((x)=> console.log(x))
  17. }
  18. }
  19.  
  20.  
  21.  
  22. Object.defineProperty(Session, 'changes',{
  23. writable: false,
  24. enumerable: true
  25. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement