DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
    • can-component
    • can-compute
      • computeSettings
      • compute
        • methods
          • addEventListener
          • off
          • on
          • removeEventListener
        • events
          • change
    • can-connect
    • can-define
    • can-define/list/list
    • can-define/map/map
    • can-route
    • can-route-pushstate
    • can-set
    • can-stache
    • can-stache/helpers/route
    • can-stache-bindings
  • Ecosystem
  • Infrastructure
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Core
  • /
  • can-compute
  • /
  • compute
  • /
  • off
  • / On this page
    • off

      function

      Remove an event listener.

      • source

      compute.off(eventType, handler)

      var age = compute(33);
      
      var handler = function(ev, newVal, oldVal){
          ev //-> {type: "change", batchNum: 5}
          newVal //-> 34
          oldVal //-> 33
      }
      
      age.on('change', handler);
      
      age(34);
      
      age.off('change', handler)
      

      Parameters

      1. eventType {String}:

        The name of the event to bind on, usually change.

      2. handler {function(event, args...)}:

        The handler to be removed. This has to be the same function that was passed to on.

      Returns

      {compute(newVal)}:

      The compute instance.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.