
BlockquoteBaseMeta is a generic class for sharing information across the DOM tree, inspired by Polymer's iron-meta.
It employs the monostate pattern to allow any instance to access the shared information.
The class instances hold the actual data. They must be created before attempting to access them.
BlockquoteBaseMeta uses a Map to store the data. Unlike an Object, a Map allows keys of any type.

import { BlockquoteBaseMeta } from '@blockquote-web-components/blockquote-base-meta';
const myDefault = new BlockquoteBaseMeta({
key: 'basic',
value: 'foo/bar',
});
console.log(myDefault.byKey('basic'));
import { BlockquoteBaseMeta } from '@blockquote-web-components/blockquote-base-meta';
const myDefault = new BlockquoteBaseMeta({
key: 'basic',
value: 'foo/bar',
});
console.log(myDefault.value);
The list getter returns an array of all values stored in the BlockquoteBaseMeta instance.
import { BlockquoteBaseMeta } from '@blockquote-web-components/blockquote-base-meta';
const myDefault = new BlockquoteBaseMeta({
type: 'three',
key: 'basic',
value: 'foo/bar',
});
console.log(myDefault.list);
import { BlockquoteBaseMeta } from '@blockquote-web-components/blockquote-base-meta';
const myDefault = new BlockquoteBaseMeta({
type: 'one',
key: 'basic',
value: 'foo/bar',
});
console.log(myDefault.objectList);
import { BlockquoteBaseMeta } from '@blockquote-web-components/blockquote-base-meta';
const keyInfo = { id: 'dsfaskj0' };
const myDefault = new BlockquoteBaseMeta({
type: 'two',
key: keyInfo,
value: 'foo/bar',
});
console.log(myDefault.mapList);
| Name |
Privacy |
Type |
Default |
Description |
Inherited From |
types |
|
Map<unknown, Map<unknown, unknown>> |
|
|
|
uuid |
|
string |
|
|
|
| Name |
Privacy |
Type |
Default |
Description |
Inherited From |
type |
|
unknown |
type |
Type of Meta |
|
key |
|
unknown |
key |
Key for Meta |
|
value |
|
unknown |
|
Sets value to instance type and key |
|
list |
|
unknown[] |
|
Returns a list (Array) of the values for that instance `type` |
|
mapList |
|
Map<unknown, unknown> |
|
Returns a list (Map) for that instance `type` |
|
objectList |
|
Record<string, unknown> |
|
Returns a list (Object) for that instance `type` |
|
| Name |
Privacy |
Description |
Parameters |
Return |
Inherited From |
byKey |
|
Returns the value of the provided key for that instance `type` |
key: unknown |
unknown |
|
Private API
| Name |
Privacy |
Type |
Default |
Description |
Inherited From |
__key |
private |
unknown |
|
|
|
| Kind |
Name |
Declaration |
Module |
Package |
js |
BlockquoteBaseMeta |
BlockquoteBaseMeta |
src/BlockquoteBaseMeta.ts |
|
| Kind |
Name |
Declaration |
Module |
Package |
js |
BlockquoteBaseMeta |
BlockquoteBaseMeta |
./BlockquoteBaseMeta.js |
|