@effection/subscription
Advanced tools
Comparing version 2.0.0-beta.3 to 2.0.0-beta.4
# @effection/subscription | ||
## 2.0.0-beta.4 | ||
### Patch Changes | ||
- Updated dependencies [e297c86] | ||
- @effection/core@2.0.0-beta.4 | ||
## 2.0.0-beta.3 | ||
@@ -4,0 +11,0 @@ |
@@ -8,1 +8,2 @@ export { SymbolOperationIterable } from './symbol-operation-iterable'; | ||
export { Queue, createQueue } from './queue'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,8 +0,10 @@ | ||
'use strict' | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./subscription.cjs.production.min.js') | ||
} else { | ||
module.exports = require('./subscription.cjs.development.js') | ||
} | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createQueue = exports.createStream = exports.SymbolOperationIterable = void 0; | ||
var symbol_operation_iterable_1 = require("./symbol-operation-iterable"); | ||
Object.defineProperty(exports, "SymbolOperationIterable", { enumerable: true, get: function () { return symbol_operation_iterable_1.SymbolOperationIterable; } }); | ||
var stream_1 = require("./stream"); | ||
Object.defineProperty(exports, "createStream", { enumerable: true, get: function () { return stream_1.createStream; } }); | ||
var queue_1 = require("./queue"); | ||
Object.defineProperty(exports, "createQueue", { enumerable: true, get: function () { return queue_1.createQueue; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -5,1 +5,2 @@ export declare type DeepPartial<T> = { | ||
export declare function matcher<T>(reference: unknown): (value: T) => boolean; | ||
//# sourceMappingURL=match.d.ts.map |
@@ -10,1 +10,2 @@ import { Task } from '@effection/core'; | ||
} | ||
//# sourceMappingURL=operation-iterable.d.ts.map |
@@ -5,1 +5,2 @@ import { Operation } from '@effection/core'; | ||
} | ||
//# sourceMappingURL=operation-iterator.d.ts.map |
@@ -11,1 +11,2 @@ import { Subscription } from './index'; | ||
export {}; | ||
//# sourceMappingURL=queue.d.ts.map |
@@ -27,1 +27,2 @@ import { Operation, Task, Resource } from '@effection/core'; | ||
export {}; | ||
//# sourceMappingURL=stream.d.ts.map |
@@ -11,1 +11,2 @@ import { Operation } from '@effection/core'; | ||
} | ||
//# sourceMappingURL=subscription.d.ts.map |
@@ -22,1 +22,2 @@ /** | ||
export declare const SymbolOperationIterable: typeof __global_variable_to_hold_type_of_global_operation_iterable_symbol; | ||
//# sourceMappingURL=symbol-operation-iterable.d.ts.map |
@@ -6,1 +6,2 @@ import { Stream } from './stream'; | ||
export declare type WritableStream<TReceive, TSend, TReturn = undefined> = Stream<TReceive, TReturn> & Writable<TSend>; | ||
//# sourceMappingURL=writable-stream.d.ts.map |
{ | ||
"name": "@effection/subscription", | ||
"version": "2.0.0-beta.3", | ||
"version": "2.0.0-beta.4", | ||
"description": "Effection Subscriptions", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"repository": "https://github.com/thefrontside/effection.git", | ||
"homepage": "https://github.com/thefrontside/effection", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/thefrontside/effection.git", | ||
"directory": "packages/subscription" | ||
}, | ||
"author": "Frontside Engineering <engineering@frontside.com>", | ||
"license": "MIT", | ||
"files": [ | ||
"README.md", | ||
"CHANGELOG.md", | ||
"dist/**/*", | ||
"src/**/*" | ||
], | ||
"license": "MIT", | ||
"scripts": { | ||
"lint": "eslint '{src,tests}/**/*.ts'", | ||
"test": "mocha -r ts-node/register --timeout 5000 test/**/*.test.ts", | ||
"prepack": "tsdx build --tsconfig tsconfig.dist.json", | ||
"prepack": "tsc --build tsconfig.dist.json", | ||
"docs": "yarn typedoc src/index.ts", | ||
@@ -24,6 +23,6 @@ "mocha": "mocha -r ts-node/register" | ||
"dependencies": { | ||
"@effection/core": "2.0.0-beta.3" | ||
"@effection/core": "2.0.0-beta.4" | ||
}, | ||
"devDependencies": { | ||
"@effection/mocha": "2.0.0-beta.3", | ||
"@effection/mocha": "2.0.0-beta.4", | ||
"@frontside/tsconfig": "^1.2.0", | ||
@@ -33,11 +32,9 @@ "@types/mocha": "^8.0.3", | ||
"mocha": "^8.3.1", | ||
"ts-node": "^8.9.0", | ||
"tsdx": "0.13.2", | ||
"ts-node": "^10.1.0", | ||
"typedoc": "^0.20.36", | ||
"typescript": "^3.7.0" | ||
"typescript": "^4.3.5" | ||
}, | ||
"volta": { | ||
"node": "12.16.0", | ||
"yarn": "1.19.1" | ||
"extends": "../../package.json" | ||
} | ||
} |
@@ -44,3 +44,3 @@ import { Operation, withLabels } from '@effection/core'; | ||
} | ||
} | ||
}; | ||
@@ -63,7 +63,7 @@ let next = (): Operation<IteratorResult<T, TReturn>> => { | ||
} | ||
} | ||
}; | ||
}; | ||
function withName<T>(operationName: string, operation: Operation<T>): Operation<T> { | ||
return withLabels(operation, { name: `${name}.${operationName}()`}); | ||
return withLabels(operation, { name: `${name}.${operationName}()` }); | ||
} | ||
@@ -120,3 +120,3 @@ | ||
let items: T[] = []; | ||
let result = yield subscription.forEach((item) => function*() { items.push(item); }); | ||
let result = yield subscription.forEach((item) => function*() { items.push(item) }); | ||
return (function*() { | ||
@@ -134,3 +134,3 @@ yield *items; | ||
}, | ||
} | ||
}; | ||
@@ -141,3 +141,3 @@ return { | ||
...subscription, | ||
} | ||
}; | ||
} |
@@ -35,8 +35,8 @@ import { Operation, Task, Resource } from '@effection/core'; | ||
let queue = createQueue<T, TReturn>(name); | ||
task.spawn(function*() { | ||
task.run(function*() { | ||
let result = yield callback(queue.send); | ||
queue.closeWith(result); | ||
}, { labels: { name: `publisher`}}); | ||
}, { labels: { name: `publisher` } }); | ||
return queue.subscription; | ||
} | ||
}; | ||
@@ -53,3 +53,3 @@ function filter<R extends T>(predicate: (value: T) => value is R): Stream<T, TReturn> | ||
}, `${name}.filter()`); | ||
}; | ||
} | ||
@@ -104,3 +104,3 @@ let stream = { | ||
scope.spawn(stream.forEach((m) => { buffer.push(m) })); | ||
scope.run(stream.forEach((m) => { buffer.push(m) })); | ||
@@ -116,3 +116,3 @@ return createStream((publish) => function*() { | ||
scope.spawn(stream.forEach((m) => { buffer += `${m}` })); | ||
scope.run(stream.forEach((m) => { buffer += `${m}` })); | ||
@@ -133,3 +133,3 @@ let result = createStream<string, TReturn>((publish) => function*() { | ||
} | ||
} | ||
}; | ||
}, | ||
@@ -136,0 +136,0 @@ |
import { Operation } from '@effection/core'; | ||
import { OperationIterator } from './operation-iterator'; | ||
type Callback<T,TReturn> = (publish: (value: T) => void) => Operation<TReturn>; | ||
export interface Subscription<T, TReturn = undefined> extends OperationIterator<T, TReturn> { | ||
@@ -7,0 +5,0 @@ first(): Operation<T | undefined>; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
8
55
1
0
86733
996
1
+ Added@effection/core@2.0.0-beta.4(transitive)
- Removed@effection/core@2.0.0-beta.3(transitive)
Updated@effection/core@2.0.0-beta.4