Allow to pin nodes to top of the list (#48)

* Refactored persistent state a bit
* Allow nodes to be pinned to top
This commit is contained in:
Maciej Hirsz
2018-09-24 17:30:39 +02:00
committed by GitHub
parent 44d91a54d5
commit 1559b82eb0
24 changed files with 194 additions and 86 deletions
+3 -1
View File
@@ -2,6 +2,7 @@ import { Types, Maybe } from '@dotstats/common';
export namespace State {
export interface Node {
pinned: boolean,
id: Types.NodeId;
nodeDetails: Types.NodeDetails;
nodeStats: Types.NodeStats;
@@ -33,7 +34,8 @@ export interface State {
subscribed: Maybe<Types.ChainLabel>;
chains: Map<Types.ChainLabel, Types.NodeCount>;
nodes: Map<Types.NodeId, State.Node>;
settings: State.Settings;
settings: Readonly<State.Settings>;
pins: Readonly<Set<Types.NodeId>>;
}
export type Update = <K extends keyof State>(changes: Pick<State, K> | null) => Readonly<State>;