Socket
Socket
Sign inDemoInstall

@effection/channel

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effection/channel - npm Package Compare versions

Comparing version 0.6.1-388321e to 0.6.1-3cde29a

dist/channel.js

17

dist/channel.d.ts
import { Operation } from 'effection';
import { Subscription, FilterChannel, MapChannel, Mapper, Predicate } from './index';
export declare type DeepPartial<T> = {
[P in keyof T]?: T[P] extends Array<infer I> ? Array<DeepPartial<I>> : DeepPartial<T[P]>;
};
export declare abstract class Channel<T> {
abstract subscribe(): Operation<Subscription<T>>;
once(): Operation<T>;
filter(predicate: Predicate<T>): FilterChannel<T>;
map<R>(mapper: Mapper<T, R>): MapChannel<T, R>;
match(reference: DeepPartial<T>): FilterChannel<T>;
import { Subscribable, Subscription, SymbolSubscribable } from '@effection/subscription';
export declare class Channel<T> implements Subscribable<T, void> {
private bus;
[SymbolSubscribable](): Operation<Subscription<T, void>>;
setMaxListeners(value: number): void;
send(message: T): void;
subscribe(): Operation<Subscription<T, void>>;
}
export { Channel } from './channel';
export { Subscription } from './subscription';
export { SendChannel, SendChannelSubscription } from './send-channel';
export { MapChannel, MapChannelSubscription, Mapper } from './map-channel';
export { FilterChannel, FilterChannelSubscription, Predicate } from './filter-channel';
export { EventChannel } from './event-channel';
import { SendChannel } from './send-channel';
import { EventChannel } from './event-channel';
import { EventSource } from '@effection/events';
export declare function createChannel<T>(): SendChannel<T>;
export declare function createEventChannel(eventSource: EventSource, eventName: string): EventChannel;

@@ -1,8 +0,5 @@

'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./channel.cjs.production.min.js')
} else {
module.exports = require('./channel.cjs.development.js')
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var channel_1 = require("./channel");
Object.defineProperty(exports, "Channel", { enumerable: true, get: function () { return channel_1.Channel; } });
//# sourceMappingURL=index.js.map
{
"name": "@effection/channel",
"version": "0.6.1-388321e",
"description": "MPSP Channel implementation for effection",
"version": "0.6.1-3cde29a",
"description": "MPMC Channel implementation for effection",
"main": "dist/index.js",
"module": "dist/channel.esm.js",
"types": "dist/index.d.ts",
"typings": "dist/index.d.js",
"repository": "https://github.com/thefrontside/bigtest.git",

@@ -13,3 +12,2 @@ "author": "Frontside Engineering <engineering@frontside.io>",

"dist/*",
"src",
"README.md"

@@ -20,3 +18,3 @@ ],

"test": "mocha -r ts-node/register test/**/*.test.ts",
"prepack": "tsdx build --tsconfig tsconfig.dist.json",
"prepack": "tsc --outdir dist --project tsconfig.dist.json --declaration --sourcemap --module commonjs",
"mocha": "mocha -r ts-node/register"

@@ -27,5 +25,4 @@ },

"expect": "^25.4.0",
"mocha": "^7.1.1",
"mocha": "^7.2.0",
"ts-node": "^8.9.0",
"tsdx": "0.13.2",
"typescript": "^3.7.0"

@@ -39,3 +36,7 @@ },

"yarn": "1.19.1"
},
"dependencies": {
"@effection/events": "^0.7.1",
"@effection/subscription": "^0.7.1"
}
}
# @effection/channel
A multi producer, multi consumer channel for Effection. Channels are useful for
communicating between different parts of a system, for building pubsub buses, or
a whole lot of other synchronization needs.
A multi producer, multi consumer unbounded channel for Effection. Channels are
useful for communicating between different parts of a system, for building
pubsub buses, or a whole lot of other synchronization needs.

@@ -11,2 +11,6 @@ Sending to a channel is synchronous and does not require the sender to be

Because of the synchronous nature of sends, channels are unbounded in size, which
means that they cannot handle backpressure. As such, channels should be used more
as a synchronization mechanism, rather than a high-throughput system.
## Usage

@@ -34,5 +38,5 @@

while(true) {
let value = yield subscription.next();
let { value } = yield subscription.next();
console.log("value:", value);
}
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc