mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-12-02 07:17:13 +00:00
- @pezkuwi/dev, dev-test, dev-ts ^0.86.3 - react-qr Display: the frames follow the value's content (xxhash), are reset while rendering instead of in an effect, and the frame timer is keyed on the frame set. Before, a value that went from one frame to several never started animating; Display.spec covers single, multi, single-to-multi and unmount. tsconfig build/spec know *.spec.tsx. - optional calls instead of guard expressions (ScanAddress, stores) - KeyringOptions as a Record; type assertions the receiver already accepts removed (Settings, vue-identicon) - disable directives narrowed to the rules that still report
29 lines
738 B
TypeScript
29 lines
738 B
TypeScript
// Copyright 2017-2026 @pezkuwi/ui-keyring authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { KeyringJson, KeyringStore } from '../types.js';
|
|
|
|
import store from 'store';
|
|
|
|
export class BrowserStore implements KeyringStore {
|
|
public all (fn: (key: string, value: KeyringJson) => void): void {
|
|
store.each((value: KeyringJson, key: string): void => {
|
|
fn(key, value);
|
|
});
|
|
}
|
|
|
|
public get (key: string, fn: (value: KeyringJson) => void): void {
|
|
fn(store.get(key) as KeyringJson);
|
|
}
|
|
|
|
public remove (key: string, fn?: () => void): void {
|
|
store.remove(key);
|
|
fn?.();
|
|
}
|
|
|
|
public set (key: string, value: KeyringJson, fn?: () => void): void {
|
|
store.set(key, value);
|
|
fn?.();
|
|
}
|
|
}
|