You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • i==3

    Ahh, right! It still makes me cringe a bit :) Maybe just add a comment as to why it's like that?

    If the OneWire.write(Array) is added it'd actually simplify that a lot.

    Does the delay after writing seem to be a common thing? If so it might be worth adding a 'finished' callback to the API?

    if you don't export the whole class, then you can't add things to the prototype?

    Well, you can, it's just ever so slightly more difficult:

    function A() {
    }
    
    function getA() {
      return new A();  
    }
    var a= getA();
    a.__proto__.constructor.prototype.bob = 42;
    
    a.bob
    // 42
    

    Personally I'm not sure it's really worth the extra effort and memory usage to make it a tiny bit easier for the few people who would want to extend the basic class.

About

Avatar for Gordon @Gordon started