DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
  • Infrastructure
    • can-construct
    • can-control
    • can-event
    • can-event/async/async
    • can-event/batch/batch
    • can-observation
      • types
        • getTrapped
        • Observed
      • static
        • add
        • addAll
        • ignore
        • isRecording
        • trap
      • prototype
        • start
        • stop
    • can-simple-map
    • can-util
    • can-view-callbacks
    • can-view-live
    • can-view-model
    • can-view-nodelist
    • can-view-parser
    • can-view-scope
    • can-view-target
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Infrastructure
  • /
  • can-observation
  • /
  • ignore
  • / On this page
    • ignore

      function
      • source

      Observation.ignore(fn)

      Creates a function that, when called, will prevent observations from being applied.

      var fn = Observation.ignore(function(){
        // This will be ignored
        Observation.add(obj, "prop1");
      });
      
      fn();
      Observation.trapCount(); // -> 0
      

      Parameters

      1. fn {function}:

        Any function that contains potential calls to [Observation.add].

      Returns

      {function}:

      A function that is free of observation side-effects.

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