An easy-to-use platform for EEG experimentation in the classroom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added cleanup to all components of redux store on workspace close

jdpigeon 19be8d0a eb520e74

+222 -192
+1 -1
app/components/TopNavComponent/index.js
··· 6 6 import PrimaryNavSegment from './PrimaryNavSegment'; 7 7 8 8 interface Props { 9 - title: string; 9 + title: ?string; 10 10 location: { pathname: string, search: string, hash: string }; 11 11 experimentActions: Object; 12 12 type: EXPERIMENTS;
+23 -3
app/epics/deviceEpics.js
··· 12 12 getEmotiv, 13 13 connectToEmotiv, 14 14 createRawEmotivObservable, 15 - createEmotivSignalQualityObservable 15 + createEmotivSignalQualityObservable, 16 + disconnectFromEmotiv 16 17 } from '../utils/eeg/emotiv'; 17 18 import { 18 19 getMuse, 19 20 connectToMuse, 20 21 createRawMuseObservable, 21 - createMuseSignalQualityObservable 22 + createMuseSignalQualityObservable, 23 + disconnectFromMuse 22 24 } from '../utils/eeg/muse'; 23 25 import { 24 26 CONNECTION_STATUS, ··· 26 28 DEVICE_AVAILABILITY, 27 29 SEARCH_TIMER 28 30 } from '../constants/constants'; 31 + import { EXPERIMENT_CLEANUP } from './experimentEpics'; 29 32 30 33 export const DEVICE_FOUND = 'DEVICE_FOUND'; 31 34 export const SET_DEVICE_TYPE = 'DEVICE_TYPE'; ··· 207 210 map(setSignalQualityObservable) 208 211 ); 209 212 213 + const deviceCleanupEpic = (action$, state$) => 214 + action$.ofType(EXPERIMENT_CLEANUP).pipe( 215 + filter( 216 + () => 217 + state$.value.device.connectionStatus !== 218 + CONNECTION_STATUS.NOT_YET_CONNECTED 219 + ), 220 + map(() => { 221 + if (state$.value.device.deviceType === DEVICES.EMOTIV) { 222 + disconnectFromEmotiv(); 223 + } 224 + disconnectFromMuse(); 225 + }), 226 + map(cleanup) 227 + ); 228 + 210 229 // TODO: Fix this error handling so epics can refire once they error out 211 230 const rootEpic = (action$, state$) => 212 231 combineEpics( ··· 217 236 connectEpic, 218 237 isConnectingEpic, 219 238 setRawObservableEpic, 220 - setSignalQualityObservableEpic 239 + setSignalQualityObservableEpic, 240 + deviceCleanupEpic 221 241 )(action$, state$).pipe( 222 242 catchError(error => 223 243 of(error).pipe(
+160 -160
app/package-lock.json
··· 9 9 "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.0.0.tgz", 10 10 "integrity": "sha512-Yww0jXgolNtkhcK+Txo5JN+DjBpNmmAtD7G99HOebhEjBzjnACG09Tip9C8lSOF6PrhA56OeJWeOZduNJaKxBA==", 11 11 "requires": { 12 - "core-js": "2.5.7", 13 - "regenerator-runtime": "0.12.1" 12 + "core-js": "^2.5.7", 13 + "regenerator-runtime": "^0.12.0" 14 14 }, 15 15 "dependencies": { 16 16 "regenerator-runtime": { ··· 21 21 } 22 22 }, 23 23 "@neurosity/pipes": { 24 - "version": "3.2.1", 25 - "resolved": "https://registry.npmjs.org/@neurosity/pipes/-/pipes-3.2.1.tgz", 26 - "integrity": "sha512-0kQDL4/a9iz3GhHN9RPRz1krG8PO5xu+3pVT0GsmN9EZbKaW/groTypV/7ufurgguhiY2LX022KymQj9jmkTWg==", 24 + "version": "3.2.3", 25 + "resolved": "https://registry.npmjs.org/@neurosity/pipes/-/pipes-3.2.3.tgz", 26 + "integrity": "sha512-aDa/iTe7OUbwgFFnRgGcB/hTgBdkr21E5vQbpOXZpByQijB4czGDgXJfFtI3zuLKST3bZuiQ7/ZPBA3+P8GENA==", 27 27 "requires": { 28 - "dsp.js": "1.0.1", 29 - "fili": "2.0.1", 30 - "rxjs": "6.3.2" 28 + "dsp.js": "^1.0.1", 29 + "fili": "^2.0.1", 30 + "rxjs": "^6.3.1" 31 31 } 32 32 }, 33 33 "abbrev": { ··· 98 98 "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", 99 99 "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", 100 100 "requires": { 101 - "delegates": "1.0.0", 102 - "readable-stream": "2.3.6" 101 + "delegates": "^1.0.0", 102 + "readable-stream": "^2.0.6" 103 103 } 104 104 }, 105 105 "async": { ··· 112 112 "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", 113 113 "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", 114 114 "requires": { 115 - "core-js": "2.5.7", 116 - "regenerator-runtime": "0.11.1" 115 + "core-js": "^2.4.0", 116 + "regenerator-runtime": "^0.11.0" 117 117 } 118 118 }, 119 119 "balanced-match": { ··· 126 126 "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", 127 127 "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", 128 128 "requires": { 129 - "readable-stream": "2.3.6", 130 - "safe-buffer": "5.1.2" 129 + "readable-stream": "^2.3.5", 130 + "safe-buffer": "^5.1.1" 131 131 } 132 132 }, 133 133 "bleat": { ··· 135 135 "resolved": "https://registry.npmjs.org/bleat/-/bleat-0.1.8.tgz", 136 136 "integrity": "sha1-ANZuUGZiXna/mBR9/mPHWZX4L1A=", 137 137 "requires": { 138 - "noble": "1.9.1" 138 + "noble": "^1.3.0" 139 139 } 140 140 }, 141 141 "boxen": { ··· 226 226 "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 227 227 "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 228 228 "requires": { 229 - "balanced-match": "1.0.0", 229 + "balanced-match": "^1.0.0", 230 230 "concat-map": "0.0.1" 231 231 } 232 232 }, ··· 235 235 "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", 236 236 "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", 237 237 "requires": { 238 - "buffer-alloc-unsafe": "1.1.0", 239 - "buffer-fill": "1.0.0" 238 + "buffer-alloc-unsafe": "^1.1.0", 239 + "buffer-fill": "^1.0.0" 240 240 } 241 241 }, 242 242 "buffer-alloc-unsafe": { ··· 389 389 "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", 390 390 "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", 391 391 "requires": { 392 - "mimic-response": "1.0.1" 392 + "mimic-response": "^1.0.0" 393 393 } 394 394 }, 395 395 "deep-extend": { ··· 432 432 "resolved": "https://registry.npmjs.org/enchannel-zmq-backend/-/enchannel-zmq-backend-6.3.2.tgz", 433 433 "integrity": "sha512-E11vfIfeApmCOr4FW+ozLxP8VhxfLaCT2h0AUWFONrYECJ4f+X8UfOo+VuTlkrIxlrEoilpwtKXCT4tBh/KXRA==", 434 434 "requires": { 435 - "babel-runtime": "6.26.0", 436 - "jmp": "1.0.0", 437 - "rxjs": "5.5.12", 438 - "uuid": "3.3.2" 435 + "babel-runtime": "^6.26.0", 436 + "jmp": "^1.0.0", 437 + "rxjs": "^5.5.6", 438 + "uuid": "^3.1.0" 439 439 }, 440 440 "dependencies": { 441 441 "rxjs": { ··· 453 453 "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", 454 454 "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", 455 455 "requires": { 456 - "once": "1.4.0" 456 + "once": "^1.4.0" 457 457 } 458 458 }, 459 459 "escape-string-regexp": { ··· 519 519 "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", 520 520 "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", 521 521 "requires": { 522 - "minipass": "2.3.4" 522 + "minipass": "^2.2.1" 523 523 } 524 524 }, 525 525 "fs.realpath": { ··· 532 532 "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", 533 533 "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", 534 534 "requires": { 535 - "aproba": "1.2.0", 536 - "console-control-strings": "1.1.0", 537 - "has-unicode": "2.0.1", 538 - "object-assign": "4.1.1", 539 - "signal-exit": "3.0.2", 540 - "string-width": "1.0.2", 541 - "strip-ansi": "3.0.1", 542 - "wide-align": "1.1.3" 535 + "aproba": "^1.0.3", 536 + "console-control-strings": "^1.0.0", 537 + "has-unicode": "^2.0.0", 538 + "object-assign": "^4.1.0", 539 + "signal-exit": "^3.0.0", 540 + "string-width": "^1.0.1", 541 + "strip-ansi": "^3.0.1", 542 + "wide-align": "^1.1.0" 543 543 } 544 544 }, 545 545 "get-stream": { ··· 558 558 "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", 559 559 "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", 560 560 "requires": { 561 - "fs.realpath": "1.0.0", 562 - "inflight": "1.0.6", 563 - "inherits": "2.0.3", 564 - "minimatch": "3.0.4", 565 - "once": "1.4.0", 566 - "path-is-absolute": "1.0.1" 561 + "fs.realpath": "^1.0.0", 562 + "inflight": "^1.0.4", 563 + "inherits": "2", 564 + "minimatch": "^3.0.4", 565 + "once": "^1.3.0", 566 + "path-is-absolute": "^1.0.0" 567 567 } 568 568 }, 569 569 "global-dirs": { ··· 629 629 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 630 630 "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 631 631 "requires": { 632 - "safer-buffer": "2.1.2" 632 + "safer-buffer": ">= 2.1.2 < 3" 633 633 } 634 634 }, 635 635 "ignore-walk": { ··· 637 637 "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", 638 638 "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", 639 639 "requires": { 640 - "minimatch": "3.0.4" 640 + "minimatch": "^3.0.4" 641 641 } 642 642 }, 643 643 "import-lazy": { ··· 657 657 "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 658 658 "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 659 659 "requires": { 660 - "once": "1.4.0", 661 - "wrappy": "1.0.2" 660 + "once": "^1.3.0", 661 + "wrappy": "1" 662 662 } 663 663 }, 664 664 "inherits": { ··· 685 685 "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", 686 686 "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", 687 687 "requires": { 688 - "number-is-nan": "1.0.1" 688 + "number-is-nan": "^1.0.0" 689 689 } 690 690 }, 691 691 "is-installed-globally": { ··· 753 753 "resolved": "https://registry.npmjs.org/jmp/-/jmp-1.0.0.tgz", 754 754 "integrity": "sha1-3khvrkVCJr1WEVqgIArqPCK3Amk=", 755 755 "requires": { 756 - "uuid": "3.3.2", 757 - "zeromq": "4.6.0" 756 + "uuid": "^3.0.1", 757 + "zeromq": "^4.0.0" 758 758 } 759 759 }, 760 760 "jsonfile": { ··· 762 762 "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", 763 763 "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", 764 764 "requires": { 765 - "graceful-fs": "4.1.11" 765 + "graceful-fs": "^4.1.6" 766 766 } 767 767 }, 768 768 "jupyter-paths": { ··· 770 770 "resolved": "https://registry.npmjs.org/jupyter-paths/-/jupyter-paths-2.0.0.tgz", 771 771 "integrity": "sha512-ZbilXKaJbzGmMDYY/ShC3JNC+/iqFhKaFAqN2VlzrYL17ZjBAM8nTAP2hsi3K5aR5MeQZ28sL+rFmVbDHtbXew==", 772 772 "requires": { 773 - "home-dir": "1.0.0" 773 + "home-dir": "^1.0.0" 774 774 } 775 775 }, 776 776 "kernelspecs": { ··· 778 778 "resolved": "https://registry.npmjs.org/kernelspecs/-/kernelspecs-2.0.0.tgz", 779 779 "integrity": "sha512-lce4pPDrs4VdxKYTEBnGLT81A3yNP8syyMAq5AejE+CKAkiXQXrHZaHO1F4c/RmgkKKF1Otis1XrpBxOOQsdnw==", 780 780 "requires": { 781 - "jupyter-paths": "2.0.0" 781 + "jupyter-paths": "^2.0.0" 782 782 } 783 783 }, 784 784 "latest-version": { ··· 833 833 "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 834 834 "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 835 835 "requires": { 836 - "brace-expansion": "1.1.11" 836 + "brace-expansion": "^1.1.7" 837 837 } 838 838 }, 839 839 "minimist": { ··· 846 846 "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.4.tgz", 847 847 "integrity": "sha512-mlouk1OHlaUE8Odt1drMtG1bAJA4ZA6B/ehysgV0LUIrDHdKgo1KorZq3pK0b/7Z7LJIQ12MNM6aC+Tn6lUZ5w==", 848 848 "requires": { 849 - "safe-buffer": "5.1.2", 850 - "yallist": "3.0.2" 849 + "safe-buffer": "^5.1.2", 850 + "yallist": "^3.0.0" 851 851 } 852 852 }, 853 853 "minizlib": { ··· 855 855 "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz", 856 856 "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", 857 857 "requires": { 858 - "minipass": "2.3.4" 858 + "minipass": "^2.2.1" 859 859 } 860 860 }, 861 861 "mkdirp": { ··· 881 881 "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.3.tgz", 882 882 "integrity": "sha512-GPL22d/U9cai87FcCPO6e+MT3vyHS2j+zwotakDc7kE2DtUAqFKMXLJCTtRp+5S75vXIwQPvIxkvlctxf9q4gQ==", 883 883 "requires": { 884 - "debug": "2.2.0", 885 - "iconv-lite": "0.4.24", 886 - "sax": "1.2.4" 884 + "debug": "^2.1.2", 885 + "iconv-lite": "^0.4.4", 886 + "sax": "^1.2.4" 887 887 } 888 888 }, 889 889 "noble": { ··· 891 891 "resolved": "https://registry.npmjs.org/noble/-/noble-1.9.1.tgz", 892 892 "integrity": "sha1-LM0x6tjsktv/bxmkLkILJYvNzdA=", 893 893 "requires": { 894 - "bluetooth-hci-socket": "0.5.1", 894 + "bluetooth-hci-socket": "^0.5.1", 895 895 "bplist-parser": "0.0.6", 896 - "debug": "2.2.0", 897 - "xpc-connection": "0.1.4" 896 + "debug": "~2.2.0", 897 + "xpc-connection": "~0.1.4" 898 898 }, 899 899 "dependencies": { 900 900 "bluetooth-hci-socket": { ··· 903 903 "integrity": "sha1-774hUk/Bz10/rl1RNl1WHUq77Qs=", 904 904 "optional": true, 905 905 "requires": { 906 - "debug": "2.2.0", 907 - "nan": "2.11.0", 908 - "usb": "1.3.3" 906 + "debug": "^2.2.0", 907 + "nan": "^2.0.5", 908 + "usb": "^1.1.0" 909 909 } 910 910 } 911 911 } ··· 915 915 "resolved": "https://registry.npmjs.org/noble-winrt/-/noble-winrt-0.1.1.tgz", 916 916 "integrity": "sha512-IUlWQfaHJMuiYOQTGvW4YdWeQR7E6tBVXut8KDMkIFGAKU+LNvTciWYTwHUlzqZKtuP3jc9VFMBvR9UDFNq7Sw==", 917 917 "requires": { 918 - "chrome-native-messaging": "0.2.0", 919 - "debug": "2.6.9", 920 - "noble": "1.9.1" 918 + "chrome-native-messaging": "^0.2.0", 919 + "debug": "^2.6.8", 920 + "noble": "^1.7.0" 921 921 }, 922 922 "dependencies": { 923 923 "debug": { ··· 940 940 "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.4.3.tgz", 941 941 "integrity": "sha512-b656V5C0628gOOA2kwcpNA/bxdlqYF9FvxJ+qqVX0ctdXNVZpS8J6xEUYir3WAKc7U0BH/NRlSpNbGsy+azjeg==", 942 942 "requires": { 943 - "semver": "5.5.1" 943 + "semver": "^5.4.1" 944 944 } 945 945 }, 946 946 "node-pre-gyp": { ··· 948 948 "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz", 949 949 "integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==", 950 950 "requires": { 951 - "detect-libc": "1.0.3", 952 - "mkdirp": "0.5.1", 953 - "needle": "2.2.3", 954 - "nopt": "4.0.1", 955 - "npm-packlist": "1.1.11", 956 - "npmlog": "4.1.2", 957 - "rc": "1.2.8", 958 - "rimraf": "2.6.2", 959 - "semver": "5.5.1", 960 - "tar": "4.4.6" 951 + "detect-libc": "^1.0.2", 952 + "mkdirp": "^0.5.1", 953 + "needle": "^2.2.1", 954 + "nopt": "^4.0.1", 955 + "npm-packlist": "^1.1.6", 956 + "npmlog": "^4.0.2", 957 + "rc": "^1.2.7", 958 + "rimraf": "^2.6.1", 959 + "semver": "^5.3.0", 960 + "tar": "^4" 961 961 } 962 962 }, 963 963 "noop-logger": { ··· 970 970 "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", 971 971 "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", 972 972 "requires": { 973 - "abbrev": "1.1.1", 974 - "osenv": "0.1.5" 973 + "abbrev": "1", 974 + "osenv": "^0.1.4" 975 975 } 976 976 }, 977 977 "npm-bundled": { ··· 984 984 "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.11.tgz", 985 985 "integrity": "sha512-CxKlZ24urLkJk+9kCm48RTQ7L4hsmgSVzEk0TLGPzzyuFxD7VNgy5Sl24tOLMzQv773a/NeJ1ce1DKeacqffEA==", 986 986 "requires": { 987 - "ignore-walk": "3.0.1", 988 - "npm-bundled": "1.0.5" 987 + "ignore-walk": "^3.0.1", 988 + "npm-bundled": "^1.0.1" 989 989 } 990 990 }, 991 991 "npm-run-path": { ··· 1002 1002 "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", 1003 1003 "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", 1004 1004 "requires": { 1005 - "are-we-there-yet": "1.1.5", 1006 - "console-control-strings": "1.1.0", 1007 - "gauge": "2.7.4", 1008 - "set-blocking": "2.0.0" 1005 + "are-we-there-yet": "~1.1.2", 1006 + "console-control-strings": "~1.1.0", 1007 + "gauge": "~2.7.3", 1008 + "set-blocking": "~2.0.0" 1009 1009 } 1010 1010 }, 1011 1011 "number-is-nan": { ··· 1023 1023 "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1024 1024 "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1025 1025 "requires": { 1026 - "wrappy": "1.0.2" 1026 + "wrappy": "1" 1027 1027 } 1028 1028 }, 1029 1029 "os-homedir": { ··· 1041 1041 "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", 1042 1042 "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", 1043 1043 "requires": { 1044 - "os-homedir": "1.0.2", 1045 - "os-tmpdir": "1.0.2" 1044 + "os-homedir": "^1.0.0", 1045 + "os-tmpdir": "^1.0.0" 1046 1046 } 1047 1047 }, 1048 1048 "p-finally": { ··· 1115 1115 "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.17.tgz", 1116 1116 "integrity": "sha512-syFcRIRzVI1BoEFOCaAiizwDolh1S1YXSodsVhncbhjzjZQulhczNRbqnUl9N31Q4dKGOXsNDqxC2BWBgSMqeQ==", 1117 1117 "requires": { 1118 - "async": "1.5.2", 1119 - "debug": "2.2.0", 1120 - "mkdirp": "0.5.1" 1118 + "async": "^1.5.2", 1119 + "debug": "^2.2.0", 1120 + "mkdirp": "0.5.x" 1121 1121 } 1122 1122 }, 1123 1123 "prebuild-install": { ··· 1125 1125 "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-2.5.3.tgz", 1126 1126 "integrity": "sha512-/rI36cN2g7vDQnKWN8Uzupi++KjyqS9iS+/fpwG4Ea8d0Pip0PQ5bshUNzVwt+/D2MRfhVAplYMMvWLqWrCF/g==", 1127 1127 "requires": { 1128 - "detect-libc": "1.0.3", 1129 - "expand-template": "1.1.1", 1128 + "detect-libc": "^1.0.3", 1129 + "expand-template": "^1.0.2", 1130 1130 "github-from-package": "0.0.0", 1131 - "minimist": "1.2.0", 1132 - "mkdirp": "0.5.1", 1133 - "node-abi": "2.4.3", 1134 - "noop-logger": "0.1.1", 1135 - "npmlog": "4.1.2", 1136 - "os-homedir": "1.0.2", 1137 - "pump": "2.0.1", 1138 - "rc": "1.2.8", 1139 - "simple-get": "2.8.1", 1140 - "tar-fs": "1.16.3", 1141 - "tunnel-agent": "0.6.0", 1142 - "which-pm-runs": "1.0.0" 1131 + "minimist": "^1.2.0", 1132 + "mkdirp": "^0.5.1", 1133 + "node-abi": "^2.2.0", 1134 + "noop-logger": "^0.1.1", 1135 + "npmlog": "^4.0.1", 1136 + "os-homedir": "^1.0.1", 1137 + "pump": "^2.0.1", 1138 + "rc": "^1.1.6", 1139 + "simple-get": "^2.7.0", 1140 + "tar-fs": "^1.13.0", 1141 + "tunnel-agent": "^0.6.0", 1142 + "which-pm-runs": "^1.0.0" 1143 1143 }, 1144 1144 "dependencies": { 1145 1145 "minimist": { ··· 1171 1171 "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", 1172 1172 "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", 1173 1173 "requires": { 1174 - "end-of-stream": "1.4.1", 1175 - "once": "1.4.0" 1174 + "end-of-stream": "^1.1.0", 1175 + "once": "^1.3.1" 1176 1176 } 1177 1177 }, 1178 1178 "rc": { ··· 1180 1180 "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", 1181 1181 "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", 1182 1182 "requires": { 1183 - "deep-extend": "0.6.0", 1184 - "ini": "1.3.5", 1185 - "minimist": "1.2.0", 1186 - "strip-json-comments": "2.0.1" 1183 + "deep-extend": "^0.6.0", 1184 + "ini": "~1.3.0", 1185 + "minimist": "^1.2.0", 1186 + "strip-json-comments": "~2.0.1" 1187 1187 }, 1188 1188 "dependencies": { 1189 1189 "minimist": { ··· 1198 1198 "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 1199 1199 "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 1200 1200 "requires": { 1201 - "core-util-is": "1.0.2", 1202 - "inherits": "2.0.3", 1203 - "isarray": "1.0.0", 1204 - "process-nextick-args": "2.0.0", 1205 - "safe-buffer": "5.1.2", 1206 - "string_decoder": "1.1.1", 1207 - "util-deprecate": "1.0.2" 1201 + "core-util-is": "~1.0.0", 1202 + "inherits": "~2.0.3", 1203 + "isarray": "~1.0.0", 1204 + "process-nextick-args": "~2.0.0", 1205 + "safe-buffer": "~5.1.1", 1206 + "string_decoder": "~1.1.1", 1207 + "util-deprecate": "~1.0.1" 1208 1208 } 1209 1209 }, 1210 1210 "regenerator-runtime": { ··· 1236 1236 "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", 1237 1237 "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", 1238 1238 "requires": { 1239 - "glob": "7.1.3" 1239 + "glob": "^7.0.5" 1240 1240 } 1241 1241 }, 1242 1242 "rxjs": { ··· 1244 1244 "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.2.tgz", 1245 1245 "integrity": "sha512-hV7criqbR0pe7EeL3O66UYVg92IR0XsA97+9y+BWTePK9SKmEI5Qd3Zj6uPnGkNzXsBywBQWTvujPl+1Kn9Zjw==", 1246 1246 "requires": { 1247 - "tslib": "1.9.3" 1247 + "tslib": "^1.9.0" 1248 1248 } 1249 1249 }, 1250 1250 "safe-buffer": { ··· 1311 1311 "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", 1312 1312 "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", 1313 1313 "requires": { 1314 - "decompress-response": "3.3.0", 1315 - "once": "1.4.0", 1316 - "simple-concat": "1.0.0" 1314 + "decompress-response": "^3.3.0", 1315 + "once": "^1.3.1", 1316 + "simple-concat": "^1.0.0" 1317 1317 } 1318 1318 }, 1319 1319 "slash": { ··· 1327 1327 "resolved": "https://registry.npmjs.org/spawnteract/-/spawnteract-4.0.0.tgz", 1328 1328 "integrity": "sha512-+FozhawsjyfnLjKx/CVZ8IbX7fUPl/pG4oKiULfHlxg9S7YOM5Z5YQoJLm83Z5SAm+VKZFHax2L/tdkDXO3fuQ==", 1329 1329 "requires": { 1330 - "jsonfile": "3.0.1", 1331 - "jupyter-paths": "2.0.0", 1332 - "kernelspecs": "2.0.0", 1333 - "mkdirp": "0.5.1", 1334 - "portfinder": "1.0.17", 1335 - "uuid": "3.3.2" 1330 + "jsonfile": "^3.0.0", 1331 + "jupyter-paths": "^2.0.0", 1332 + "kernelspecs": "^2.0.0", 1333 + "mkdirp": "^0.5.1", 1334 + "portfinder": "^1.0.13", 1335 + "uuid": "^3.0.1" 1336 1336 } 1337 1337 }, 1338 1338 "string-width": { ··· 1340 1340 "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 1341 1341 "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 1342 1342 "requires": { 1343 - "code-point-at": "1.1.0", 1344 - "is-fullwidth-code-point": "1.0.0", 1345 - "strip-ansi": "3.0.1" 1343 + "code-point-at": "^1.0.0", 1344 + "is-fullwidth-code-point": "^1.0.0", 1345 + "strip-ansi": "^3.0.0" 1346 1346 } 1347 1347 }, 1348 1348 "string_decoder": { ··· 1350 1350 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 1351 1351 "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 1352 1352 "requires": { 1353 - "safe-buffer": "5.1.2" 1353 + "safe-buffer": "~5.1.0" 1354 1354 } 1355 1355 }, 1356 1356 "strip-ansi": { ··· 1358 1358 "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 1359 1359 "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 1360 1360 "requires": { 1361 - "ansi-regex": "2.1.1" 1361 + "ansi-regex": "^2.0.0" 1362 1362 } 1363 1363 }, 1364 1364 "strip-eof": { ··· 1388 1388 "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.6.tgz", 1389 1389 "integrity": "sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg==", 1390 1390 "requires": { 1391 - "chownr": "1.0.1", 1392 - "fs-minipass": "1.2.5", 1393 - "minipass": "2.3.4", 1394 - "minizlib": "1.1.0", 1395 - "mkdirp": "0.5.1", 1396 - "safe-buffer": "5.1.2", 1397 - "yallist": "3.0.2" 1391 + "chownr": "^1.0.1", 1392 + "fs-minipass": "^1.2.5", 1393 + "minipass": "^2.3.3", 1394 + "minizlib": "^1.1.0", 1395 + "mkdirp": "^0.5.0", 1396 + "safe-buffer": "^5.1.2", 1397 + "yallist": "^3.0.2" 1398 1398 } 1399 1399 }, 1400 1400 "tar-fs": { ··· 1402 1402 "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", 1403 1403 "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", 1404 1404 "requires": { 1405 - "chownr": "1.0.1", 1406 - "mkdirp": "0.5.1", 1407 - "pump": "1.0.3", 1408 - "tar-stream": "1.6.1" 1405 + "chownr": "^1.0.1", 1406 + "mkdirp": "^0.5.1", 1407 + "pump": "^1.0.0", 1408 + "tar-stream": "^1.1.2" 1409 1409 }, 1410 1410 "dependencies": { 1411 1411 "pump": { ··· 1413 1413 "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", 1414 1414 "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", 1415 1415 "requires": { 1416 - "end-of-stream": "1.4.1", 1417 - "once": "1.4.0" 1416 + "end-of-stream": "^1.1.0", 1417 + "once": "^1.3.1" 1418 1418 } 1419 1419 } 1420 1420 } ··· 1424 1424 "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.1.tgz", 1425 1425 "integrity": "sha512-IFLM5wp3QrJODQFPm6/to3LJZrONdBY/otxcvDIQzu217zKye6yVR3hhi9lAjrC2Z+m/j5oDxMPb1qcd8cIvpA==", 1426 1426 "requires": { 1427 - "bl": "1.2.2", 1428 - "buffer-alloc": "1.2.0", 1429 - "end-of-stream": "1.4.1", 1430 - "fs-constants": "1.0.0", 1431 - "readable-stream": "2.3.6", 1432 - "to-buffer": "1.1.1", 1433 - "xtend": "4.0.1" 1427 + "bl": "^1.0.0", 1428 + "buffer-alloc": "^1.1.0", 1429 + "end-of-stream": "^1.0.0", 1430 + "fs-constants": "^1.0.0", 1431 + "readable-stream": "^2.3.0", 1432 + "to-buffer": "^1.1.0", 1433 + "xtend": "^4.0.0" 1434 1434 } 1435 1435 }, 1436 1436 "term-size": { ··· 1472 1472 "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 1473 1473 "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 1474 1474 "requires": { 1475 - "safe-buffer": "5.1.2" 1475 + "safe-buffer": "^5.0.1" 1476 1476 } 1477 1477 }, 1478 1478 "unique-string": { ··· 1560 1560 "integrity": "sha512-WRBxI54yEs2QPj28G6kITI3Wu7VxrtHbqiDvDRUDKdg97lcK1pTP8y9LoDWF22OiCCrEvrdeq0lNcr84QOzjXQ==", 1561 1561 "optional": true, 1562 1562 "requires": { 1563 - "nan": "2.11.0", 1564 - "node-pre-gyp": "0.10.3" 1563 + "nan": "^2.8.0", 1564 + "node-pre-gyp": "^0.10.0" 1565 1565 } 1566 1566 }, 1567 1567 "util-deprecate": { ··· 1593 1593 "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", 1594 1594 "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", 1595 1595 "requires": { 1596 - "string-width": "1.0.2" 1596 + "string-width": "^1.0.2 || 2" 1597 1597 } 1598 1598 }, 1599 1599 "widest-line": { ··· 1666 1666 "integrity": "sha1-3Nf6oq7Gt6bhjMXdrQQvejTHcVY=", 1667 1667 "optional": true, 1668 1668 "requires": { 1669 - "nan": "2.11.0" 1669 + "nan": "^2.0.5" 1670 1670 } 1671 1671 }, 1672 1672 "xtend": { ··· 1684 1684 "resolved": "https://registry.npmjs.org/zeromq/-/zeromq-4.6.0.tgz", 1685 1685 "integrity": "sha512-sU7pQqQj7f/C6orJZAXls+NEKaVMZZtnZqpMPTq5d5dP78CmdC0g15XIviFAN6poPuKl9qlGt74vipOUUuNeWg==", 1686 1686 "requires": { 1687 - "nan": "2.11.0", 1688 - "prebuild-install": "2.5.3" 1687 + "nan": "^2.6.2", 1688 + "prebuild-install": "^2.2.2" 1689 1689 } 1690 1690 } 1691 1691 }
+7 -9
app/reducers/deviceReducer.js
··· 1 1 // @flow 2 - import { Observable } from "rxjs"; 2 + import { Observable } from 'rxjs'; 3 3 import { 4 4 SET_DEVICE_INFO, 5 5 SET_DEVICE_TYPE, ··· 8 8 SET_RAW_OBSERVABLE, 9 9 SET_SIGNAL_OBSERVABLE, 10 10 DEVICE_CLEANUP 11 - } from "../epics/deviceEpics"; 11 + } from '../epics/deviceEpics'; 12 12 import { 13 13 DEVICES, 14 14 CONNECTION_STATUS, 15 15 DEVICE_AVAILABILITY 16 - } from "../constants/constants"; 17 - import { ActionType, DeviceInfo } from "../constants/interfaces"; 18 - import { SET_DEVICE_AVAILABILITY } from "../actions/deviceActions"; 16 + } from '../constants/constants'; 17 + import { ActionType, DeviceInfo } from '../constants/interfaces'; 18 + import { SET_DEVICE_AVAILABILITY } from '../actions/deviceActions'; 19 19 20 20 interface DeviceStateType { 21 21 +availableDevices: Array<any>; ··· 29 29 30 30 const initialState = { 31 31 availableDevices: [], 32 - connectedDevice: { name: "disconnected", samplingRate: 0 }, 32 + connectedDevice: { name: 'disconnected', samplingRate: 0 }, 33 33 connectionStatus: CONNECTION_STATUS.NOT_YET_CONNECTED, 34 34 deviceAvailability: DEVICE_AVAILABILITY.NONE, 35 35 rawObservable: null, ··· 85 85 }; 86 86 87 87 case DEVICE_CLEANUP: 88 - return { 89 - ...initialState 90 - }; 88 + return initialState; 91 89 92 90 default: 93 91 return state;
+12 -12
app/reducers/experimentReducer.js
··· 2 2 import { 3 3 SET_TIMELINE, 4 4 SET_IS_RUNNING, 5 - SET_SESSION 6 - } from "../epics/experimentEpics"; 5 + SET_SESSION, 6 + EXPERIMENT_CLEANUP 7 + } from '../epics/experimentEpics'; 7 8 import { 8 9 SET_TYPE, 9 10 SET_SUBJECT, 10 11 SET_TITLE, 11 12 SET_EXPERIMENT_STATE 12 - } from "../actions/experimentActions"; 13 - import { EXPERIMENTS } from "../constants/constants"; 14 - import { 15 - MainTimeline, 16 - Trial, 17 - Timeline, 18 - ActionType 19 - } from "../constants/interfaces"; 13 + } from '../actions/experimentActions'; 14 + import { EXPERIMENTS } from '../constants/constants'; 15 + import { MainTimeline, Trial, ActionType } from '../constants/interfaces'; 20 16 21 17 export interface ExperimentStateType { 22 18 +type: ?EXPERIMENTS; ··· 33 29 34 30 const initialState = { 35 31 type: EXPERIMENTS.NONE, 36 - title: "Test Experiment", 32 + title: '', 37 33 params: {}, 38 34 mainTimeline: [], 39 35 trials: {}, 40 36 timelines: {}, 41 37 plugins: {}, 42 - subject: "", 38 + subject: '', 43 39 session: 1, 44 40 isRunning: false 45 41 }; ··· 89 85 return { 90 86 ...action.payload 91 87 }; 88 + 89 + case EXPERIMENT_CLEANUP: 90 + return initialState; 91 + 92 92 default: 93 93 return state; 94 94 }
+12 -3
app/reducers/jupyterReducer.js
··· 8 8 SET_PSD_PLOT, 9 9 SET_ERP_PLOT, 10 10 RECEIVE_EXECUTE_RETURN 11 - } from "../epics/jupyterEpics"; 12 - import { ActionType, Kernel } from "../constants/interfaces"; 13 - import { KERNEL_STATUS } from "../constants/constants"; 11 + } from '../epics/jupyterEpics'; 12 + import { ActionType, Kernel } from '../constants/interfaces'; 13 + import { KERNEL_STATUS } from '../constants/constants'; 14 + import { EXPERIMENT_CLEANUP } from '../epics/experimentEpics'; 14 15 15 16 export interface JupyterStateType { 16 17 +kernel: ?Kernel; ··· 72 73 return { 73 74 ...state, 74 75 erpPlot: action.payload 76 + }; 77 + 78 + case EXPERIMENT_CLEANUP: 79 + return { 80 + ...state, 81 + epochsInfo: null, 82 + psdPlot: null, 83 + erpPlot: null 75 84 }; 76 85 77 86 case RECEIVE_EXECUTE_RETURN:
+5 -2
app/utils/eeg/emotiv.js
··· 56 56 err => console.log(err) 57 57 ); 58 58 59 + export const disconnectFromEmotiv = async () => { 60 + const sessionStatus = await client.updateSession({ status: 'close' }); 61 + return sessionStatus; 62 + }; 63 + 59 64 // Returns an observable that will handle both connecting to Client and providing a source of EEG data 60 65 export const createRawEmotivObservable = async () => { 61 66 const subs = await client.subscribe({ streams: ['eeg', 'dev'] }); ··· 74 79 samplingRate, 75 80 channels 76 81 }), 77 - // the sampling rate parameter can be taken out in the newest version of pipes 78 82 epoch({ 79 - samplingRate, 80 83 duration: intervalSamples, 81 84 interval: intervalSamples 82 85 }),
+2 -2
app/utils/eeg/muse.js
··· 54 54 }; 55 55 }; 56 56 57 + export const disconnectFromMuse = () => client.disconnect(); 58 + 57 59 // Awaits Muse connectivity before sending an observable rep. EEG stream 58 60 export const createRawMuseObservable = async () => { 59 61 await client.start(); ··· 77 79 samplingRate, 78 80 channelNames 79 81 }), 80 - // the sampling rate parameter can be taken out in the newest version of pipes 81 82 epoch({ 82 - samplingRate, 83 83 duration: intervalSamples, 84 84 interval: intervalSamples 85 85 }),