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
    • can-simple-map
      • prototype
        • attr
    • 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-simple-map
  • / On this page
    • can-simple-map

      module

      A performant live-bound map.

      • source

      new SimpleMap([props])

      Creates a new instance of can.SimpleMap.

      Parameters

      1. props {Object}:

        Properties and values to seed the Observe with.

      Returns

      {can.SimpleMap}:

      An instance of can.SimpleMap with the properties from props.

      SimpleMap.extend([name,] [staticProperties,] instanceProperties)

      Creates a new extended constructor function.

      Use

      SimpleMap provides a way to create an Observable whose properties can be changed using attr.

      var map = new SimpleMap({ age: 29 });
      
      map.on('age', function(ev, newVal, oldVal) {
          newVal; // 30
          oldVal; // 29
      });
      
      foo.attr('age'); // 29
      
      map.attr('age', 30);
      

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