Comments (2)
Yeah, I'm aware of that Docs entry and I feel ambivalent about it 😑. When I was designing this, I had a long discussion with myself on what I should name everything and how to handle this issue. The primary goal is for this module to be elegant, simple, and concise. Coming up with some annoying vendor prefix (Hacked? hbc?) is annoying, and adding a module name prefix is double annoying on top of being redundant. I suppose I could just drop the $
on everything and capitalize, but Pascal case in JavaScript seems so lame, so mid 2000s Microsoft, don't you think?
Granted, my gripes are based on stylistic imperatives rather than functional ones. I did a limited and unofficial survey of popular modules back then to see if folks decided to buck the rules or play by them, and most, it seemed, to just do what I did. If you can't beat 'em, join 'em. And then blame everyone else when it blows up in your face because of a collision, right?
Anyways, the advice in the docs is sound, I just disliked implementing their recommendation. I guess I figured I'd let it be a problem when it became a problem, but perhaps I'm being a bit reckless. If we do it, we should do it soon and with a suite of other breaking changes (the upcoming 1.0 release has those).
To get the ball rolling, the proposed changes would be:
$idle
-> Idle
$idleProvider
-> IdleProvider
$keepalive
-> Keepalive
$keepaliveProvider
-> KeepaliveProvider
$keepaliveResponse
-> KeepaliveResponse
$idleStart
-> IdleStart
$idleEnd
-> IdleEnd
$idleWarn
-> IdleWarn
$idleTimeout
-> IdleTimeout
ngIdleCountdown
-> IdleCountdown
from ng-idle.
Thanx for the in-depth reasoning Mike.
I totally agree with "if you can't win them, join them"
But lately more and more ng modules I see just use the Capital notation like you proposed in the changes, and I have to say, it looks just a little bit cleaner for me.
I agree that prefixing all of this with a vendor prefix of sorts will be messy, also maybe not super needed as you don't expose anything to the UI.
so my vote is on your suggestion!
👍
from ng-idle.
Related Issues (20)
- [Question] Keepalive event in multiple tabs
- Issue in multiple tabs HOT 2
- Angular 5 - generic component child used in several main component not working
- Not want to reset timer in case of user intervention in app HOT 1
- Any plans to upgrade to Angular 6 HOT 1
- AngularJs - Unknown provider : IdleProvider HOT 1
- ng-Idle/core onIdleStart and onTimout function executing multiple times
- Having issues with ng-idle/core onIdleEnd & Mat-Dialog HOT 1
- keepalive onPingResponse subscribe response doesnt work right
- set url string parameter of http() dynamically
- Using JS Alert does not timeout until OK is Clicked HOT 1
- Key Management: Hardcoded Encryption Key HOT 1
- Select box (with multiple selections) not working properly
- unable to mock inactivity time with cypress clock/tick()
- How to use localstorageservice to handle in multiple tabs in the same browser HOT 1
- Incompatible with Angular 10 HOT 1
- Don't work with IFRAME HOT 3
- Keepalive interval not respected
- Implement a privacy preserving mode functionality avoiding usage of the persistent browser localStorage
- ng-idle not working for iOS in Ionic cordova
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-idle.