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

Need dock.badge() and dock.bounce() API #46

Closed
dgraham opened this issue Aug 2, 2013 · 5 comments
Closed

Need dock.badge() and dock.bounce() API #46

dgraham opened this issue Aug 2, 2013 · 5 comments

Comments

@dgraham
Copy link

dgraham commented Aug 2, 2013

No description provided.

@zcbenz zcbenz closed this as completed in b1f88d6 Aug 6, 2013
@zcbenz
Copy link
Member

zcbenz commented Aug 6, 2013

See https://github.com/atom/atom-shell/wiki/app#appdockbouncetype for the new dock API.

@dgraham
Copy link
Author

dgraham commented Aug 6, 2013

Getters and setters are uncommon in JavaScript. Instead of setBadge and getBadge, can we have a badge() method that does this?

badge: (text) ->
  if text
    # set the text
  return theBadgeText()

# sets the badge
dock.badge('42')

# gets the badge
text = dock.badge()

@probablycorey
Copy link

We've never adopted the jquery one-function-as-getter-and-setter style in
Atom. We may be breaking JavaScript patterns, but I'd rather keep new API
methods consistent with the old ones. But if you think that is crazy feel
free to school @github/atom.

@nathansobo
Copy link

We've avoided the jQuery style ambiguous getter/setter throughout the Atom
codebase, for various reasons:

  • It complicates the implementation of getters and setters by making the
    same function serve two roles
  • It consumes the most likely name you would want to use for the actual
    property being set. If I want to have a @badge instance variable, I can't
    because there's already a method named badge.

On Tue, Aug 6, 2013 at 11:30 AM, David Graham notifications@github.comwrote:

Getters and setters are uncommon in JavaScript. Instead of setBadge and
getBadge, can we have a badge() method that does this?

badge: (text) ->
if text
# set the text
return theBadgeText()

sets the badgedock.badge('42')

gets the badgetext = dock.badge()


Reply to this email directly or view it on GitHubhttps://github.com//issues/46#issuecomment-22200340
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@probablycorey @nathansobo @dgraham @zcbenz and others