From 726e32c211da38d919dbd05127e102cdd87f11cf Mon Sep 17 00:00:00 2001 From: kenokabe Date: Tue, 24 May 2016 18:09:01 +0900 Subject: [PATCH] commit --- package.json | 2 +- react-test/index.jsx | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 9de62a9..9daa5e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "timeengine", - "version": "6.5.0", + "version": "6.5.1", "description": "TimeEngine is a tiny, simple yet versatile library that provides first class reactive value 'over time' with smart dependency resolving capability in JavaScript. Built for a programming paradigm: Dependency driven Functional Reactive Programming (DFRP)", "main": "timeengine.js", "scripts": { diff --git a/react-test/index.jsx b/react-test/index.jsx index 0b1b6e6..940c15b 100644 --- a/react-test/index.jsx +++ b/react-test/index.jsx @@ -26,9 +26,9 @@ // on TimeEngine infinite Sequence // map natural numbers sequence on intervalSeq(1000) const TimerElement = () => __Element(__ - .intervalSeq(Immutable.Range(), 1000) - .__((count) => (__.log.t = count)) //console.log - .__((count) => (
{"Timer : "}{count}
))); + .intervalSeq(Immutable.Range(), 1000) + .__((count) => (__.log.t = count)) //console.log + .__((count) => (
{"Timer : "}{count}
))); // memory leak, performance issue //how about games? memoized_reduce is needed @@ -37,7 +37,7 @@ const __updn = __(true); //1 or -1 or initially 0 const __seqEl = __([__updn]) .__(([updn]) => (__updn - .reduce((a, b) => (a + b)))) //js Array.reduce + .reduce((a, b) => (a + b)))) //js Array.reduce .__((count) => ({count})); const init = () => (__updn.t = 0); //just trigger to view the init const __runNow = __ @@ -48,7 +48,7 @@ onClick={() => (__updn.t = 1)}>{"Up"} -   {__Element(__seqEl)}   +   {__Element(__seqEl)}   ); }; @@ -84,7 +84,7 @@ onClick={() => (__updn.t = 1)}>{"Up"} -   {__Element(__seqEl)}   +   {__Element(__seqEl)}   ); @@ -99,16 +99,15 @@ const THETA = DEG / 180 * Math.PI; //radian const G = 9.8; //gravity const //t seconds elapsed 0msec time resolution - const t = __ - .intervalSeq(Immutable.Range(), 10) - .__((count) => (count * 10 / 1000)); + const t = __([__.intervalSeq(Immutable.Range(), 10)]) + .__(([count]) => (count * 10 / 1000)); const x = __([t]).__(([t]) => V0 * Math.cos(THETA) * t); - const y = __([t]).__(([t]) => V0 * Math.sin(THETA) * t - 1 / 2 * G * Math.pow(t, 2)); + const y = __([t]).__(([t]) => V0 * Math.sin(THETA) * t - 1 / 2 * G * Math.pow(t, 2)).log(); //================================== const Drawscale = 1; //1 dot = 1 meter const __seqEl = __([x, y]) //atomic update .__(([x, y]) => ( -
+