Function: withCache()
withCache<
C>(spreadsheet,cache,options):TSpreadsheet
Add caching capability to the spreadsheet object.
Type Parameters
| Type Parameter |
|---|
C extends TCacheAdapter |
Parameters
| Parameter | Type | Description |
|---|---|---|
spreadsheet | TSpreadsheet | A spreadsheet object |
cache | C | A cache adapter |
options | WithCacheOptions | - |
Returns
A spreadsheet object with underlying caching
Example
ts
const cache = new Map(); // Use Map as a simple in-memory cache
const sheets = withCache(Spreadsheet('google-sheets-id'), cache);
const output = sheets.get('sheet-name')