Closed mably closed 7 years ago
Thanks for the suggestion! Do you have any thoughts on how that might look? Do you have any examples of integrating the current version of konami-js in a SPA?
We used it on one of our app to switch from test to prod environment ;)
It was used globally, changed a value in local storage and then reloaded the app (window.reload).
The problem is that it was being triggered by normal users navigating thru our app, a bit annoying ;)
So it could be interesting to be able to enable/disable it by adding a simple enable(bool)
method or eventually allow to reset the current Konami inputs when changing screen with a clearInput()
method for example.
That's an interesting use case :). You're not the only company I've heard of using it that way! Though using it to switch from test to production sounds kind of scary. You're braver than me!
A feature like you're describing would be easy enough to add. But I wonder if it makes more sense to solve it within the context of the SPA itself, rather than add it as a feature to konami-js? There are a lot of factors to consider I know. What framework are you using, if I might ask?
It's an Angular app. Actually we had to remove the Konami part once a few of our testers switched to dev env accidentally ;)
You can check the #34 Pull Request ;)
Excellent! Will give it a try :)
I've merged #34. Give it another shot sometime @mably. Thanks for the update @FBerthelot!
I will, thanks 😄
Could be really useful when integrated into a single page application (SPA).
You might want to enable the Konami code only on some screens or pages.
It could also be useful to be able to reset the current inputs.