disposable-component
Advanced tools
Comparing version 0.2.0 to 0.3.0
{ | ||
"name": "disposable-component", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "A simple reactive API for mounting and unmounting components to the DOM", | ||
"main": "lib/disposable-component.js", | ||
"main": "rx4.js", | ||
"repository": "https://github.com/CanopyTax/disposable-component", | ||
@@ -10,13 +10,20 @@ "author": "Bret Little <bret.little@gmail.com>", | ||
"scripts": { | ||
"prepublish": "npm run build", | ||
"build": "babel src --out-dir lib --source-maps", | ||
"prepublish": "npm run dev", | ||
"build": "webpack --mode production", | ||
"test": "jest --coverage --config ./jest.json", | ||
"test-watch": "jest --watch --config ./jest.json" | ||
"test-watch": "jest --watch --config ./jest.json", | ||
"dev": "webpack --mode development" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0-beta.46", | ||
"@babel/core": "^7.0.0-beta.46", | ||
"@babel/preset-env": "^7.0.0-beta.46", | ||
"babel-core": "^7.0.0-0", | ||
"babel-jest": "^22.4.3", | ||
"babel-loader": "^7.1.4", | ||
"babel-cli": "^6.26.0", | ||
"babel-jest": "^21.2.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"jest": "^21.2.1", | ||
"rx": "^4.1.0" | ||
"rx": "^4.1.0", | ||
"rxjs": "^6.3.3" | ||
}, | ||
@@ -26,3 +33,7 @@ "files": [ | ||
"src" | ||
] | ||
], | ||
"dependencies": { | ||
"webpack": "^4.20.2", | ||
"webpack-cli": "^3.1.2" | ||
} | ||
} |
@@ -1,2 +0,3 @@ | ||
import mountComponent from './disposable-component.js'; | ||
import mountComponent from './rx4.js'; | ||
import mountDisposableComponent from './rx6.js'; | ||
@@ -74,1 +75,61 @@ describe('Disposable Component', function() { | ||
}); | ||
describe('Disposable Component rx6', function() { | ||
it('should execute the mount life-cycle lazily', function() { | ||
const mount = jasmine.createSpy(); | ||
const unmount = jasmine.createSpy(); | ||
mountDisposableComponent(mount, unmount); | ||
expect(mount).not.toHaveBeenCalled(); | ||
expect(unmount).not.toHaveBeenCalled(); | ||
mountDisposableComponent(mount, unmount).subscribe(data => { | ||
}); | ||
expect(mount).toHaveBeenCalled(); | ||
expect(unmount).not.toHaveBeenCalled(); | ||
}); | ||
it('should unmount when the subscription is disposed', function() { | ||
const mount = jasmine.createSpy(); | ||
const unmount = jasmine.createSpy(); | ||
mountDisposableComponent(mount, unmount); | ||
expect(mount).not.toHaveBeenCalled(); | ||
expect(unmount).not.toHaveBeenCalled(); | ||
mountDisposableComponent(mount, unmount).subscribe(data => { | ||
}).unsubscribe(); | ||
expect(mount).toHaveBeenCalled(); | ||
expect(unmount).toHaveBeenCalled(); | ||
}); | ||
it('should publish data to the subscription', function() { | ||
const mount = function(next, error, complete) { | ||
next(1); | ||
next(2); | ||
}; | ||
const unmount = jasmine.createSpy(); | ||
const onData = jasmine.createSpy(); | ||
mountDisposableComponent(mount, unmount).subscribe(onData); | ||
expect(onData).toHaveBeenCalledWith(1); | ||
expect(onData).toHaveBeenCalledWith(2); | ||
}); | ||
it('should publish errors to the subscription', function() { | ||
const mount = function(next, complete, error) { | ||
error('aah'); | ||
}; | ||
const unmount = jasmine.createSpy(); | ||
const error = jasmine.createSpy(); | ||
mountDisposableComponent(mount, unmount).subscribe(() => {}, error); | ||
expect(error).toHaveBeenCalledWith('aah'); | ||
}); | ||
}); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
245
13014
2
11
7
2
+ Addedwebpack@^4.20.2
+ Addedwebpack-cli@^3.1.2
+ Added@webassemblyjs/ast@1.9.0(transitive)
+ Added@webassemblyjs/floating-point-hex-parser@1.9.0(transitive)
+ Added@webassemblyjs/helper-api-error@1.9.0(transitive)
+ Added@webassemblyjs/helper-buffer@1.9.0(transitive)
+ Added@webassemblyjs/helper-code-frame@1.9.0(transitive)
+ Added@webassemblyjs/helper-fsm@1.9.0(transitive)
+ Added@webassemblyjs/helper-module-context@1.9.0(transitive)
+ Added@webassemblyjs/helper-wasm-bytecode@1.9.0(transitive)
+ Added@webassemblyjs/helper-wasm-section@1.9.0(transitive)
+ Added@webassemblyjs/ieee754@1.9.0(transitive)
+ Added@webassemblyjs/leb128@1.9.0(transitive)
+ Added@webassemblyjs/utf8@1.9.0(transitive)
+ Added@webassemblyjs/wasm-edit@1.9.0(transitive)
+ Added@webassemblyjs/wasm-gen@1.9.0(transitive)
+ Added@webassemblyjs/wasm-opt@1.9.0(transitive)
+ Added@webassemblyjs/wasm-parser@1.9.0(transitive)
+ Added@webassemblyjs/wast-parser@1.9.0(transitive)
+ Added@webassemblyjs/wast-printer@1.9.0(transitive)
+ Added@xtuc/ieee754@1.2.0(transitive)
+ Added@xtuc/long@4.2.2(transitive)
+ Addedacorn@6.4.2(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedajv-errors@1.0.1(transitive)
+ Addedajv-keywords@3.5.2(transitive)
+ Addedansi-regex@4.1.1(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedanymatch@2.0.03.1.3(transitive)
+ Addedaproba@1.2.0(transitive)
+ Addedarr-diff@4.0.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarr-union@3.1.0(transitive)
+ Addedarray-unique@0.3.2(transitive)
+ Addedasn1.js@4.10.1(transitive)
+ Addedassert@1.5.1(transitive)
+ Addedassign-symbols@1.0.0(transitive)
+ Addedasync-each@1.0.6(transitive)
+ Addedatob@2.1.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbase@0.11.2(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbig.js@5.2.2(transitive)
+ Addedbinary-extensions@1.13.12.3.0(transitive)
+ Addedbindings@1.5.0(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedbn.js@4.12.15.2.1(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbraces@2.3.23.0.3(transitive)
+ Addedbrorand@1.1.0(transitive)
+ Addedbrowserify-aes@1.2.0(transitive)
+ Addedbrowserify-cipher@1.0.1(transitive)
+ Addedbrowserify-des@1.0.2(transitive)
+ Addedbrowserify-rsa@4.1.1(transitive)
+ Addedbrowserify-sign@4.2.3(transitive)
+ Addedbrowserify-zlib@0.2.0(transitive)
+ Addedbuffer@4.9.2(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedbuffer-xor@1.0.3(transitive)
+ Addedbuiltin-status-codes@3.0.0(transitive)
+ Addedcacache@12.0.4(transitive)
+ Addedcache-base@1.0.1(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcamelcase@5.3.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedchokidar@2.1.83.6.0(transitive)
+ Addedchownr@1.1.4(transitive)
+ Addedchrome-trace-event@1.0.4(transitive)
+ Addedcipher-base@1.0.5(transitive)
+ Addedclass-utils@0.3.6(transitive)
+ Addedcliui@5.0.0(transitive)
+ Addedcollection-visit@1.0.0(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedcommondir@1.0.1(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedconsole-browserify@1.2.0(transitive)
+ Addedconstants-browserify@1.0.0(transitive)
+ Addedcopy-concurrently@1.0.5(transitive)
+ Addedcopy-descriptor@0.1.1(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcreate-ecdh@4.0.4(transitive)
+ Addedcreate-hash@1.2.0(transitive)
+ Addedcreate-hmac@1.1.7(transitive)
+ Addedcross-spawn@6.0.6(transitive)
+ Addedcrypto-browserify@3.12.1(transitive)
+ Addedcyclist@1.0.2(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddefine-property@0.2.51.0.02.0.2(transitive)
+ Addeddes.js@1.1.0(transitive)
+ Addeddetect-file@1.0.0(transitive)
+ Addeddiffie-hellman@5.0.3(transitive)
+ Addeddomain-browser@1.2.0(transitive)
+ Addedduplexify@3.7.1(transitive)
+ Addedelliptic@6.6.1(transitive)
+ Addedemoji-regex@7.0.3(transitive)
+ Addedemojis-list@3.0.0(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedenhanced-resolve@4.5.0(transitive)
+ Addederrno@0.1.8(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedeslint-scope@4.0.3(transitive)
+ Addedesrecurse@4.3.0(transitive)
+ Addedestraverse@4.3.05.3.0(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedevp_bytestokey@1.0.3(transitive)
+ Addedexpand-brackets@2.1.4(transitive)
+ Addedexpand-tilde@2.0.2(transitive)
+ Addedextend-shallow@2.0.13.0.2(transitive)
+ Addedextglob@2.0.4(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfiggy-pudding@3.5.2(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedfill-range@4.0.07.1.1(transitive)
+ Addedfind-cache-dir@2.1.0(transitive)
+ Addedfind-up@3.0.0(transitive)
+ Addedfindup-sync@3.0.0(transitive)
+ Addedflush-write-stream@1.1.1(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfragment-cache@0.2.1(transitive)
+ Addedfrom2@2.3.0(transitive)
+ Addedfs-write-stream-atomic@1.0.10(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfsevents@1.2.132.3.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedget-value@2.0.6(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedglob-parent@3.1.05.1.2(transitive)
+ Addedglobal-modules@1.0.02.0.0(transitive)
+ Addedglobal-prefix@1.0.23.0.0(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-value@0.3.11.0.0(transitive)
+ Addedhas-values@0.1.41.0.0(transitive)
+ Addedhash-base@3.0.4(transitive)
+ Addedhash.js@1.1.7(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhmac-drbg@1.0.1(transitive)
+ Addedhomedir-polyfill@1.0.3(transitive)
+ Addedhttps-browserify@1.0.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addediferr@0.1.5(transitive)
+ Addedimport-local@2.0.0(transitive)
+ Addedimurmurhash@0.1.4(transitive)
+ Addedinfer-owner@1.0.4(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.32.0.4(transitive)
+ Addedini@1.3.8(transitive)
+ Addedinterpret@1.4.0(transitive)
+ Addedis-accessor-descriptor@1.0.1(transitive)
+ Addedis-binary-path@1.0.12.1.0(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-data-descriptor@1.0.1(transitive)
+ Addedis-descriptor@0.1.71.0.3(transitive)
+ Addedis-extendable@0.1.11.0.1(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-fullwidth-code-point@2.0.0(transitive)
+ Addedis-glob@3.1.04.0.3(transitive)
+ Addedis-number@3.0.07.0.0(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedis-wsl@1.1.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisobject@2.1.03.0.1(transitive)
+ Addedjson-parse-better-errors@1.0.2(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson5@1.0.2(transitive)
+ Addedkind-of@3.2.24.0.06.0.3(transitive)
+ Addedloader-runner@2.4.0(transitive)
+ Addedloader-utils@1.4.2(transitive)
+ Addedlocate-path@3.0.0(transitive)
+ Addedlru-cache@5.1.1(transitive)
+ Addedmake-dir@2.1.0(transitive)
+ Addedmap-cache@0.2.2(transitive)
+ Addedmap-visit@1.0.0(transitive)
+ Addedmd5.js@1.3.5(transitive)
+ Addedmemory-fs@0.4.10.5.0(transitive)
+ Addedmicromatch@3.1.10(transitive)
+ Addedmiller-rabin@4.0.1(transitive)
+ Addedminimalistic-assert@1.0.1(transitive)
+ Addedminimalistic-crypto-utils@1.0.1(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmississippi@3.0.0(transitive)
+ Addedmixin-deep@1.3.2(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedmove-concurrently@1.0.1(transitive)
+ Addedms@2.0.0(transitive)
+ Addednan@2.22.0(transitive)
+ Addednanomatch@1.2.13(transitive)
+ Addedneo-async@2.6.2(transitive)
+ Addednice-try@1.0.5(transitive)
+ Addednode-libs-browser@2.2.1(transitive)
+ Addednormalize-path@2.1.13.0.0(transitive)
+ Addedobject-copy@0.1.0(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject-visit@1.0.1(transitive)
+ Addedobject.assign@4.1.5(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-browserify@0.3.0(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@3.0.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpako@1.0.11(transitive)
+ Addedparallel-transform@1.2.0(transitive)
+ Addedparse-asn1@5.1.7(transitive)
+ Addedparse-passwd@1.0.0(transitive)
+ Addedpascalcase@0.1.1(transitive)
+ Addedpath-browserify@0.0.1(transitive)
+ Addedpath-dirname@1.0.2(transitive)
+ Addedpath-exists@3.0.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedpbkdf2@3.1.2(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedpify@4.0.1(transitive)
+ Addedpkg-dir@3.0.0(transitive)
+ Addedposix-character-classes@0.1.1(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpromise-inflight@1.0.1(transitive)
+ Addedprr@1.0.1(transitive)
+ Addedpublic-encrypt@4.0.3(transitive)
+ Addedpump@2.0.13.0.2(transitive)
+ Addedpumpify@1.5.1(transitive)
+ Addedpunycode@1.4.12.3.1(transitive)
+ Addedqs@6.13.1(transitive)
+ Addedquerystring-es3@0.2.1(transitive)
+ Addedrandombytes@2.1.0(transitive)
+ Addedrandomfill@1.0.4(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedreaddirp@2.2.13.6.0(transitive)
+ Addedregex-not@1.0.2(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@1.6.1(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedrequire-main-filename@2.0.0(transitive)
+ Addedresolve-cwd@2.0.0(transitive)
+ Addedresolve-dir@1.0.1(transitive)
+ Addedresolve-from@3.0.0(transitive)
+ Addedresolve-url@0.2.1(transitive)
+ Addedret@0.1.15(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedripemd160@2.0.2(transitive)
+ Addedrun-queue@1.0.3(transitive)
+ Addedsafe-buffer@5.1.25.2.1(transitive)
+ Addedsafe-regex@1.1.0(transitive)
+ Addedschema-utils@1.0.0(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedserialize-javascript@4.0.0(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-value@2.0.1(transitive)
+ Addedsetimmediate@1.0.5(transitive)
+ Addedsha.js@2.4.11(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedsnapdragon@0.8.2(transitive)
+ Addedsnapdragon-node@2.1.1(transitive)
+ Addedsnapdragon-util@3.0.1(transitive)
+ Addedsource-list-map@2.0.1(transitive)
+ Addedsource-map@0.5.70.6.1(transitive)
+ Addedsource-map-resolve@0.5.3(transitive)
+ Addedsource-map-support@0.5.21(transitive)
+ Addedsource-map-url@0.4.1(transitive)
+ Addedsplit-string@3.1.0(transitive)
+ Addedssri@6.0.2(transitive)
+ Addedstatic-extend@0.1.2(transitive)
+ Addedstream-browserify@2.0.2(transitive)
+ Addedstream-each@1.2.3(transitive)
+ Addedstream-http@2.8.3(transitive)
+ Addedstream-shift@1.0.3(transitive)
+ Addedstring-width@3.1.0(transitive)
+ Addedstring_decoder@1.1.11.3.0(transitive)
+ Addedstrip-ansi@5.2.0(transitive)
+ Addedsupports-color@5.5.06.1.0(transitive)
+ Addedtapable@1.1.3(transitive)
+ Addedterser@4.8.1(transitive)
+ Addedterser-webpack-plugin@1.4.6(transitive)
+ Addedthrough2@2.0.5(transitive)
+ Addedtimers-browserify@2.0.12(transitive)
+ Addedto-arraybuffer@1.0.1(transitive)
+ Addedto-object-path@0.3.0(transitive)
+ Addedto-regex@3.0.2(transitive)
+ Addedto-regex-range@2.1.15.0.1(transitive)
+ Addedtty-browserify@0.0.0(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addedunion-value@1.0.1(transitive)
+ Addedunique-filename@1.1.1(transitive)
+ Addedunique-slug@2.0.2(transitive)
+ Addedunset-value@1.0.0(transitive)
+ Addedupath@1.2.0(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedurix@0.1.0(transitive)
+ Addedurl@0.11.4(transitive)
+ Addeduse@3.1.1(transitive)
+ Addedutil@0.10.40.11.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedv8-compile-cache@2.4.0(transitive)
+ Addedvm-browserify@1.1.2(transitive)
+ Addedwatchpack@1.7.5(transitive)
+ Addedwatchpack-chokidar2@2.0.1(transitive)
+ Addedwebpack@4.47.0(transitive)
+ Addedwebpack-cli@3.3.12(transitive)
+ Addedwebpack-sources@1.4.3(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwhich-module@2.0.1(transitive)
+ Addedworker-farm@1.7.0(transitive)
+ Addedwrap-ansi@5.1.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedxtend@4.0.2(transitive)
+ Addedy18n@4.0.3(transitive)
+ Addedyallist@3.1.1(transitive)
+ Addedyargs@13.3.2(transitive)
+ Addedyargs-parser@13.1.2(transitive)