Caching Observables/Promisesby@msarica
1,466 reads

Caching Observables/Promises

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Typescript decorator is a special kind of declaration that can be attached to a class declaration, method, accessor, property, or parameter. Decorators use the form @expression, where expression must evaluate to a function that will be called at runtime with information about the decorated declaration. We can create a custom decorator and drop it on a method and be done with it. We check if value is defined, if it is, return the value. If not, call the original function to get the value and return it.

Company Mentioned

Mention Thumbnail
featured image - Caching Observables/Promises
Mehmet HackerNoon profile picture

@msarica

Mehmet

msarica.com


Receive Stories from @msarica

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!