Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using object as key, use primitive instead #5

Closed
riker09 opened this issue Aug 23, 2017 · 2 comments
Closed

Avoid using object as key, use primitive instead #5

riker09 opened this issue Aug 23, 2017 · 2 comments

Comments

@riker09
Copy link

riker09 commented Aug 23, 2017

Great plugin, I enjoy using it. However, I installed a fresh copy directly from npm (npm install --save vue-notifyjs) and it fetched version 0.1.7. I was getting warnings in my browsers console that stated the key should not be a complex but a primitive type like string or integer.

Looking in the source code of the module in my node_modules/vue-notifyjs/dist I could find the culprit rather easy:

                        component: notification.component,
                        timestamp: notification.timestamp
                    },
                    key: notification, on: {
                        'close': function close() {
                            return _this.removeNotification(index);
                        }
                    }

I've manually changed key: notification to key: index and the error was gone. Now the funky bits click in: I forked your repo on GitHub and tried to create a pull request. But then I saw that your source code already contains a fix: You use the timestamp value of the notification to create a unique key. Very nice, but why is this not included on the NPM repo? I have never published anything on NPM so I can only assume that maybe you've uploaded the wrong version?

@cristijora
Copy link
Collaborator

cristijora commented Aug 23, 2017

Thanks for pointing that out @riker09 It seems that I didn't update the version after my latest changes 🦆
Just published a new version 0.1.8

@riker09
Copy link
Author

riker09 commented Aug 23, 2017

I can confirm that the error is now gone. Thank you! 👍

@riker09 riker09 closed this as completed Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants