0.2.9 • Published 4 months ago

renkon-node v0.2.9

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Renkon-Node: A Node.js application framework based on FRP

Introduction

Renkon Node is a Node.js framework built upon FRP (Functional Reactive Programming). Refer to Renkon-Core for the core language references.

To start a Renkon-Node application, write a .js file that looks like:

import {ProgramState, mergeFunctions} from "renkon-node";

function foo(a) {
    const b = a + 1;
    return [b];
}

function main() {
    const componentFunc = Renkon.component(Renkon.app.foo);
    const component = componentFunc({a: Events.timer(100)});
    console.log("b", component.b);
    return [];
}

let programState = new ProgramState(0, {foo}, true);

mergeFunctions(programState, main);

You instantiate a ProgramState instance with the initial logical time, an object that you would use to store some data, and the noTicking flag. Then, merge the `main' function into the programState, which by side effects starts the slower evaluation loop.

In this example, the code in main function happens to refer to the "foo" function. It is accessed via the "app" argument (the second argument) for the ProgramState constructor.

0.1.8

8 months ago

0.1.7

8 months ago

0.2.9

4 months ago

0.1.9

8 months ago

0.1.4

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago