0

I have the following definitions:

  • "none" - do nothing
  • "inject" - re-inject the items back into the data store

The above definition is taken from the official documentation. I don't understand what's the point of re-injecting items back into the DS? To a consumer of the resource, how does it differ from doing nothing?

At first impression, I thought re-injecting would update the lastModified timestamp but it doesn't, as verified by running a sample app.

tamakisquare
  • 16,659
  • 26
  • 88
  • 129

1 Answers1

1

Sorry, but the documentation was misleading, and has now been fixed.

What the reap method's inject option actually does is reset expired items' expiry timeout to the value of the maxAge option, whereas the none option does not.

jdobry
  • 1,041
  • 6
  • 17
  • Thanks for your answer, jdobry. Now that I see the difference between how the two `reapAction` options work, it's still unclear to me in what scenarios I would choose one over the other. To a consumer of a DS, regardless which option is in use, expired items are always left untouched in the DS. Btw, **js-data** is a great data modelling framework. Although I have only been using it for a few days, I am already in love with it. Great work. Thank you. – tamakisquare Mar 28 '16 at 19:16
  • Yep! I myself have never used those two particular options. I prefer to manually manage when and what cached data needs to be flushed. – jdobry Apr 02 '16 at 01:44