Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

callbag-toolkit

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callbag-toolkit - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

19

cjs/create.js

@@ -38,2 +38,3 @@ "use strict";

const markDisposed = () => state !== 'disposed' && (state = 'disposed');
let init = false;
/** talkback - sends messages back upstream */

@@ -44,7 +45,12 @@ // eslint-disable-next-line @typescript-eslint/no-shadow

return;
// got a request from the sink for the next value, let's process it
if (askToPull && args[0] === types_1.DATA)
askToPull();
else if (dispose && args[0] === types_1.END)
markDisposed() && dispose();
if (init) {
// got a request from the sink for the next value, let's process it
if (askToPull && args[0] === types_1.DATA)
askToPull();
else if (dispose && args[0] === types_1.END)
markDisposed() && dispose();
}
else {
init = args;
}
};

@@ -61,4 +67,7 @@ /** sink */

const askToPull = typeof consumer === 'object' ? consumer === null || consumer === void 0 ? void 0 : consumer.pull : undefined;
if (init)
upstream(...init);
init = true;
};
exports.createSource = createSource;
//# sourceMappingURL=create.js.map

@@ -1,2 +0,2 @@

export type { Callbag, Sink, Source, SourceFactory, SourceOperator, UnwrapSink, UnwrapSource, } from 'callbag';
export type { Callbag, CallbagArgs, Sink, Source, SourceFactory, SourceOperator, UnwrapSink, UnwrapSource, } from 'callbag';
export declare const START = 0;

@@ -3,0 +3,0 @@ export declare const DATA = 1;

@@ -34,2 +34,3 @@ /* eslint-disable @typescript-eslint/no-use-before-define,@typescript-eslint/no-unused-expressions,no-return-assign */

const markDisposed = () => state !== 'disposed' && (state = 'disposed');
let init = false;
/** talkback - sends messages back upstream */

@@ -40,7 +41,12 @@ // eslint-disable-next-line @typescript-eslint/no-shadow

return;
// got a request from the sink for the next value, let's process it
if (askToPull && args[0] === DATA)
askToPull();
else if (dispose && args[0] === END)
markDisposed() && dispose();
if (init) {
// got a request from the sink for the next value, let's process it
if (askToPull && args[0] === DATA)
askToPull();
else if (dispose && args[0] === END)
markDisposed() && dispose();
}
else {
init = args;
}
};

@@ -57,3 +63,6 @@ /** sink */

const askToPull = typeof consumer === 'object' ? consumer === null || consumer === void 0 ? void 0 : consumer.pull : undefined;
if (init)
upstream(...init);
init = true;
};
//# sourceMappingURL=create.js.map

@@ -1,2 +0,2 @@

export type { Callbag, Sink, Source, SourceFactory, SourceOperator, UnwrapSink, UnwrapSource, } from 'callbag';
export type { Callbag, CallbagArgs, Sink, Source, SourceFactory, SourceOperator, UnwrapSink, UnwrapSource, } from 'callbag';
export declare const START = 0;

@@ -3,0 +3,0 @@ export declare const DATA = 1;

@@ -56,3 +56,3 @@ {

},
"version": "1.0.0"
"version": "1.0.1"
}
/* eslint-disable @typescript-eslint/no-use-before-define,@typescript-eslint/no-unused-expressions,no-return-assign */
import type {
CallbagArgs,
ConsumerHandlers,

@@ -48,2 +49,3 @@ Sink,

const markDisposed = () => state !== 'disposed' && (state = 'disposed')
let init: CallbagArgs<never, Out> | boolean = false

@@ -54,5 +56,9 @@ /** talkback - sends messages back upstream */

if (state === 'disposed') return
// got a request from the sink for the next value, let's process it
if (askToPull && args[0] === DATA) askToPull()
else if (dispose && args[0] === END) markDisposed() && dispose()
if (init) {
// got a request from the sink for the next value, let's process it
if (askToPull && args[0] === DATA) askToPull()
else if (dispose && args[0] === END) markDisposed() && dispose()
} else {
init = args
}
}

@@ -72,2 +78,4 @@

const askToPull = typeof consumer === 'object' ? consumer?.pull : undefined
if (init) upstream(...init)
init = true
}
export type {
Callbag,
CallbagArgs,
Sink,

@@ -4,0 +5,0 @@ Source,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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