JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 64
  • Score
    100M100P100Q79075F
  • License MIT

Multicast delegate for TypeScript and JavaScript

Package Exports

  • @steelbreeze/delegate

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@steelbreeze/delegate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

delegate

Multicast delegate for TypeScript and JavaScript

Install

npm install @steelbreeze/delegate

Usage

TypeScript

import { create as delegate } from "@steelbreeze/delegate";

const a = delegate(param => console.log(param + " Hello"), param => console.log(param + " World "));
const b = delegate(param => console.log(param + " Hello world"));

const c = delegate(a, b);

a("a")
b("b")
c("c");

JavaScript

var delegate = require("@steelbreeze/delegate");

var a = delegate.create(function (param) { console.log(param + " Hello"); }, function (param) { console.log(param + " World "); });
var b = delegate.create(function (param) { console.log(param + " Hello world"); });

var c = delegate.create(a, b);

a("a");
b("b");
c("c");

Output

The output of the above code will be:

a Hello
a World
b Hello world
c Hello
c World
c Hello world

License

MIT