Giter VIP home page Giter VIP logo

sodium-typescript's Introduction

Build Status npm version Bower version Downloads

Sodium

A Functional Reactive Programming (FRP) library for TypeScript/JavaScript

Prerequisite: Node.js

Install Node.js® and npm if they are not already on your machine.

Installation

via NPM

$> npm install sodiumjs
$> npm install -g sodiumjs

via Bower

$> bower install sodiumjs

How to use

ES6

import { Cell } from 'sodiumjs';
...
const c = new Cell(12);

TypeScript

import { Cell } from 'sodiumjs';
...
const c = new Cell<number>(12);

In a browser

Use the UMD(Universal Module Definition) format sodium.umd.js from dist/lib directory

<script src="dist/lib/sodium.umd.js"></script>
<script>
    var cell = new Sodium.Cell(12);
    ...
</script>

Build

Build commonjs libraries and UMD library for direct browser usage

$> npm run prerelease

License

Distributed under BSD 3-Clause

Announcement

Stephen Blackheath, 9 Jul 2016

I am very happy to announce that the Typescript implementation of Sodium is ready!

It features a newly developed scheme for memory management, which was needed because Javascript has no finalizers. Memory management in Sodium is 100% automatic.

This scheme imposes one small requirement on the API: You must declare any Sodium objects held inside closures using wrapper functions lambda1, lambda2 .. lambda6 - depending on the number of arguments that the closure has. These take a second argument, which is a list of the Sodium objects contained in the context of the closure. For example:

csw = csw_str.map(lambda1(sw => sw == "sa" ? sa : sb, [sa, sb])),

This allows Sodium to track all dependencies. There are some limitations to this scheme - for example, it can't track dependencies if you poke arbitrary Sodium objects into a StreamSink, but I think these should not affect any normal usages. Time will tell.

sodium-typescript's People

Contributors

rixrix avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.