File tree Expand file tree Collapse file tree 3 files changed +9
-13
lines changed
Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " vue-ls" ,
3- "version" : " 2.2.21 " ,
3+ "version" : " 2.3.0 " ,
44 "description" : " Vue plugin for work with LocalStorage from Vue context" ,
55 "main" : " dist/vue-ls.js" ,
66 "authors" : [
Original file line number Diff line number Diff line change 11{
22 "name" : " vue-ls" ,
3- "version" : " 2.2.21 " ,
3+ "version" : " 2.3.0 " ,
44 "description" : " Vue plugin for work with LocalStorage from Vue context" ,
55 "main" : " dist/vue-ls.js" ,
66 "jsnext:main" : " src/index.js" ,
Original file line number Diff line number Diff line change @@ -20,21 +20,17 @@ export default class {
2020 static emit ( event ) {
2121 const e = event || window . event ;
2222
23- const fire = ( listener ) => {
24- let newValue ;
25- let oldValue ;
26-
23+ const getValue = ( data ) => {
2724 try {
28- newValue = JSON . parse ( e . newValue ) . value ;
25+ return JSON . parse ( data ) . value ;
2926 } catch ( err ) {
30- newValue = e . newValue ;
27+ return data ;
3128 }
29+ } ;
3230
33- try {
34- oldValue = JSON . parse ( e . oldValue ) . value ;
35- } catch ( err ) {
36- oldValue = e . oldValue ;
37- }
31+ const fire = ( listener ) => {
32+ const newValue = getValue ( e . newValue ) ;
33+ const oldValue = getValue ( e . oldValue ) ;
3834
3935 listener ( newValue , oldValue , e . url || e . uri ) ;
4036 } ;
You can’t perform that action at this time.
0 commit comments