diff --git a/test/src/Counter.tsx b/test/src/Counter.tsx new file mode 100644 index 0000000..4f6712b --- /dev/null +++ b/test/src/Counter.tsx @@ -0,0 +1,22 @@ +interface CounterStore { + value: number; +} + +const Counter = HUI.define<{}, HUI.Store, HUI.EmptyStore>('Counter', { + + state: ['value'], + + defaultStore: { + value: 0 + }, + + render(props, store) { + return ( + + +

Count: {store.get('value')}

+
+ ); + } + +}); diff --git a/test/src/Dialog.tsx b/test/src/Dialog.tsx index 7f155bc..a37f0ea 100644 --- a/test/src/Dialog.tsx +++ b/test/src/Dialog.tsx @@ -27,7 +27,10 @@ const Dialog = HUI.define<{}, HUI.Store, HUI.E {store.get('on') && [

(Dialog window is shown.)

, + {undefined}

[Dialog window]

+ {null} + {Object}
]} diff --git a/test/src/test.tsx b/test/src/test.tsx index 224d70a..c064c7f 100644 --- a/test/src/test.tsx +++ b/test/src/test.tsx @@ -9,6 +9,8 @@ type TestContext = HUI.Store<{ const SVG_NS = 'http://www.w3.org/2000/svg'; +HUI.tick = cb => { setTimeout(cb, 500) }; + HUI.render( ( @@ -18,6 +20,10 @@ HUI.render(
+ + +
+ Global Timer:
@@ -37,7 +43,9 @@ HUI.render(

SVG test:

- +