Closed softwarespot closed 9 years ago
This is handled by the checks against the options.localCache value, which determines what gets set in storage or value (depending on whether we're in the ajaxprefilter or the ajaxtransport function).
Since undefined logically evaluates as false (i.e. (!!undefined === false) === true
), if localCache hasn't been included in the ajax options, the checks against the store or value in each function will ensure that the rest of the logic of either of these blocks won't be carried out, without the need for an additional explicit check for undefined.
You're correct. I am just too explicit with these things I guess.
If the user includes the function on each page, but doesn't require each ajax request to be 'cached', then more than likely they will not include localCache in the ajax options. Therefore a check for undefined should perhaps be done before anything else.