项目介绍

SodiumFRP/sodium-typescript 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,目前获得 135 个 Star、18 次 Fork。

仓库全名
SodiumFRP/sodium-typescript
Star 数
135
Fork 数
18
未关闭 Issue
15

README 摘要

Sodium A Functional Reactive Programming (FRP) library for TypeScript/JavaScript Examples Here are some demos from the community you can try in your browser: Book Examples Petrol Pump Reactive Drawing Pad Misc Playground (drum machine, animation, etc.) Prerequisite: Node.js Install Node.js® and npm if they are not already on your machine. Installation via NPM via Yarn via html include this requires also including…

完整内容见 GitHub 原始 README 或本页 。

常见问题

sodium-typescript 用什么语言开发?

主要使用 TypeScript 编写,目前有 135 个 Star。

如何获取 sodium-typescript 的源码?

可以直接克隆仓库:git clone https://github.com/SodiumFRP/sodium-typescript.git,默认分支为 master;安装与运行步骤见仓库 README。

sodium-typescript 最近还在维护吗?

仓库最近一次更新为 2月14日,当前有 15 个未关闭 Issue;Star 数为 135,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Typescript/Javascript implementation of Sodium FRP (Functional Reactive Programming) library

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
192
价值分
87
活跃状态
活跃

语言占比

CSS
HTML
JavaScript
TypeScript

Release

README

Build Status npm version Bower version Downloads

Sodium

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

Examples

Here are some demos from the community you can try in your browser:

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 Yarn

$> yarn add sodiumjs
$> yarn global add sodiumjs

via html include

<script src="https://cdn.jsdelivr.net/npm/sodiumjs/dist/sodium.umd.min.js"></script>

this requires also including sanctuary-type-classes and typescript-collections dependencies

How to use

Import

import { Cell } from 'sodiumjs';

ES6

const c = new Cell(12);

TypeScript

const c = new Cell<number>(12);

In a browser

<script>
    var cell = new Sodium.Cell(12);
</script>

Development

The usual npm run build/test/clean commands are available to produce the distribution package.

However, a more comfortable iteration style may be using the the live integration testing approach:

  1. cd src/tests/integration
  2. npm run dev:auto-reload (or just npm run dev without live reloading)

This starts up a local development server and showcases integration with a webpack app.

Changes to the core lib are then seen live since it uses a local alias rather than reference the lastest build or distribution of the library

Sodium library code is in src/lib

Packaging/tree-shaking and bundling of the library is done with Rollup

Testing is via Jest

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.

CHANGELOG

1.0.5 Migrate build environment over to fuse-box. Begin adding fantasy-land compatibility

1.0.0 Add snapshot3(), snapshot4(), snapshot5() and snapshot6(). Fix a serious bug in TimerSystem where timers sometimes don’t fire.

评论

暂无评论