Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

12/07/12: Off with the Backbone!

Sheel Choksi
Friday, December 7, 2012

Interestings

Backbone.off can unbind callbacks from all instances of a class instead of just the instance you want

If you set up some bindings such as

viewClass = Backbone.View.extend({...})
view1 = new viewClass();
view2 = new viewClass();
model.bind("event", view1.myFunction, view1)
model.bind("event", view2.myFunction, view2)

and then want to unbind one of the callbacks…

model.off("event", view1.myFunction)

you will unbind both callbacks. You need to use

model.off("event", view1.myFunction, view1)

This is fundamentally because of javascript prototypes that mean view1.myFunction == view2.myFunction

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

12/06/12: Prove your mohawk

Sheel Choksi
Thursday, December 6, 2012

Interestings

Regex for Unicode

Ruby 1.9 regexs can match Unicode Categories . Not filtering out Joƫlle in your validations has never been so easy (/p{L}/)!

Events

12/14: Railsbridge at Pivotal next weekend

Railsbridge is a monthly-ish workshop to teach programming, primarily focused at women.

December’s Railsbridge event will be at Pivotal SF on December 14-15.

All you pivots in the office know tons about Ruby and Rails. Please come to the workshop to spread your knowledge and be awesome!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Sheel Choksi

Sheel Choksi
San Francisco

Subscribe to Sheel's Feed

Author Topics

agile (2)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >