From d4be3906e32ac7d9933c6030d6493f2f2152bdd9 Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Wed, 12 Oct 2016 02:55:53 +0200
Subject: tree view of wallet db

---
 pages/confirm-create-reserve.tsx | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

(limited to 'pages/confirm-create-reserve.tsx')

diff --git a/pages/confirm-create-reserve.tsx b/pages/confirm-create-reserve.tsx
index a95bc46cb..3b5a4d161 100644
--- a/pages/confirm-create-reserve.tsx
+++ b/pages/confirm-create-reserve.tsx
@@ -27,6 +27,7 @@ import {AmountJson, CreateReserveResponse} from "../lib/wallet/types";
 import {ReserveCreationInfo, Amounts} from "../lib/wallet/types";
 import {Denomination} from "../lib/wallet/types";
 import {getReserveCreationInfo} from "../lib/wallet/wxApi";
+import {ImplicitStateComponent, StateHolder} from "../lib/components";
 
 "use strict";
 
@@ -63,30 +64,6 @@ class EventTrigger {
 }
 
 
-interface StateHolder<T> {
-  (): T;
-  (newState: T): void;
-}
-
-/**
- * Component that doesn't hold its state in one object,
- * but has multiple state holders.
- */
-abstract class ImplicitStateComponent<PropType> extends preact.Component<PropType, void> {
-  makeState<StateType>(initial: StateType): StateHolder<StateType> {
-    let state: StateType = initial;
-    return (s?: StateType): StateType => {
-      if (s !== undefined) {
-        state = s;
-        // In preact, this will always schedule a (debounced) redraw
-        this.setState({} as any);
-      }
-      return state;
-    };
-  }
-}
-
-
 function renderReserveCreationDetails(rci: ReserveCreationInfo|null) {
   if (!rci) {
     return <p>
-- 
cgit v1.2.3

