function `getBucket`
function getBucket(bucketName: string, [areaName = 'local']) => Bucket
Returns a Bucket
.
bucketName
Type: string
A unique id for this bucket.
[areaName]
Type: "local"
or "sync"
Default: "local"
Choose which native Chrome API storage area
to use.
// JavaScript
const localBucket = getBucket('bucket1')
const syncBucket = getBucket('bucket2', 'sync')
// TypeScript
const localBucket = getBucket<{ a: string }>('bucket1')
const syncBucket = getBucket<{ b: number }>('bucket2', 'sync')