mol_wire_lib_tmp
TypeScript icon, indicating that this package has built-in type declarations

1.0.493 • Public • Published

$mol_wire

Auto wiring modules. It gives ability to:

  • Make any state observable using only 1.5KB lib. $hyoo_crowd as example.
  • Automatic dynamic track runtime value dependencies and optimize task execution order.
  • Memoize calculations with automatic revalidation. Yes, it completely solves the first of hard problem in computer science.
  • Convert sync API to async and vice versa. Yes, it's a black magic of idempotence.
  • Manage resources automatically with predictable deconstruction moment. Yes, we don't rely on garbage collector.
  • Dramatically reduce source code size and increase reliability by implementing reactive architecture.

Articles about

High level API

Decorators

Proxies

Functions

Structures

Low level API

Debug

Pub/Sub

Reactivity

NPM Bundles

mol_wire_lib

Lib with all production ready $mol_wire modules.

npm install mol_wire_lib

7KB

import {
	$mol_wire_solo as solo,
	$mol_wire_plex as plex,
	$mol_wire_method as task,
} from 'mol_wire_lib'

class User {
	@solo age( next = 0 ) { return next }
	@plex finger_exists( id: string, next = true ) { return next }
	@task finger_cut( id: string ) { this.finger_exists( id, false ) }
}
const {
	$mol_wire_solo as solo,
	$mol_wire_plex as plex,
	$mol_wire_method as task,
} = require( 'mol_wire_lib' )

class User {
	age( next = 0 ) { return next }
	finger_exists( id: string, next = true ) { return next }
	finger_cut( id: string ) { this.finger_exists( id, false ) }
}

solo( User.prototype, 'age' )
plex( User.prototype, 'finger_exists' )
task( User.prototype, 'finger_cut' )

mol_wire_pub

Tiny lib to making any state observabe for other $mol_wire based libs.

npm install mol_wire_pub

1.5KB

import { $mol_wire_pub as Publisher } from 'mol_wire_pub'

let counter = 0
const pub = new Publisher

export function state() {
	pub.promote()
	return counter
}

export function increase() {
	++ counter
	pub.emit()
}

export function decrease() {
	-- counter
	pub.emit()
}

mol_wire_dom

Lib to make real DOM reactive.

npm install mol_wire_domm

7.5KB

import { $mol_wire_dom as reactivate } from 'mol_wire_dom'

reactivate( document.body )

Close alternatives

Architectural comparison

Package Sidebar

Install

npm i mol_wire_lib_tmp

Weekly Downloads

0

Version

1.0.493

License

none

Unpacked Size

1.49 MB

Total Files

24

Last publish

Collaborators

  • zerkalica