Skip to main content

MemoryUrlState

An in-memory UrlState.

This is a class exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { MemoryUrlState } from "@mapcairn/core";

class MemoryUrlState implements UrlState

Description​

How to script it: pass the starting value, as if the page had loaded with that address. write replaces the whole value (it does not merge), and writes records every value written, in order. Nothing is debounced.

Constructors​

(constructor)​

constructor(initial?: UrlStateValue);

Constructs a new instance of the MemoryUrlState class

  • initial? (UrlStateValue)

Properties​

writes​

readonly writes: UrlStateValue[];

Every value passed to write, in order.

Methods​

link(value: UrlStateValue): string;

The memory address base followed by the hash value makes. It has no side effect.

  • value (UrlStateValue)

read​

read(): UrlStateValue;

The value last written, or the one it started with.

write​

write(value: UrlStateValue): void;

Replaces the whole value and records it in writes. It does not merge or debounce.

  • value (UrlStateValue)

See also​

Source: packages/core/src/fakes/MemoryUrlState.ts:16