@most/disposable
Advanced tools
Comparing version 0.12.0 to 0.13.0
/** @license MIT License (c) copyright 2010-2017 original author or authors */ | ||
var dispose = function (disposable) { return disposable.dispose(); }; | ||
/** @license MIT License (c) copyright 2010-2017 original author or authors */ | ||
var disposeNone = function () { return NONE; }; | ||
@@ -75,3 +79,3 @@ var NONE = new ((function () { | ||
// dispose function to dispose the resource | ||
var disposeWith = curry2(function (dispose, resource) { return disposeOnce(new Disposable(dispose, resource)); }); | ||
var disposeWith = curry2(function (dispose, resource) { return disposeOnce(new DisposeWith(dispose, resource)); }); | ||
@@ -82,3 +86,3 @@ // Disposable represents a resource that must be | ||
// that identifies the resource | ||
var Disposable = function Disposable (dispose, resource) { | ||
var DisposeWith = function DisposeWith (dispose, resource) { | ||
this._dispose = dispose; | ||
@@ -88,3 +92,3 @@ this._resource = resource; | ||
Disposable.prototype.dispose = function dispose () { | ||
DisposeWith.prototype.dispose = function dispose () { | ||
this._dispose(this._resource); | ||
@@ -171,3 +175,3 @@ }; | ||
export { disposeNone, disposeWith, disposeOnce, disposeAll, disposeBoth, tryDispose }; | ||
export { dispose, disposeNone, disposeWith, disposeOnce, disposeAll, disposeBoth, DisposeAllError, tryDispose }; | ||
//# sourceMappingURL=index.es.js.map |
@@ -9,2 +9,6 @@ (function (global, factory) { | ||
var dispose = function (disposable) { return disposable.dispose(); }; | ||
/** @license MIT License (c) copyright 2010-2017 original author or authors */ | ||
var disposeNone = function () { return NONE; }; | ||
@@ -82,3 +86,3 @@ var NONE = new ((function () { | ||
// dispose function to dispose the resource | ||
var disposeWith = curry2(function (dispose, resource) { return disposeOnce(new Disposable(dispose, resource)); }); | ||
var disposeWith = curry2(function (dispose, resource) { return disposeOnce(new DisposeWith(dispose, resource)); }); | ||
@@ -89,3 +93,3 @@ // Disposable represents a resource that must be | ||
// that identifies the resource | ||
var Disposable = function Disposable (dispose, resource) { | ||
var DisposeWith = function DisposeWith (dispose, resource) { | ||
this._dispose = dispose; | ||
@@ -95,3 +99,3 @@ this._resource = resource; | ||
Disposable.prototype.dispose = function dispose () { | ||
DisposeWith.prototype.dispose = function dispose () { | ||
this._dispose(this._resource); | ||
@@ -178,2 +182,3 @@ }; | ||
exports.dispose = dispose; | ||
exports.disposeNone = disposeNone; | ||
@@ -184,2 +189,3 @@ exports.disposeWith = disposeWith; | ||
exports.disposeBoth = disposeBoth; | ||
exports.DisposeAllError = DisposeAllError; | ||
exports.tryDispose = tryDispose; | ||
@@ -186,0 +192,0 @@ |
{ | ||
"name": "@most/disposable", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"description": "Reactive programming with lean, functions-only, curried, tree-shakeable API", | ||
@@ -16,3 +16,3 @@ "typings": "type-definitions/index.d.ts", | ||
"test:unit": "nyc --reporter=text-summary mocha -r buba/register --reporter dot --recursive 'test/**/*-test.js'", | ||
"test:lint": "eslint --fix --ignore-path ../../.eslintignore src test", | ||
"test:lint": "standard --fix 'src/**/*.js' 'test/**/*.js' --verbose | snazzy", | ||
"test:flow": "flow check", | ||
@@ -44,7 +44,4 @@ "build": "npm run build:dist && npm run build:flow", | ||
"@briancavalier/assert": "^3.2.0", | ||
"@most/eslint-config-most": "^1.0.3", | ||
"babel-eslint": "^7.1.1", | ||
"buba": "^4.0.2", | ||
"cpy-cli": "^1.0.1", | ||
"eslint": "^3.15.0", | ||
"flow-bin": "^0.53.1", | ||
@@ -57,8 +54,16 @@ "mocha": "^3.4.2", | ||
"sinon": "^1.17.7", | ||
"snazzy": "^7.0.0", | ||
"standard": "^10.0.3", | ||
"uglify-js": "^2.7.5" | ||
}, | ||
"dependencies": { | ||
"@most/prelude": "^1.6.3", | ||
"@most/types": "^0.11.0" | ||
"@most/prelude": "^1.6.4", | ||
"@most/types": "^0.11.1" | ||
}, | ||
"standard": { | ||
"ignore": [ | ||
"test/perf", | ||
"test/flow" | ||
] | ||
} | ||
} |
import { Time, Disposable, Sink } from '@most/types'; | ||
declare function disposeNone (): Disposable; | ||
export function disposeNone (): Disposable; | ||
declare function disposeWith <R> (dispose: (resource: R) => void, resource: R): Disposable; | ||
declare function disposeWith <R> (dispose: (resource: R) => void): (resource: R) => Disposable | ||
export function disposeWith <R> (dispose: (resource: R) => void, resource: R): Disposable; | ||
export function disposeWith <R> (dispose: (resource: R) => void): (resource: R) => Disposable | ||
declare function disposeOnce (d: Disposable): Disposable; | ||
export function disposeOnce (d: Disposable): Disposable; | ||
declare function disposeBoth (d1: Disposable, d2: Disposable): Disposable; | ||
declare function disposeBoth (d1: Disposable): (d2: Disposable) => Disposable | ||
export function disposeBoth (d1: Disposable, d2: Disposable): Disposable; | ||
export function disposeBoth (d1: Disposable): (d2: Disposable) => Disposable | ||
declare function disposeAll (ds: Array<Disposable>): Disposable; | ||
export function disposeAll (ds: Array<Disposable>): Disposable; | ||
declare function tryDispose (t: Time, disposable: Disposable, sink: Sink<any>): void | ||
declare function tryDispose (t: Time): (disposable: Disposable, sink: Sink<any>) => void | ||
declare function tryDispose (t: Time, disposable: Disposable): (sink: Sink<any>) => void | ||
declare function tryDispose (t: Time): (disposable: Disposable) => (sink: Sink<any>) => void | ||
export function dispose (d: Disposable): void | ||
export function tryDispose (t: Time, disposable: Disposable, sink: Sink<any>): void | ||
export function tryDispose (t: Time): (disposable: Disposable, sink: Sink<any>) => void | ||
export function tryDispose (t: Time, disposable: Disposable): (sink: Sink<any>) => void | ||
export function tryDispose (t: Time): (disposable: Disposable) => (sink: Sink<any>) => void |
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
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
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
42778
13
303
Updated@most/prelude@^1.6.4
Updated@most/types@^0.11.1