dsherret / ts-type-info

TypeScript AST and code generator [Deprecated]
MIT License
94 stars 8 forks source link

Cache info result #187

Open BzenkoSergey opened 8 years ago

BzenkoSergey commented 8 years ago

What about data caching?

example:

let result = tsTypeInfo.getInfoFromFiles([filePath], {});

// get json scheme
let resultJson = result.toJSON();

// cache the scheme
someStorage.set('tsTypeInfoData', resultJson);

// next use
let resultJson = someStorage.get('tsTypeInfoData');
let result = tsTypeInfo.getInfoFromJsonScheme(resultJson);
dsherret commented 8 years ago

I've been wondering about this. I'll look into it. I believe I will be able to generate the code for this using this: https://github.com/dsherret/ts-object-create (but it will probably need an improvement)