Socket
Socket
Sign inDemoInstall

@effection/core

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effection/core - npm Package Compare versions

Comparing version 2.0.0-beta.8 to 2.0.0-beta.9

5

CHANGELOG.md
# @effection/core
## \[2.0.0-beta.9]
- add `Task#spawn` operation to spawn new task with a specific scope
- [a71d65b](https://github.com/thefrontside/effection/commit/a71d65b77df5c337a78b7934edd181080eacf5bf) Add changefile on 2021-07-27
## \[2.0.0-beta.8]

@@ -4,0 +9,0 @@

2

dist-cjs/operations/spawn.d.ts
import { Operation, Resource } from '../operation';
import type { Task, TaskOptions } from '../task';
interface Spawn<T> extends Resource<Task<T>> {
within(scope: Task): Resource<Task<T>>;
within(scope: Task): Operation<Task<T>>;
}

@@ -6,0 +6,0 @@ export declare function spawn<T>(operation?: Operation<T>, options?: TaskOptions): Spawn<T>;

@@ -9,5 +9,3 @@ "use strict";

function within(scope) {
return {
init: () => init(scope)
};
return scope.spawn(operation, options);
}

@@ -14,0 +12,0 @@ return { init, within, name: 'spawn' };

@@ -36,4 +36,3 @@ /// <reference types="node" />

run<R>(operation?: Operation<R>, options?: TaskOptions): Task<R>;
/** @deprecated Use run() instead */
spawn<R>(operation?: Operation<R>, options?: TaskOptions): Task<R>;
spawn<R>(operation?: Operation<R>, options?: TaskOptions): Operation<Task<R>>;
halt(): Promise<void>;

@@ -40,0 +39,0 @@ start(): void;

@@ -59,4 +59,8 @@ "use strict";

spawn(operation, options = {}) {
console.warn(`DEPRECATED: task.spawn() is deprecated and will be changed or removed prior to the release of effection 2.0\nuse task.run() instead`);
return task.run(operation, options);
return {
name: 'spawn',
*init() {
return task.run(operation, options);
}
};
},

@@ -63,0 +67,0 @@ start() {

import { Operation, Resource } from '../operation';
import type { Task, TaskOptions } from '../task';
interface Spawn<T> extends Resource<Task<T>> {
within(scope: Task): Resource<Task<T>>;
within(scope: Task): Operation<Task<T>>;
}

@@ -6,0 +6,0 @@ export declare function spawn<T>(operation?: Operation<T>, options?: TaskOptions): Spawn<T>;

@@ -6,5 +6,3 @@ export function spawn(operation, options) {

function within(scope) {
return {
init: () => init(scope)
};
return scope.spawn(operation, options);
}

@@ -11,0 +9,0 @@ return { init, within, name: 'spawn' };

@@ -36,4 +36,3 @@ /// <reference types="node" />

run<R>(operation?: Operation<R>, options?: TaskOptions): Task<R>;
/** @deprecated Use run() instead */
spawn<R>(operation?: Operation<R>, options?: TaskOptions): Task<R>;
spawn<R>(operation?: Operation<R>, options?: TaskOptions): Operation<Task<R>>;
halt(): Promise<void>;

@@ -40,0 +39,0 @@ start(): void;

@@ -56,4 +56,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

spawn(operation, options = {}) {
console.warn(`DEPRECATED: task.spawn() is deprecated and will be changed or removed prior to the release of effection 2.0\nuse task.run() instead`);
return task.run(operation, options);
return {
name: 'spawn',
*init() {
return task.run(operation, options);
}
};
},

@@ -60,0 +64,0 @@ start() {

{
"name": "@effection/core",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"main": "dist-cjs/index.js",

@@ -5,0 +5,0 @@ "module": "dist-esm/index.js",

@@ -5,3 +5,3 @@ import { Operation, Resource } from '../operation';

interface Spawn<T> extends Resource<Task<T>> {
within(scope: Task): Resource<Task<T>>;
within(scope: Task): Operation<Task<T>>;
}

@@ -15,5 +15,3 @@

function within(scope: Task) {
return {
init: () => init(scope)
};
return scope.spawn(operation, options);
}

@@ -20,0 +18,0 @@

@@ -46,4 +46,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

run<R>(operation?: Operation<R>, options?: TaskOptions): Task<R>;
/** @deprecated Use run() instead */
spawn<R>(operation?: Operation<R>, options?: TaskOptions): Task<R>;
spawn<R>(operation?: Operation<R>, options?: TaskOptions): Operation<Task<R>>;
halt(): Promise<void>;

@@ -121,4 +120,8 @@ start(): void;

spawn(operation?, options = {}) {
console.warn(`DEPRECATED: task.spawn() is deprecated and will be changed or removed prior to the release of effection 2.0\nuse task.run() instead`);
return task.run(operation, options);
return {
name: 'spawn',
*init() {
return task.run(operation, options);
}
};
},

@@ -125,0 +128,0 @@

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