Skip to content

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

Closed

Description

@dgraham
No description provided.

Activity

  1. dgraham commented on Aug 6, 2013

    @dgraham
    Author

    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()
  2. probablycorey commented on Aug 6, 2013

    @probablycorey

    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.

  3. nathansobo commented on Aug 6, 2013

    @nathansobo

    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 [email protected]:

    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
    .

  4. added 2 commits that reference this issue on May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions