Skip to main content
Version: 0.17

Class: Log

Logs track a series of unique events that have occurred. Each event is tracked based on its unique id. The log only tracks the ids but currently does not track any details.

Logs can automatically be persisted by assigning them a bucket.

Hierarchy​

  • Evented<"append" | "truncate" | "rollback" | "clear" | "change">

    ↳ Log

Constructors​

constructor​

• new Log(options?)

Parameters​

NameType
optionsLogOptions

Inherited from​

Evented<'append' | 'truncate' | 'rollback' | 'clear' | 'change'>.constructor

Defined in​

packages/@orbit/core/src/log.ts:33

Properties​

reified​

• reified: Promise<void>

Defined in​

packages/@orbit/core/src/log.ts:31

Accessors​

bucket​

• get bucket(): undefined | Bucket<string[]>

Returns​

undefined | Bucket<string[]>

Defined in​

packages/@orbit/core/src/log.ts:48


entries​

• get entries(): string[]

Returns​

string[]

Defined in​

packages/@orbit/core/src/log.ts:56


• get head(): string

Returns​

string

Defined in​

packages/@orbit/core/src/log.ts:52


length​

• get length(): number

Returns​

number

Defined in​

packages/@orbit/core/src/log.ts:60


name​

• get name(): undefined | string

Returns​

undefined | string

Defined in​

packages/@orbit/core/src/log.ts:44

Methods​

after​

â–¸ after(id, relativePosition?): string[]

Parameters​

NameTypeDefault value
idstringundefined
relativePositionnumber0

Returns​

string[]

Defined in​

packages/@orbit/core/src/log.ts:89


append​

â–¸ append(...ids): Promise<void>

Parameters​

NameType
...idsstring[]

Returns​

Promise<void>

Defined in​

packages/@orbit/core/src/log.ts:64


before​

â–¸ before(id, relativePosition?): string[]

Parameters​

NameTypeDefault value
idstringundefined
relativePositionnumber0

Returns​

string[]

Defined in​

packages/@orbit/core/src/log.ts:75


clear​

â–¸ clear(): Promise<void>

Returns​

Promise<void>

Defined in​

packages/@orbit/core/src/log.ts:158


contains​

â–¸ contains(id): boolean

Parameters​

NameType
idstring

Returns​

boolean

Defined in​

packages/@orbit/core/src/log.ts:170


emit​

â–¸ emit(event, ...args): void

Parameters​

NameType
eventEvent
...argsunknown[]

Returns​

void

Inherited from​

Evented.emit

Defined in​

packages/@orbit/core/src/evented.ts:29


listeners​

â–¸ listeners(event): Listener[]

Parameters​

NameType
eventEvent

Returns​

Listener[]

Inherited from​

Evented.listeners

Defined in​

packages/@orbit/core/src/evented.ts:30


off​

â–¸ off(event, listener?): void

Parameters​

NameType
eventEvent
listener?Listener

Returns​

void

Inherited from​

Evented.off

Defined in​

packages/@orbit/core/src/evented.ts:27


on​

â–¸ on(event, listener): () => void

Parameters​

NameType
eventEvent
listenerListener

Returns​

fn

â–¸ (): void

Returns​

void

Inherited from​

Evented.on

Defined in​

packages/@orbit/core/src/evented.ts:26


one​

â–¸ one(event, listener): () => void

Parameters​

NameType
eventEvent
listenerListener

Returns​

fn

â–¸ (): void

Returns​

void

Inherited from​

Evented.one

Defined in​

packages/@orbit/core/src/evented.ts:28


rollback​

â–¸ rollback(id, relativePosition?): Promise<void>

Parameters​

NameTypeDefault value
idstringundefined
relativePositionnumber0

Returns​

Promise<void>

Defined in​

packages/@orbit/core/src/log.ts:133


truncate​

â–¸ truncate(id, relativePosition?): Promise<void>

Parameters​

NameTypeDefault value
idstringundefined
relativePositionnumber0

Returns​

Promise<void>

Defined in​

packages/@orbit/core/src/log.ts:103