isov

1.0.0 • Public • Published

NēoRiven

A Node friendly re-implementation of Riven.

Usage.

This implementation is almost cross-compatible with the original Riven implementation. However, the Node implementation must be done with ES5 classes.

import Riven from 'neo-riven'
const rvn = new Riven()
const { Ø } = rvn.bind()

Ø("bang").create({x:2,y:4},BangNode)
Ø("print").create({x:20,y:4},PrintNode)

Ø("bang").connect("print")
Ø("bang").bang()

class BangNode extends Riven.Node {
	constructor(ctx, id, rect) {
		super(ctx, id, rect)
		this.glyph = Riven.NODE_GLYPHS.bang
	}
}

class PrintNode extends Riven.Node {
	constructor(ctx, id, rect) {
		super(ctx, id, rect)
		this.glyph = Riven.NODE_GLYPHS.render
	}

	receive(q) {
		console.log(q)
	}
}

Readme

Keywords

none

Package Sidebar

Install

npm i isov

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

7.64 kB

Total Files

5

Last publish

Collaborators

  • 0101solar