I would like to cache the computed observable value for certain time (1-2 sec). Is it possible to do some thing similar using extenders?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could create a custom version of the computed observable object by wrapping it and replacing some of the functions.
See this article for an example of the approach. It’s not used to do exactly what you ask, but the general idea should work. Simply replace the functionality showcased in the article with something which caches the data into a variable with a timestamp variable.
Though I think it should be noted that unless you’re doing very heavy calculation or some other demanding tasks, I don’t think you will be able to gain a huge benefit from caching the value.