Skip to content

Commit d93aa42

Browse files
committed
commit
1 parent 8302741 commit d93aa42

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "timeengine",
3-
"version": "6.1.4",
3+
"version": "6.2.0",
44
"description": "TimeEngine is a tiny, simple yet versatile library that provides first class reactive components with smart dependency resolving capability in JavaScript. Built for a new programming paradigm: Dependency driven Functional Reactive Programming (DFRP).",
55
"main": "timeengine.js",
66
"scripts": {

react-test/index.jsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/*global React ReactDOM __ Immutable __Component*/
1+
/*global React ReactDOM __ Immutable __Element*/
22

3-
//const __Component = require("timeengine-react");
3+
//const __Element = require("timeengine-react");
44
//this code is required to transpile by `npm run jsx`
55

66
(() => {
77
'use strict';
88

9-
const TextComponent = () => {
9+
const TextElement = () => {
1010
const __value = __();
1111
const onChange = (e) => {
1212
__value.t = e.target.value;
@@ -19,14 +19,14 @@
1919
</div>));
2020

2121
__value.t = "default text";
22-
return __Component(__seqEl);
22+
return __Element(__seqEl);
2323
};
2424

2525
// `.intervalSeq` is to map Immutable-js infinite Sequence
2626
// on TimeEngine infinite Sequence
2727
// map natural numbers sequence on intervalSeq(1000)
28-
const TimerComponent = () => {
29-
return __Component(__
28+
const TimerElement = () => {
29+
return __Element(__
3030
.intervalSeq(Immutable.Range(), 1000)
3131
.__((count) => (__.log.t = count)) //console.log
3232
.__((count) => (<div>{"Timer : "}{count}</div>)));
@@ -35,7 +35,7 @@
3535
// memory leak, performance issue
3636
//how about games? memoized_reduce is needed
3737
// to calculate many elemnents of the long array
38-
const CounterComponentStateHistory = () => {
38+
const CounterElementStateHistory = () => {
3939
const __updn = __(true); //1 or -1 or initially 0
4040
const __seqEl = __([__updn])
4141
.__(([updn]) => (__updn
@@ -50,12 +50,12 @@
5050
onClick={() => (__updn.t = 1)}>{"Up"}</button>
5151
<button
5252
onClick={() => (__updn.t = -1)}>{"Down"}</button>
53-
&nbsp;&nbsp;{__Component(__seqEl)}&nbsp;&nbsp;
53+
&nbsp;&nbsp;{__Element(__seqEl)}&nbsp;&nbsp;
5454
</span>);
5555
};
5656

5757
// no seq object destroy
58-
const CounterReloadComponent = () => {
58+
const CounterReloadElement = () => {
5959
const __clicked = __();
6060
const onClick = () => {
6161
__clicked.t = true;
@@ -64,14 +64,14 @@
6464
.intervalSeq(Immutable.Seq.of(true), 0)
6565
.__(onClick);
6666
const __seqEl = __([__clicked])
67-
.__(() => (<span>{CounterComponentStateHistory()}</span>));
67+
.__(() => (<span>{CounterElementStateHistory()}</span>));
6868
return (<div>
69-
{__Component(__seqEl)}
69+
{__Element(__seqEl)}
7070
<button onClick={onClick}>{"Reload"}</button>
7171
</div>);
7272
};
7373

74-
const CounterComponent = () => {
74+
const CounterElement = () => {
7575
const __updn = __();
7676
const __count = __([__updn])
7777
.__(([updn]) => ((updn === 0) ? (0) : (__count.t + updn)));
@@ -86,15 +86,15 @@
8686
onClick={() => (__updn.t = 1)}>{"Up"}</button>
8787
<button
8888
onClick={() => (__updn.t = -1)}>{"Down"}</button>
89-
&nbsp;&nbsp;{__Component(__seqEl)}&nbsp;&nbsp;
89+
&nbsp;&nbsp;{__Element(__seqEl)}&nbsp;&nbsp;
9090
<button
9191
onClick={init}>{"Reset"}</button>
9292
</div>);
9393
};
9494

9595

9696

97-
const PhysicsComponent = () => {
97+
const PhysicsElement = () => {
9898
//MKS system of units
9999
const V0 = 85.0; // m/s
100100
const DEG = 40; //degree
@@ -116,38 +116,38 @@
116116
cx = {50 + x * Drawscale} cy = {250 - y * Drawscale}/>
117117
</svg>
118118
</div>));
119-
return __Component(__seqEl);
119+
return __Element(__seqEl);
120120
};
121121

122-
const ButtonComponent = () => {
122+
const ButtonElement = () => {
123123
const __clicked = __();
124124
const onClick = () => {
125125
__clicked.t = true;
126126
};
127127
const __seqEl = __([__clicked])
128-
.__(() => (<div>{PhysicsComponent()}</div>));
128+
.__(() => (<div>{PhysicsElement()}</div>));
129129

130130
return (<div>
131131
<div><button onClick={onClick}>{"Physics Start"}</button></div>
132-
{__Component(__seqEl)}
132+
{__Element(__seqEl)}
133133
</div>
134134
);
135135
};
136136

137137
const TopElement = (
138138
<div>
139139
<p>{"HelloElement!!"}</p>
140-
{TextComponent()}
140+
{TextElement()}
141141
{"====================="}
142-
{TimerComponent()}
142+
{TimerElement()}
143143
{"====================="}
144-
<div>{CounterComponentStateHistory()}</div>
144+
<div>{CounterElementStateHistory()}</div>
145145
{"====================="}
146-
{CounterReloadComponent()}
146+
{CounterReloadElement()}
147147
{"====================="}
148-
{CounterComponent()}
148+
{CounterElement()}
149149
{"====================="}
150-
{ButtonComponent()}
150+
{ButtonElement()}
151151
{"====================="}
152152
</div>
153153
);

0 commit comments

Comments
 (0)