{"_id":"fusion-plugin-redux-action-emitter-enhancer","_rev":"516-c3931ef582c46a498586ab5145728cd6","name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","dist-tags":{"latest":"3.4.8","canary":"0.0.0-canary.ca778ef.0"},"versions":{"0.2.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.2.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer.git"},"files":["dist","src"],"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"8.2.1","babel-plugin-transform-flow-strip-types":"6.22.0","create-universal-package":"3.2.6","eslint":"4.16.0","eslint-config-fusion":"0.1.2","eslint-plugin-cup":"1.0.0","eslint-plugin-flowtype":"2.41.0","eslint-plugin-prettier":"2.5.0","eslint-plugin-react":"7.5.1","flow-bin":"0.59.0","fusion-core":"^0.3.0-5","fusion-plugin-universal-events":"^0.3.0","fusion-tokens":"^0.0.5","nyc":"11.4.1","prettier":"1.4.2","redux":"3.7.2","tape-cup":"4.7.1","unitest":"2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","transpile":"npm run clean && cup build","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run transpile"},"engines":{"node":">= 8.9.0"},"peerDependencies":{"fusion-core":"^0.3.0-5","fusion-plugin-universal-events":"^0.3.0"},"gitHead":"58c758a9e6fc722518bb5ac2ef22375edba45d6a","bugs":{"url":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer/issues"},"homepage":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer#readme","_id":"fusion-plugin-redux-action-emitter-enhancer@0.2.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"dist":{"integrity":"sha512-EteAsVqeSowFfT1RIjfyMNVbQ9Mnc5E1SDcXiqPrFcHmqZKihf7M7ompBGGncl5bZ3+yuLyVcAOb4MVOFUileg==","shasum":"c7d10adb1c4c5b76763366c18a9ffc3726723312","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC8GaI2PJbECbAtI4hPMIVmePo1ph6Qvva//75MXCsJLAiBzxVMg90JXGdKw78qoIj+E71Wkp3vedXt7JeFv1q+dgQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer-0.2.0.tgz_1516752068131_0.7324255681596696"},"directories":{}},"0.2.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.2.1","license":"MIT","repository":{"type":"git","url":"git+https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer.git"},"files":["dist","src"],"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"8.2.1","babel-plugin-transform-flow-strip-types":"6.22.0","create-universal-package":"3.2.6","eslint":"4.16.0","eslint-config-fusion":"0.1.2","eslint-plugin-cup":"1.0.0","eslint-plugin-flowtype":"2.41.0","eslint-plugin-prettier":"2.5.0","eslint-plugin-react":"7.5.1","flow-bin":"0.59.0","fusion-core":"^0.3.0-5","fusion-plugin-react-redux":"^0.2.0","fusion-plugin-universal-events":"^0.3.0","fusion-test-utils":"^0.4.1","fusion-tokens":"^0.0.5","nyc":"11.4.1","prettier":"1.4.2","react":"^16.2.0","react-redux":"^5.0.6","redux":"3.7.2","tape-cup":"4.7.1","unitest":"2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","transpile":"npm run clean && cup build","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run transpile"},"engines":{"node":">= 8.9.0"},"peerDependencies":{"fusion-core":"^0.3.0-5","fusion-plugin-universal-events":"^0.3.0"},"gitHead":"f61762e8c1d307d32c21cdc16969fda1c1748c47","bugs":{"url":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer/issues"},"homepage":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer#readme","_id":"fusion-plugin-redux-action-emitter-enhancer@0.2.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"dist":{"integrity":"sha512-tBYh2a1/Q4YkrJTqnpDngdSos1RR2Rpa6iDskJxtiWd+Iqa8gXaJLaINKEETm/yg3gHUxm7t4/OTCuL4uWR0aA==","shasum":"381922d081f53f68e209634ef7f15b495209a8e0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.2.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIASOUKJ6gL3aay14DqG8oSDpLS79zqqgb7wDAHwVcSfdAiBN3UzqXnBBk9+bisKMN8Kn6BUXFMOfiKcqnEWgicbimQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer-0.2.1.tgz_1516755060069_0.6392932666931301"},"directories":{}},"0.2.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.2.2","license":"MIT","repository":{"type":"git","url":"git+https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer.git"},"files":["dist","src"],"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"8.2.1","babel-plugin-transform-flow-strip-types":"6.22.0","create-universal-package":"3.3.1","eslint":"4.16.0","eslint-config-fusion":"0.1.2","eslint-plugin-cup":"1.0.0","eslint-plugin-flowtype":"2.42.0","eslint-plugin-prettier":"2.5.0","eslint-plugin-react":"7.6.1","flow-bin":"0.64.0","fusion-core":"^0.3.0-5","fusion-plugin-react-redux":"^0.2.0","fusion-plugin-universal-events":"^0.3.0","fusion-test-utils":"^0.4.1","fusion-tokens":"^0.0.5","nyc":"11.4.1","prettier":"1.10.2","react":"^16.2.0","react-redux":"^5.0.6","redux":"3.7.2","tape-cup":"4.7.1","unitest":"2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","transpile":"npm run clean && cup build","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run transpile"},"engines":{"node":">= 8.9.0"},"peerDependencies":{"fusion-core":"^0.3.0-5","fusion-plugin-universal-events":"^0.3.0"},"gitHead":"8367db0d8925aa411c1be7756e1d203ba204e467","bugs":{"url":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer/issues"},"homepage":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer#readme","_id":"fusion-plugin-redux-action-emitter-enhancer@0.2.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"dist":{"integrity":"sha512-UINQimebDpcrwcJ0ijeAqVvJSKRTRt2x6GzXTGDAKCAUmgF3OJQOfT6sj7FLGNLgpF1O652WcfvRsHi6Gmn7Aw==","shasum":"2532ff6ac290f3caf629a3e2cd49bc0ab1af31f3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.2.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7C6W/e9DUEaT+2LRxWZ5J7Kp7UxcaqDPqot102TXOSQIhAKBGD1l/rGIyFo7Kv+I+vlhiVFklVnK2kTz6LdleaiZk"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer-0.2.2.tgz_1517261105019_0.22463245317339897"},"directories":{}},"1.0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"1.0.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer.git"},"files":["dist","src"],"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"8.2.1","babel-plugin-transform-flow-strip-types":"6.22.0","create-universal-package":"3.4.0","eslint":"4.17.0","eslint-config-fusion":"^1.0.0","eslint-plugin-cup":"1.0.0","eslint-plugin-flowtype":"2.42.0","eslint-plugin-import":"^2.8.0","eslint-plugin-prettier":"2.6.0","eslint-plugin-react":"7.6.1","flow-bin":"0.65.0","fusion-core":"^1.0.0","fusion-plugin-react-redux":"^1.0.0","fusion-plugin-universal-events":"^1.0.0","fusion-test-utils":"^1.0.0","fusion-tokens":"^1.0.0","nyc":"11.4.1","prettier":"1.10.2","react":"^16.2.0","react-redux":"^5.0.6","redux":"3.7.2","tape-cup":"4.7.1","unitest":"2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","transpile":"npm run clean && cup build","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run transpile"},"engines":{"node":">= 8.9.0"},"peerDependencies":{"fusion-core":"^1.0.0","fusion-plugin-universal-events":"^1.0.0"},"gitHead":"0b13a878b60ec2dc2733b318b730087eeff3b047","bugs":{"url":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer/issues"},"homepage":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer#readme","_id":"fusion-plugin-redux-action-emitter-enhancer@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"dist":{"integrity":"sha512-hl2Pl+fn3duH721pfwBVEUne3ICMDWpF0ozhe5yhsLTvU5On5GFGuLFKdBsnXCmsztSyQSbYxyQ9+TU/mUF3Bw==","shasum":"96fc67a487bd4c29f9dcf1ad96a800ad0deaf515","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-1.0.0.tgz","fileCount":20,"unpackedSize":24205,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICh0vk6W1Ni54lNJ2ykX0uX7t1cT5hPoy5axlvzZfOqeAiAXKYfNkDTGl+v2MTDPaldpcGZDCUsWXkS4y9v/Gpaz+A=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_1.0.0_1518219815257_0.6752672300083267"},"_hasShrinkwrap":false},"1.0.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"1.0.1","license":"MIT","repository":{"type":"git","url":"git+https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer.git"},"files":["dist","src"],"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"8.2.1","babel-plugin-transform-flow-strip-types":"6.22.0","create-universal-package":"3.4.0","eslint":"4.17.0","eslint-config-fusion":"^1.0.0","eslint-plugin-cup":"1.0.0","eslint-plugin-flowtype":"2.43.0","eslint-plugin-import":"^2.8.0","eslint-plugin-prettier":"2.6.0","eslint-plugin-react":"7.6.1","flow-bin":"0.65.0","fusion-core":"^1.0.0","fusion-plugin-react-redux":"^1.0.0","fusion-plugin-universal-events":"^1.0.0","fusion-test-utils":"^1.0.0","fusion-tokens":"^1.0.0","nyc":"11.4.1","prettier":"1.10.2","react":"^16.2.0","react-redux":"^5.0.6","redux":"3.7.2","tape-cup":"4.7.1","unitest":"2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","transpile":"npm run clean && cup build","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run transpile"},"engines":{"node":">= 8.9.0"},"peerDependencies":{"fusion-core":"^1.0.0","fusion-plugin-universal-events":"^1.0.0"},"gitHead":"9d5f0b42f1945c3ccf0699dd73be2ab198995f42","bugs":{"url":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer/issues"},"homepage":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer#readme","_id":"fusion-plugin-redux-action-emitter-enhancer@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"dist":{"integrity":"sha512-g12y6zHlC+pkjnd3jDX8ar9Yd09WZG03jGxVdrieID3EITNsy5TaxgAgRDs6+x75njUZZnb65gDz5V6Eodo0Vg==","shasum":"7978b25bb30fe59d73829ebadc60d2d3eda1b574","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-1.0.1.tgz","fileCount":20,"unpackedSize":24274,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtsyrihr1wE3ReNe3Z4zWzI/JtQfiD8k1F/0t8zMPZawIgMXAl1r7kVpElRIkiVsxVPWYwMg17rZnwVm4+kXmsBOA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_1.0.1_1518468308019_0.2755501142439454"},"_hasShrinkwrap":false},"1.0.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"1.0.2","license":"MIT","repository":{"type":"git","url":"git+https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer.git"},"files":["dist","src"],"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"8.2.1","babel-plugin-transform-flow-strip-types":"6.22.0","create-universal-package":"3.4.0","eslint":"4.17.0","eslint-config-fusion":"^1.0.0","eslint-plugin-cup":"1.0.0","eslint-plugin-flowtype":"2.43.0","eslint-plugin-import":"^2.8.0","eslint-plugin-prettier":"2.6.0","eslint-plugin-react":"7.6.1","flow-bin":"0.65.0","fusion-core":"^1.0.0","fusion-plugin-react-redux":"^1.0.1","fusion-plugin-universal-events":"^1.0.1","fusion-test-utils":"^1.0.1","fusion-tokens":"^1.0.1","nyc":"11.4.1","prettier":"1.10.2","react":"^16.2.0","react-redux":"^5.0.6","redux":"3.7.2","tape-cup":"4.7.1","unitest":"2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","transpile":"npm run clean && cup build","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run transpile"},"engines":{"node":">= 8.9.0"},"peerDependencies":{"fusion-core":"^1.0.0","fusion-plugin-universal-events":"^1.0.1"},"gitHead":"964fe5383b2f6bb56a7eef7950fc500dd411b987","bugs":{"url":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer/issues"},"homepage":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer#readme","_id":"fusion-plugin-redux-action-emitter-enhancer@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"dist":{"integrity":"sha512-j+jI39axV5Wkgbb9ahVdCi8xms5c4Up2mICv53diOz21xed0nne49EtEiQyKsIRJWQGPUwC6S7upAJYjOu4b4Q==","shasum":"1413e15cfa11f410855ea9116816e0198871b470","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-1.0.2.tgz","fileCount":20,"unpackedSize":24490,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBACcxqrRo3w5KtjLP0oG8lkDP0XcDOHb1o4UrjijpYAiEAkrHaos9w0FxzrAdOrHWTjM0sjoBTcNESDH2Q6kT3Z74="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_1.0.2_1518475389039_0.22714346876428326"},"_hasShrinkwrap":false},"1.0.3":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"1.0.3","license":"MIT","repository":{"type":"git","url":"git+https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer.git"},"files":["dist","src"],"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"8.2.3","babel-plugin-transform-flow-strip-types":"6.22.0","create-universal-package":"3.4.1","eslint":"4.19.1","eslint-config-fusion":"^1.0.1","eslint-plugin-cup":"1.0.0","eslint-plugin-flowtype":"^2.46.3","eslint-plugin-import":"^2.11.0","eslint-plugin-prettier":"2.6.0","eslint-plugin-react":"7.7.0","flow-bin":"^0.71.0","fusion-core":"^1.2.6","fusion-plugin-react-redux":"^1.0.4","fusion-plugin-universal-events":"^1.0.3","fusion-test-utils":"^1.0.5","fusion-tokens":"^1.0.3","nyc":"^11.7.1","prettier":"^1.12.1","react":"^16.3.2","react-redux":"^5.0.7","redux":"^4.0.0","tape-cup":"4.7.1","unitest":"2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","transpile":"npm run clean && cup build","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run transpile"},"engines":{"node":">= 8.9.0"},"peerDependencies":{"fusion-core":"^1.0.0","fusion-plugin-universal-events":"^1.0.1"},"gitHead":"499149cafef2e98bfdfeeb5b0240ac474a99bed7","bugs":{"url":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer/issues"},"homepage":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer#readme","_id":"fusion-plugin-redux-action-emitter-enhancer@1.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"dist":{"integrity":"sha512-mL/YrNfY9recCdsa7KvVKYr7gr99UjSpzOiZnUBNEr1abFc5UlRcicbDBgeWFZyaiSrD1DYBeeAPSV4JQfmp0g==","shasum":"7365646b3cbe57800545440a743255583791c750","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-1.0.3.tgz","fileCount":20,"unpackedSize":35100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa8jOQCRA9TVsSAnZWagAA1O4QAIhuieHp3NSEpnZUM7Fk\nilcTHS65lHPPxOpY1XyOMFqFbmyZFdpv8KjFBRnVAfT9pW3KTE2Er894qrNg\nesY/kUFeV9koub6wHNM2v4DsGLkZuLalUmYRLin2SRZ1CIxSNVtOdIMKFqGg\n7LJzu4W9EeJp4hG9hdU4VjgXGok1oAuJnSgnMYaEuyuki19ASs0wMtyhFaQB\nI1muzSbiw1cO6qPuilX8qD4SahiXGCtuEAb6RtNPgjW7ibQapPUUdGBwN3KF\nEvSevNboGAXbCk3udB2haz0WF9KNwneJV6f63T+3bzUNHW3JQANa0NSn9rCM\nIDubWwYzbl5XGRqjUR2Ppycyucu3ujqsn1r4WfUu0u7RDbkzrvFMC8BAaW6q\naN2aWd0lOcjs5/2pYxzD5iCJOEhAf0yTI1XEh5Px/DD53Kz9l8ip4BLI2emA\nmslmmBJPNcjENyZNiGW2g0KekWr+YB4y9dysRAUiX59tOuABG8R7roKr0WtK\ndNRd9Ytqn0aYEYIf18LFDrkvzLDYxQ8VzQ3Fr7qPRC6QTml0d9P//c2jhOvO\nCfelh9zn3w6ym5rt0U4cQVvzEqP8CMiFBRpzMLQRDX1VKvUg86kFU0rW0eLC\nE0ybwkMdBK2MDEGdZztIHoMKA/6OZNywcEJCEYd/lEfrfnDnnh/SAc1cf0EM\nJeHJ\r\n=u02r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDo6Vhd/RR5yQ/8RPMhhAQLh4FsRD2nWkaBxRToHBYeoQIgW4ZmnZKBZyoymqwafM/BzuwisS0wYBknPgMstCsxw2M="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_1.0.3_1525822352217_0.16312753641612132"},"_hasShrinkwrap":false},"1.0.4":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"1.0.4","license":"MIT","repository":{"type":"git","url":"git+https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer.git"},"files":["dist","flow-typed","src"],"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"8.2.3","babel-plugin-transform-flow-strip-types":"6.22.0","create-universal-package":"3.4.4","eslint":"4.19.1","eslint-config-fusion":"^1.0.1","eslint-plugin-cup":"1.0.2","eslint-plugin-flowtype":"^2.46.3","eslint-plugin-import":"^2.12.0","eslint-plugin-prettier":"2.6.0","eslint-plugin-react":"7.8.2","flow-bin":"^0.72.0","fusion-core":"^1.3.0","fusion-plugin-react-redux":"^1.0.4","fusion-plugin-universal-events":"^1.0.3","fusion-test-utils":"^1.1.0","fusion-tokens":"^1.0.3","nyc":"^11.8.0","prettier":"^1.12.1","react":"^16.3.2","react-redux":"^5.0.7","redux":"^4.0.0","tape-cup":"4.7.1","unitest":"2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","transpile":"npm run clean && cup build","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run transpile"},"engines":{"node":">= 8.9.0"},"peerDependencies":{"fusion-core":"^1.0.0","fusion-plugin-universal-events":"^1.0.1"},"gitHead":"b7f2cf72d2e6b4836374715d6cbb462c4f283ac3","bugs":{"url":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer/issues"},"homepage":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer#readme","_id":"fusion-plugin-redux-action-emitter-enhancer@1.0.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"dist":{"integrity":"sha512-1HuqzZ3BXBBb4nYEtlcc+PPu1FoRFdCx7RC7UEOxbTqQ7/aStVNDdxXeQ3Yay35oqN0yv0Kh9f8d92hJ3XCw1A==","shasum":"5972435b3b5037f92473c55676445cf049d438d8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-1.0.4.tgz","fileCount":23,"unpackedSize":42296,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbD0JTCRA9TVsSAnZWagAA0UkP/3mvqpPbPKYNd1YrKSyK\nzkcjhImBWy0oR7q4WGHLhs30KvSePAlgCVbhc7PjNmFa4+oYFgEni/50WqU+\nkMZyHsdooZRamB++HQs2fWjU2cYaOU3jVfc263mYfJo+xhArIIv9048AtGmO\nvAUlzmnbvVuCcx0+QhYl83qwon4lR9O0mqw8UuEMQdaU3Y5HckxqLeG0tFce\neKfCXC9C8gVQEtTPoCV0sH1lLZIAsM7qgKY7iiQihAreZFzRTmrLd3xbYfPU\ngh/rVT6VDnDeZ33GBoBJeeqZy0VerVSPUX1tsmntjUIp5BJHiE6HfZHpGnU0\nsVO0VmtD/t72b0YEAx8Ww4xGVRTd752p2DVGvJeo7a/KRMI7MgHc2LZ39M0D\nMaq1QVAaLhJWa888p9DTyiQk/NLQTfn5Jlr9MvLM0XdZv4/3Wxi90ku3IRiV\n8yHOT/3qGvW+WlS/kkwD+FkSyX2y3VB4TsAdl4P3luY0s4ixHN+nr7NlQW6L\nZeiYRo0jZ53qrR2sGD/KfcVMXIZL8Qw1mITsbroCpaRqdvP73ORsktWTcx4W\nnaa0juWVBX+Jd9MtuDzARJ7ffb+u+/IEdmv937oZyt/SKxTR78VD6+HsqxO4\nll/P9dL84n+0ZrBXrEAjrbQe1gV84ES3haEriXXX2FqzTa7ZTjaxloXEkJXL\ns1ct\r\n=pOrY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA3PwiZJngZS+Wq2XCuVpAcYDKgZ5lmn3C5rmKwdRWpnAiA5ukMEnw7NFBV/jm1XAJ5sILAKEY5/9UH2c37hcTKs0w=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_1.0.4_1527726674275_0.8868722101179776"},"_hasShrinkwrap":false},"2.0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"2.0.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"8.2.6","babel-plugin-transform-flow-strip-types":"6.22.0","create-universal-package":"3.4.6","eslint":"5.3.0","eslint-config-fusion":"^4.0.0","eslint-plugin-cup":"2.0.0","eslint-plugin-flowtype":"^2.48.0","eslint-plugin-import":"^2.12.0","eslint-plugin-prettier":"2.6.2","eslint-plugin-react":"7.11.1","flow-bin":"^0.77.0","fusion-core":"^1.3.1","fusion-plugin-react-redux":"^1.0.7","fusion-plugin-universal-events":"^1.0.5","fusion-test-utils":"^1.1.0","fusion-tokens":"^1.0.3","nyc":"^12.0.0","prettier":"^1.13.3","react":"^16.4.0","react-redux":"^5.0.7","redux":"^4.0.0","tape-cup":"4.7.1","unitest":"2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","transpile":"npm run clean && cup build","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run transpile"},"engines":{"node":">= 8.9.0"},"peerDependencies":{"fusion-core":"^1.0.0","fusion-plugin-universal-events":"^1.0.1"},"dependencies":{"eslint-plugin-jest":"^21.18.0"},"gitHead":"7bc2555ff439e2ad2cbfaab42228e865d9dce9f6","bugs":{"url":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer/issues"},"homepage":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer#readme","_id":"fusion-plugin-redux-action-emitter-enhancer@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"dist":{"integrity":"sha512-xX3DMvUZ176w3lDr37bRu4vBFlarSaql/C51Ma8cb3IIR3mNlOkf3Zg17FO7UkSojhLtcktUXzlENy8Cz0VN4A==","shasum":"0ac105cf7757dc3daa4101455c3a03f9096d952e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-2.0.0.tgz","fileCount":23,"unpackedSize":56926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboETYCRA9TVsSAnZWagAA2dUP/3dQ33HvxdDEeRS3Fg2g\n08dAZNrq1Kh29pUk6dpzU1nOES2CO+eoQQId17RBixQOX//hElKFymnhk9vM\nWLcadxNd+MIp837FHZ253Q7BF+TLGl3ehE2UruUCC6snlY3/H98kIHekGMCt\nzQukhXdQ6dj+Qzft2xcbWrByxdPY9H02cwIDYXZsfX8QvKrZ2nnV+/U7fetX\nrMi3Re/+Rfiwh4sDGJRn71KLTxCMl6CmVrC5HA2Cl/xIV5ikKTDShbZ20Y1L\n4RjYCumrQkstrnHixzTsjTuzxhZTfb7wQdg5OfvOJmwQP0LSARgva/s7RZvG\nYPei0BookJtpnuKowk/VKn2l1nZzyzxEBbLLWqqQnGQQlEjkaPSTAwdFFyr0\nJzY7ulIGcqUFUg1l8EIYo0w+MO+WEHg++lhudRAMsM5HZwe3p3yuGSqMzmMh\nZNdQb1MNiKJ8FUJDbfFDsxkKocWdiaPcfTwMC88is3BCuRCVLC6UjtclKXtS\nL3VdAPmd1BrXfTZArhKXYl78CxpezJFIUld+d+HuCrn60mheEclFa98ecms8\nBVtowyjLU44BhQO9nJ5hDY1c5UVsZl0ujfTGTZYp+vF0hi0CTo3eXCbqYY4i\n6noA9aDLB5oXvAPQM9VdVQvtLaT+MgdZVmTlKEo74YgRBZIZBrwjq+rDl7bX\nNBCE\r\n=F+jM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICMemrPvKSoiwTcYwkD1KC+UU8ZGCuxcj8l6csM/JNBjAiEA2ckoOX6J/FJDfWy9xq5p0QG5A1OBHoqhex0c45ZL8Yw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_2.0.0_1537230039491_0.619893795133589"},"_hasShrinkwrap":false},"2.0.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"2.0.1","license":"MIT","repository":{"type":"git","url":"git+https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"10.0.1","babel-plugin-transform-flow-strip-types":"6.22.0","create-universal-package":"3.4.6","eslint":"5.8.0","eslint-config-fusion":"^4.0.0","eslint-plugin-cup":"2.0.0","eslint-plugin-flowtype":"^3.2.0","eslint-plugin-import":"^2.14.0","eslint-plugin-prettier":"3.0.0","eslint-plugin-react":"7.11.1","flow-bin":"^0.85.0","fusion-core":"^1.9.1-1","fusion-plugin-react-redux":"^1.0.10","fusion-plugin-universal-events":"^1.2.0","fusion-test-utils":"^1.2.3","fusion-tokens":"^1.1.0","nyc":"^13.1.0","prettier":"^1.15.1","react":"^16.6.1","react-redux":"^5.1.0","redux":"^4.0.1","tape-cup":"4.7.1","unitest":"2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","transpile":"npm run clean && cup build","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run transpile"},"engines":{"node":">= 8.9.0"},"peerDependencies":{"fusion-core":"^1.0.0","fusion-plugin-universal-events":"^1.0.1"},"dependencies":{"eslint-plugin-jest":"^22.0.0"},"gitHead":"937e70a131ce99a9023934ab55240f84679531a9","bugs":{"url":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer/issues"},"homepage":"https://github.com/fusionjs/fusion-plugin-redux-action-emitter-enhancer#readme","_id":"fusion-plugin-redux-action-emitter-enhancer@2.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"dist":{"integrity":"sha512-UWJUo5+C4UGHvWh+w5ZWst893te2bPRMN6my+hXCmBjGqlgyEq82stgePwQj+BaVKx7wocUJAl/zyicuZRKsjw==","shasum":"b87de464af0e17b8e234984064a0ed18846f5c09","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-2.0.1.tgz","fileCount":23,"unpackedSize":59805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6iq1CRA9TVsSAnZWagAAWO0P/RDnc5Ryovr54afHVO59\nKedLloAhrQ/Q553MyvMBF76zX9VmbmB6W4qgoC0y7WYQwU2Y0/52kWAcDBuD\n41H9kD0sFWO4tuP1f+s8mYcCMpvX8y4Xk0S0BA3s0sFzYbQKPSqqpYB/Ze0q\nPS78zbSxxuh/GFeg39800V+Fa9Im7ePBQMRswjXOHHOzgKjtNH4Xmq8cAG96\nrM2D749uNjy84e1GhOmS4zONdtw4S1sXc59kbQ2xN4930f4aCPErFX6ZInVN\nj5xqPDz8PYwZam4THywDCs0QZSx1TL8iJQj3cFds9M+1Nm9nkutU3E09sbTJ\nbN9hyLO0pSfT/3r06L7N+ogedvRdUzHr0sZ7IS/33p0HG4KyAc38iQ39cFaW\nziUivDDT5wL1uvnRhkFy8z2XKi4uvq82Y+IQm0Bh9XDYQMzzDBuhwaswW5l+\nnt925iKrmL6gf31LninVAkG4Vc4EFGTqZA+g828wYLNyzvG2Lq3H0hDv/FCO\nyXLYiiNR/mcNStcyFLk6wr2gK6Buav5kxKe/LQT8+BW1f/nwE0QqLad/GlXv\nv86r9qNagf6VNL4kGtBsh7Kv+8Wrpw7yyM0mvuiCeoPLjGvpUy7gN1LfPVyZ\ncsEz4X/3iA1y9AP2BOlJrVToQsuAt0lGzftH7S++T6HLUclV93PI1rS3mZTn\nLTcH\r\n=anMW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDR0vSvroLEQOUAsznH0sAAx8WNm8ICQHmwMlArbnh/bAIgISshZUNzXHG/qixoFV9Q9WclQGamvemLwGh1CdCrRQw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_2.0.1_1542073012161_0.9871516682910917"},"_hasShrinkwrap":false},"0.0.0-canary.309a1d1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.309a1d1.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.309a1d1.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.309a1d1.0","fusion-plugin-react-redux":"0.0.0-canary.309a1d1.0","fusion-plugin-universal-events":"0.0.0-canary.309a1d1.0","fusion-test-utils":"0.0.0-canary.309a1d1.0","fusion-tokens":"0.0.0-canary.309a1d1.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.309a1d1.0","fusion-plugin-universal-events":"0.0.0-canary.309a1d1.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.309a1d1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.309a1d1.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-zaTSPrLk4uUYm2K8otdHkIDPSqk3zrmrSIXJql3h61ROCpdk9ixumFT5NfNL5FVK/basiDDssMJ/N+5GEG7FIA==","shasum":"8d81942dfd9d80fa253071999dd5a8cc4c34afcf","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.309a1d1.0.tgz","fileCount":17,"unpackedSize":39431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5e6sCRA9TVsSAnZWagAAj7UQAJmjbuhfiVVCHmWhRZfD\nnW+5A4a9Ja96gMfVwmjQxd/xsvoGqLHP9+H98R7WyYQuDunyXSFiRz+Iy2cq\nhUc+g4fFjf8tjDxJWKLLw80s9ywf70EDWvuAvsaSN0Qb3wnCySF6IfxfN2cc\nL6fOKmIyoua3+rWCVt3lwVVK9zomsztXx9nE+cvhV+0zjm4kub3C30bHbgGm\nN0uIBIhj0XMLefDe5tYTQUu7x1vOCltQRAaWovfXy4XpEZAmVy1eCz9Z5CGs\nRgjFn4CDommelHKSfB3vvwoMHV7DnxcbN0cWfFYaMLrYCnOEzZNkll6uzLCS\nCXlw4JNs1bubmcDEQ90FjiZJuX9ixly7cMsQx8y8yzDxJQFEPspNF4hLQjB9\nlwepdLO6jDz2nk/r8s1jRj6Am31jWdqXj50eSF5J3Ob4eeU55vehzOk/rVYC\nQKgV5+us6EHXKTCr91wfN8is7Ywkl6JOBNOcfe3Q29X6IXbxTq1v0R00RTdg\nPokCwK/WM0obj73Fy6mGXTw0G2/jx8UbngnmG8er3GlwGYT9db6yBSmVLdDo\nK3X1FSgikGijhOiJZWCTU0FlEamI6D/uvMpA/qeJ+y+pQkqjjgy3EH3lk8GW\nRcP3fKhCiFvWaY23g8n7R6xQt4f9g6jUaN3qaQ7vdWNbZjkkdT60MtQ2658I\nNsws\r\n=yDiX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHQrb3n8LdMmAbI/UNnHUIkGffzqaHg6IfUTfoN8xLrLAiEAnS5DDsYvdwJJNIFrFQdG7o/zaXJW2M7fMhis1psZxR4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.309a1d1.0_1558572715357_0.6483196498627157"},"_hasShrinkwrap":false},"0.0.0-canary.309a1d1.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.309a1d1.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.309a1d1.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.309a1d1.1","fusion-plugin-react-redux":"0.0.0-canary.309a1d1.1","fusion-plugin-universal-events":"0.0.0-canary.309a1d1.1","fusion-test-utils":"0.0.0-canary.309a1d1.1","fusion-tokens":"0.0.0-canary.309a1d1.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.309a1d1.1","fusion-plugin-universal-events":"0.0.0-canary.309a1d1.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.309a1d1.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.309a1d1.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-fRm+/pbbgtAaIdzwFRUG7HYq6ow1JQ+eQNU3tzA/nPlF0ujy+7rQ9ngLk8HPXXNKmYGdHOMHfZ9wI7ihbUaKsw==","shasum":"91cd2f1e85721b85937c20789b2214ca6f387157","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.309a1d1.1.tgz","fileCount":17,"unpackedSize":39431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5fgGCRA9TVsSAnZWagAAFlsP/i1ZCKDcBxgy9naOJb6n\nfqw/P1vDyJIYb8AdhlLWA/F6XQArxlmdORxK8R2XMzzE6gpNM5NqgXL7PXah\nzNl2EobpdVh4My116Xx2Q0YRfB557Uh1kGkLpPU6iJDutv1lJO30waVcP3kA\nSfoLO30bCyQQDnuZXu6SWyNhCPJd1J0fywnNdQYY37EzcMrWA3+/7tBlrvAh\n9F0SkCYS+V2n/pPlD9yohn/BJNCgIURbmdJF8sjOzQ1LsWBV75UTJweMRvA5\nMm9w9qRiRGNpyLOqVz0/o8N8IrhjiiDMnl3GbTixeXIdnnhkqz9kQmPbCd9a\nqguS2ylWNumGKW/M8MFTcpDY6O/jAxt03W5o6jsYf84vUysjp4Xj/9emPxKt\nHCQxcip65i2rdWAwOWEPG3u9D6I7rKTv+Hbq7jFOhHMx7xrNrczxuoTRi+2G\nO8Jx+tUFfcLIPsB4cXNkworwziBKm/yLLur4JNXmSOCRq938bo2xg6xyMxhM\n+dBF2EPg/uayebs+kCFSe5EKH47yDjZAJOcMV7zFsFajuMmg5qJH56uxXT6P\nzOonfXdHUp3Jl8d+1NebYgXYpJCWhpABYt4nU6RsC+Iqz8FBu+2X8UGtOJuW\no3uwajc54iYRDW+o+FXfkh8nKtwKanynHdlspNP5F2lgFyNfPnXxiiqlASEa\nCVgo\r\n=oh4z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBm+8VfntC0n+XjJWmtW3HVHRppO9DvoTFdtOuhUKXKLAiEA/faMNf/BAxdJ3HM3gqxPuPyKqpPWAndW338PrUna4LA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.309a1d1.1_1558575110151_0.3964106191914005"},"_hasShrinkwrap":false},"0.0.0-canary.9941505.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9941505.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.9941505.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.9941505.0","fusion-plugin-react-redux":"0.0.0-canary.9941505.0","fusion-plugin-universal-events":"0.0.0-canary.9941505.0","fusion-test-utils":"0.0.0-canary.9941505.0","fusion-tokens":"0.0.0-canary.9941505.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9941505.0","fusion-plugin-universal-events":"0.0.0-canary.9941505.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9941505.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9941505.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-zXzMT9Mgve7KDC6bABUm8jyI8nZ7sEznLl6eDqrxqTwNiGYVln9rtsmM0mAkmwGXJLeVLcshnPDhRyXG1vt44w==","shasum":"a406acd1a30eb0d2dd285a3bf946fd44ef415e0c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9941505.0.tgz","fileCount":17,"unpackedSize":39431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5f0SCRA9TVsSAnZWagAAkI4QAIjTStIE/UMwf7kqkvYD\n43pM3iFwk8U91JzXU2xNLlmxoReePvCy3IXHqOu0QFFBO4A5FFNAQilb0Bmr\ntVVlNbD49Gl4gOBCP91xzm3ZO4ix3yTDpgoeQUF/x51OQeOx8FlISlaDaySh\nNFuiXJojTPaPUqBhsCRH/rSarEKUdEIyfG3bRS0lAVLeUetLY+oPlvI6NSxj\nZ/Ao0G6NUjYezoz7x4MbjL2VDrsDZrc6idAL4n2CCPZayuPH2KUfLEkIY8KI\nDTAbU+3rzWAGGDGoPS5UqI2FHzvUSoym3VjUQpy0lKMMJIQA0VMqqM7Bgcm6\n/Y7+QjPn4lm354S+tfAfIr3XlG+7c0Y9swxPZmXqTSt2sckYu+NlUd9iGwWo\ntY3pbnQHv9EX2OCDsRl5JBsv/dygiWH9Qg2xFxs90sOx6GjC3acd0izYaloN\nZAFMI4CXZ/SN9ZDtjFJPu3rRNyNwOAKFxOL+d3FuHeNEPaPBFlffoOb0+aJX\nn0bNyQRZzQ+2iX8yOWhSwNHsodfkATWNlTr0K8sttI7XXECFcg3yYqKEHHqC\ng1ISfBDfeXyHk0jvWFkrs1C93TpNnlQr+akzq9zE+C2UVdfRDFJfNvCVJOqF\nQvjv2t5dSywOPL+b2K0KkAUqaevXNvt6NEDWhzb0Lqkop2gauQJwzveTPvdh\nCpmc\r\n=Mp6A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEcD8oTcPdbqBL2cvoXMoOvxxhUrMtNZb8C48cRxs5qJAiBlk6uNHvNWszEsMuyHflf0gyz91YRHBvHKzWCzWbzx3Q=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9941505.0_1558576401312_0.5797784417037919"},"_hasShrinkwrap":false},"0.0.0-canary.3811188.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3811188.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.3811188.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.3811188.0","fusion-plugin-react-redux":"0.0.0-canary.3811188.0","fusion-plugin-universal-events":"0.0.0-canary.3811188.0","fusion-test-utils":"0.0.0-canary.3811188.0","fusion-tokens":"0.0.0-canary.3811188.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3811188.0","fusion-plugin-universal-events":"0.0.0-canary.3811188.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3811188.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3811188.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-BGXiWHHrAsWxIo1YfWMzaUUiMBKQKune1fG2yn/A30vHGyYzpGfzOXHEW17LzRhvaaLR+5L4oeT0R9Q3r0usXg==","shasum":"c33f9c8c18a93ba943fdd8945bebb4c52676eba9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3811188.0.tgz","fileCount":17,"unpackedSize":39431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5yLQCRA9TVsSAnZWagAAPgAP/2wSEsfR8igVNgsT13bO\nJVek1pcSv8MSPRcSC2LOsuSUH998/ugopkcgiuY7x2HhF60pTB9eQ1+bs9Ac\nNAPwOQ06cjKyOxwFyvAiZQCr/E5+65ULknNiXru0JSt/dBzwYYDuj7iXeu/r\nKzMcRk3wLKrXcvXGuuAHbIstUQyf7pWRsD4VV4KVQ1KIR8qt38zragYvcP9e\nf/dMVPfirFe8f5c+vftuFtVPquqS4k1nisAh06ngdkwCQNoiPkuAoTzzJ5yW\n1hHijAWaM0sK5OQJ+2tvZJ003WefYyDO26zapG9R3dXu7OmHb/mvvned4rLk\nB/SgHkbkl2htkTfCVribd+D+mmE8l0oPF1rdbgN0W1AlmiYpkc4UXBuJrUKr\nWa2yh1FpqWgw5W1ng7wbwfu/xnN4/fgU+Ma6gK/+hY5LndQhqlBdjcY7lmfm\nAEPp2C492pfy4rCHMWW5tj8h55Zgmluf2f+Zg4n74Yez60HfPWwpYvcHamU5\nQuPtjjySEzJsU0bXr6NhtuUdTy1qhxSmi2VW0AVYznDfUt2ePId32zlNdGOo\nGkWkWVE5hg7KR9U1xRaZNYcJq6YVC1hLqbou6PH/1FKoV1Fe6OuAEnod23bv\nOT+8U8Jlcn5ty5vvmpshh7obxz85LpdlmzavYxkEjwcLuw+z05Ydtb4/jS8J\nue3O\r\n=4vzm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBqqVTSsYlJjc0KzWGNL8g3vOWfh1MfX7ZSb+twNq4kWAiEAmEveXcqykeUI7DBK2ixsscOGLQQswhx84VkaSw3QvHM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3811188.0_1558651599863_0.8763128200669112"},"_hasShrinkwrap":false},"3.0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"2.0.0","fusion-plugin-react-redux":"2.0.0","fusion-plugin-universal-events":"2.0.0","fusion-test-utils":"2.0.0","fusion-tokens":"2.0.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.0","fusion-plugin-universal-events":"2.0.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-3.0.0.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-jfWbtoNV39W+j4cGOjqD/hfBI23jKDtzYgM9gOpu8ErC3oU9b4J4+GsQfPXhPHteoweKYqE65ijbqXXAyb6fzw==","shasum":"f3f16561fdfc1dede2e25f1452d5f6334f63d902","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.0.tgz","fileCount":17,"unpackedSize":39278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5ybtCRA9TVsSAnZWagAAvM4QAKKvUGE7bsrhfs2LMC1/\nsfhkoAg6w9bjHEjPHVXRjM/nlm7ufodPdltkR4Wvgs/BxyFxXvGFX2CMMCLd\nH1c4vlolF/ONb4hueQEEtPTZcWIKCMgYqX2sT3aPJtUXn9+ZBlR8j/KIdPmd\nKvK+lIH8hk0ur+tA1Zac9dggYa8XNeSRZOleAA0DMa0Y1W1Uv3aCSwTIun+M\n0Duqzf2gap6bJHFb/8rzoQqdpbGMTF0V0WRa7SdW37LO1+4jMbdHsbmvG0OL\nmba5mcQpOa654VkVzorwfhZzU21It4uXY0QHZth3LWgREIJmLfs9oOeL4Om0\nI8Ln4MPRLAtBF+PwayRwc3xTCJHOjeVON72kPi83pyoOqiuwtg+e9MOw2etd\nBIAwkyylNippmMzuVpZDg0soZmV+fr7pJWrsJEIcMD4ruXMwTYIA8KXRRff6\nVGgAwX5ZeaZWYmwMFaJRVmq9x3ZOUQ33FYqioSxxB9486BCgN34r9m/6Y7uW\n7Gk8BE2EHcG1EGGw6LTU5kQExgJR3uJF/xfC49ph+ArU0sB6SH9HQQC2Q/C9\nUwBev3fGQalHQ/Ps0lZoF1mSsOGO2f78D6AHB2gzyFmNQYzr/zwpcxv4VDHf\nTHyH/mDd3sGpE2qDoJU5YnVnAhhf9PhIK224erZup0zNmrDoFAhg5vFW8CNz\ntmfC\r\n=UaXm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDHkpkmjLfnA/L2UwLSj0TrcHqZFM0dLTfrQL7U0opS5AiBbN0NkMHTbMuB1uoQQnpIFrB/zsmlingREd4uWj8HqDw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.0_1558652652255_0.3561007721024705"},"_hasShrinkwrap":false},"0.0.0-canary.872b547.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.872b547.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.872b547.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.872b547.0","fusion-plugin-react-redux":"0.0.0-canary.872b547.0","fusion-plugin-universal-events":"0.0.0-canary.872b547.0","fusion-test-utils":"0.0.0-canary.872b547.0","fusion-tokens":"0.0.0-canary.872b547.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.872b547.0","fusion-plugin-universal-events":"0.0.0-canary.872b547.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.872b547.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.872b547.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-WZM4dFO5QjYjqqGF00JTWleqbD8RCX77id86KQsIMw7QOBjl8PofH59qGRalpU2hjP0DGABzpBsYCkdcLWvtYQ==","shasum":"631803f8e8d63abea6e8990f2181ef8a574556e0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.872b547.0.tgz","fileCount":17,"unpackedSize":39431,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc6CYqCRA9TVsSAnZWagAA35oP+wTAtJO9/NwGeSMxS7vR\nGP9F9jeqtQm41/5MrgBZVe5lwVRrUBrn9aDXP7WVB0j+d0cuHjFPahR9WtAC\nHfHGIzp00f8EqBqW03YhfnMGQb613uxJKj5imgy23o7njOOAMcxvNi1ZQplq\nUO1wmEkDm4vKRs3CZ/8X3nIrY1ZH14+PKUi1Q3X1YpGBtVvHPjqFe6V6xDkc\nB3amFiEJIBS7rMUlFREcrCItMsoHj+WN0vZMk6hbeqiBP5K1MSbtgnynOhvI\ngNOeC5Qw6oSc3zCZzP+vh4shYMt++tPNNr3DiXlLupO8VBjB6Dkh5Pj8Zych\nVqHtsp5ZzMSE32wW1jNtdwFgdMx5e3j+0h28uQpworYP6U+LSV/mW6p1ktoC\ndJ9qvHbLYnLJsBVLrWoqgtB/s1DXqSeWbrL3Hytkbgm2dO5ACLsIaCT+Ys+7\n1Xb58eeUnBt8ca712apcRESUrLNZjsunBTx5WGLYeHEEsldMwFt2Eg7WwVMO\nLscZXxWnphOEeA7LlS2qxkls+kgjKNBDUyNfcsb3EepKqNlIe7OkYEcUg4lq\nj2/gmQqqa4/zJQslXl+S6zf5CWzlF1lELOVYhxweiaFTGhWwbwpVJ7TgSK3f\nRg6aQydoeys2O8ds+kcxc57kGZYwrQ9iJe/XJdlgBJazvRYYnNIxKVLnmIow\ntZhn\r\n=X1CB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC54t3HjDmXpuOQbd3eoC/T4MGg8eyhU2UlsVRE+L8FhgIgMlWDufJ/L4b+FP0abYDto0Q9LdmdsB/vMP/9gt48hfw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.872b547.0_1558717994041_0.1912470072534871"},"_hasShrinkwrap":false},"0.0.0-canary.125012c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.125012c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-plugin-universal-events":"0.0.0-canary.125012c.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-plugin-universal-events":"0.0.0-canary.125012c.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.125012c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.125012c.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-NxGsuyCp1s+Ro/M0hxYmCSi/btgH63xJ8C6jPtioX75nszEpZ/yuyUDPWXZ8SNp7s633ytfw+moapW9Tg4gbFw==","shasum":"4e3689cd7e2922d3fe824aa20bfea197c0508f2b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.125012c.0.tgz","fileCount":17,"unpackedSize":39130,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9b4RCRA9TVsSAnZWagAA9S4P/0CWMYYYsG4EDNrlMApc\nQUqQLZeDwXsq7l5OLhtdqhEv4DaBAeG8d0/Szxgl/JrLoaarWuNXqDQ7bgzM\n/DgMqdrnTFiYeFZ/OiWMqpysndAmvsUM8O3SxgkYmFEdNfKcGMFScTTn6YNT\nw3Mr+uDC+ASOSDeNaMnb3GtIOMvInkek74kRdncnz5j4pPa8DYckNozS8b0R\nhtlstz9EP/J1wBA7cJnn+42iFjpDZiVv1nia0j3WnCehLGz0EbS+5pJE/S1g\ntY2g8Rznsimaoi/ejaSzyUWc65HYtkpDwbhzod5nH0GUbpZTBLfWpZ/VTuOX\n6Bvnbl3P7QuGMtTr7je2tBSb6AYAoS5zcuaYzdJgiHUO9Hfoicr23YJdjzzU\ndkQYi1ZXLBt7zcBDDuv5VeruaoVNoNK6hnOZlIcAfjDnbQnRSq7uOtTACC41\nY1KBDEDT/b0j9QnfdUKTBBou+0VqQmfQUl3WAQjVfoXdghrWu99aiPh5fwe2\nK/vCZIGOCiR0ZjNTSlqV1TRclA8X6Ci2oAMCeT2cHdHGY3kmaaM4r2vLwzg1\nxzNubNooQpN53AXcV99yfOQLBSvo4RdvXhwYO97j/jJjyqdJBIyreqLIG1Qx\nK+eJw4QpUmgKvWbVJo8+hTmNaecWgaiob+++9rSL0pXsN39lU8DmlLnnOc6A\nYA+Z\r\n=0qKL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8ISrNAgdgxud4Ee8tuYJ+LOiO1c57OWeslinQLiGp2QIhAKTIBo2BNsOlBrloKbYlx2xVOSrg3bZkC3DigcNtWuhf"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.125012c.0_1559608848597_0.6681733261134655"},"_hasShrinkwrap":false},"0.0.0-canary.b26bd4d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b26bd4d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"2.0.0","fusion-plugin-react-redux":"2.0.0","fusion-plugin-universal-events":"0.0.0-canary.b26bd4d.0","fusion-test-utils":"2.0.0","fusion-tokens":"2.0.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.0","fusion-plugin-universal-events":"0.0.0-canary.b26bd4d.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b26bd4d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b26bd4d.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-oHrAgwp+e1SCVHkiiyCLw7kWHwwcYBLWcZa/NmLeetDvbzixuTQiI+spzai7ieSnsoX1ssIfTT5midxs8zta7A==","shasum":"077393b37b3d8b92e88871715602c9169538dab9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b26bd4d.0.tgz","fileCount":17,"unpackedSize":39329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9cy+CRA9TVsSAnZWagAABn8P/0OuTQFrf5bdO3hElUO0\n9SiuY0IGaQZqMIFi277SQBn0UfbV2N1VRSLjhoCFwk+OQj6Bg6gXJPGJBppF\nH7QRWVcq54KTvjIGpqbtsZDWOSqHi3SF/CUDIfts59qa8GNl/n3hmVVNQaCA\nfF/xYGiBAJJlTyvh5ftiwPfk97Qgx1wm+VqYTZSOkWeSVcaO11ggt6vdOPsx\nEKf7LnWAT7PqEZWNvXUXPOPAsQarf303gUn55y2jQvngfYKqdWI76xIGDr7D\n7yMK/q2UCD1Fp7aTDZ94AUf2cISXxs9DW+ncWKW3mPFXwNaNLlcAqOosc+Z+\nY23p5gWvdfkzb1AmVDj9oxL6PIdPg61qh05Q9rr9n4vk0rgQNcroJbqp6odb\nQtSxt5qs6aoC4i+pT9mtcu4zeKARJY+sSdTx+9AenFZR3hUD0loJ/TvETF6i\nko30vNinWNq5OHzwqDE0TZb+JHFwjB6IGbEP01ofXKoqbG9KkIno+NYFr1b4\nMSOGkcyvgSzz2X2jIGRYNdN8b2AmY3jc6WZ/eX/bJyf+BR+5ftOFaPQvWF/+\nAY94l3c0S4pQugLmyj1f4Tzk/3OgLZyjt4mPCqleMIlnj/z0SFRVRdKMC5lf\nsf1zIFBNmJZHVzwt2zS/oi5iPnIHvVnnYmAQZI0vwwWG0N3L7gaAmKnKtNU6\nKC0o\r\n=24cY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTRr1iobll4DII3dQurVJnSAHf2h4tIF4wD9Y/iodTEgIhANWUhNyWQcp2kH6ewA45cWiUyOIzkYp3+6TkJYnQKPnt"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b26bd4d.0_1559612606188_0.7617558727921439"},"_hasShrinkwrap":false},"0.0.0-canary.69ca4d0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.69ca4d0.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"2.0.0","fusion-plugin-react-redux":"2.0.0","fusion-plugin-universal-events":"0.0.0-canary.69ca4d0.0","fusion-test-utils":"2.0.0","fusion-tokens":"2.0.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.0","fusion-plugin-universal-events":"0.0.0-canary.69ca4d0.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69ca4d0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.69ca4d0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-CsM1bOddrifcnDXyLMUvDx3JDNVHlcfTFW48+pklb4PzY6K1NOz974G06uR6wFe1H/3Y0PMAoz9tZ0kI4q0+Lg==","shasum":"92e17a602b2c54765c62733a0c8fc0ce05078ffc","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69ca4d0.0.tgz","fileCount":17,"unpackedSize":39329,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9rQbCRA9TVsSAnZWagAAA2YP/29m+3RRGo4PDaQfaFYc\nazFiLqrvdMW0yjrKjtzKqcWoZsao16hYcpAnsYeJ9RvwcaqxmzFuRdtEVmqP\nEe622AW7o4EQW91OAlAr3zxQVfe6li8g3x6ALQTWaCxb9CstCmyEHlH54v0C\nZDwn73+UPHSkYBQW58XUJbXDPBbAqUkE2iJFe+TQE8ylQ5RuLZjyc68m6Q3/\nuSUIt19eDVbqvDTPJ4k90qpgPer5ooMtDHclXFCI7oI84cER74Ih5985Ck1g\nl+I0Oc/90pT6RlIc9z7aqKfJ82F79UdVVG1pCochM03A/FjNBKT44KlEvGoT\nlRdq5pU+v2+BnA8oHa89yDLlfzHqV0Yeap0wl+TvnnPXXJofHljE4EuyeC9I\na4WYdSm2QQeibYAEMjbKA9D8XkLleVLqPCSpXaQroMoXyNXk/Fw7XOLSnPXS\nj7GIQb2jMUZ//aKz7I1eVeP/vuh4Q85/j/Vnz7aRFkNDh5N8Cx6IkWSAWNlw\nJu6c74fEckTh35iZNnUsWba+3eHkbfvjWgoDfRC5tzMjqQ9r2ezJQhWasUPC\nU0sG1c29wpg2iv+TY6PFt5GhT4/pq8PDSbsUN+K/apnzDW8I85192XgXW1NU\nQNDiHyfqM/tPdrc9r+W5zoq1Br2FzYGRN+2vO6FvbkMWbNCLErjnu3h8XfEQ\n6D5/\r\n=7t6D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDy5bHSrsdLDlM/lb2/L5IH4fIndZfdoukTmg2JwARSpQIgdGKoAi5Re+UQGWxYVqA/VI1BGSlk5WKQFfH/x1MMxIg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.69ca4d0.0_1559671835449_0.6417118910646478"},"_hasShrinkwrap":false},"3.0.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"2.0.0","fusion-plugin-react-redux":"2.0.0","fusion-plugin-universal-events":"2.0.1","fusion-test-utils":"2.0.0","fusion-tokens":"2.0.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.0","fusion-plugin-universal-events":"2.0.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-3.0.1.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-+brbcJZYOf9FDxxI57ue7k6V335UXPjwZBmjifFpLCz95IlxMfFRjx+j6erhRswcrbHRpEuu/Vz129tRR3jNJA==","shasum":"67dabbecf29795ee2001e8d26c235b8313c0cd35","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.1.tgz","fileCount":17,"unpackedSize":39278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9tKICRA9TVsSAnZWagAAg58P/3YyS0GrqhafLhxxEH9u\nF/+qLRyTFz2CF6s3ZTbUF8YeS0SacUIGARpX1QkhCsnXyE0ZpP62vN/faJpg\neVHExpC23Zwj7rO83VjtDAKGH1eorjWZoipmXyG8QWta8XrwTlhyjr7L/rgV\nIGrq8xVSs0/3KPcUCDkoBnFIANoU0YKflU/gmaM6U+7sihxWTQkYQaUVgvwW\nlCsE2/umPyhdQIDsXuugz9la+H8KRWRVEFZJbRe8qoDZFd+m/2/ms/X+WSUS\n4VinYECIfWBX4pR66yGQlWWYA692nrMN0VAcOloh8P77VPTPPMrR0My2YtG7\nqLHpubY6vTI3aD5hq6yIZi8znE5usHCQObtVVINU9GWmXBU7BM1QpiYCtQbu\ngOZX/6IH4cEEEf/3S0BnsJ2FQcutdEeG1tixBt32tlydtLtx5oWQ4DYAHWdd\nN4IvXW1tZmX4WcdC96JSe3rgiNgqsk9HBz3mOZgj1TZlDLGc3m4QGc0DYTg2\ndW9VqPYle1cR394VhSwMk+zCv5UdYkKP3kD5n5UDbYxm+ufdIWPu/g/BxZ2y\n+65KH2E1i574HIM6Mk31ni7RrXOIGQW4ItVIYh7JtZZj2ia1KCbnWQTDaUcN\nRkZMXxRaZKHuo3F9n5qhW0HoAx2gstLtjp6pnp+KJFM7R36Z0LeawPjLyg/J\nTBvK\r\n=ahcX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCe3jsSklmyJQ7yFrUuBb+uD66a9AD2dvq6s1JksUSV+QIgTYJvKE8ZS2qtfJ6k1twDGXgHGkfNqZ5CPGhwU42+oSE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.1_1559679623184_0.5286332628965902"},"_hasShrinkwrap":false},"3.0.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.2","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"2.0.0","fusion-plugin-react-redux":"2.0.0","fusion-plugin-universal-events":"2.0.1","fusion-test-utils":"2.0.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.0","fusion-plugin-universal-events":"2.0.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-3.0.2.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.2","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-0u0uWjtwAL02QNjov13t249i0uQF9pJMGoV57XhWOJ16p62ROAwmMyVgYP/0pvR0ReiG10zX4JBHqMMw/9RVDQ==","shasum":"cc9afe1730d3e9d2907fab7d35883346301db8bd","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.2.tgz","fileCount":17,"unpackedSize":39248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9u1RCRA9TVsSAnZWagAAWMkP/RSqAIVRvVYcJmBJ9LOm\n2xmPiIMnzs6BAk7B1XnL2MaCTJjwfB1O3fVi3KFcJUQKlY/QKZm8+3eFSA7n\nnp4on5mRmg91Q8yuePzazmRP+V36EKGcJngVF+IgSu8TDllmryLkqiAoNjBF\nzCzEDvcUqGwuKpEuq5CPALUVsPTjeNEWsIQjLqXs4QNAWldeQZhqEtc8bjYy\nZz4b0J+bExH8+CMY9hlHHUAgiiw/Zmj5vDFw5gpyND/9h4pGHy5qPK1SsNXs\nkf9TzjajFdrL5HOSEF5ahjFlQh+GI61DmS2kvoAOfAIh6sAEtNyB0LOfg0/o\ngRvJx10O1n4V+PsSb3HylMA8y8L5T5bhCJ+wiUcAI7S7UzOBuRLzpS4qIqlV\nfknF4GAADtTH1yP++J8vjuo3ZnIzCV4Gcrf4F4W1qZgG9zvmtEHasOLE8Whi\nhxevJp4juHBtQPJb7gLvPiBusFrRSiBPD5ObBZGXHxH6LySJLBNPC1o/Saoz\n62XcrkL1MqSyqrAlV/rs0fyOXKKCeuKzWduA5CWaBEG/2vvHUd1bo9/EH05t\nOyS9F1yVz7et/c8o9EE2HDtqWxDEwLIpCR5uwQuEojl7kbcywsSN/JUkJ6Bm\nyZdlV77Mxlkg0srAOpb46S4Z/Ed4mEO/oGNcWQZczfQImar3fQVM4O+zS5Rv\n5n+J\r\n=KYYp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdzJpT+wgPF8R528yxWW/r7YcQnEZhLOYbCsTtknv1bwIhAND0tPPwTqmrRFAb/mQN/NCyLIUbjkUcEbRpsbi2UHwg"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.2_1559686480667_0.9358017905999094"},"_hasShrinkwrap":false},"0.0.0-canary.fd5a750.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fd5a750.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.fd5a750.0","fusion-plugin-react-redux":"0.0.0-canary.fd5a750.0","fusion-plugin-universal-events":"0.0.0-canary.fd5a750.0","fusion-test-utils":"0.0.0-canary.fd5a750.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.fd5a750.0","fusion-plugin-universal-events":"0.0.0-canary.fd5a750.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fd5a750.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fd5a750.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-IX0UBj3K60kcgP5fMkmTnusH1k5HaIIaQ8tUkcuOOQF9J73JwH86zC/6AC70ATazP8XEfLSx02zRHL/uP86lQA==","shasum":"719de72864a07cd90a46100b05054d3ae444c4a5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fd5a750.0.tgz","fileCount":17,"unpackedSize":39367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc+VzVCRA9TVsSAnZWagAAjBcQAIAP+v9S0Oxwjjl//zK7\n/uteeAtr5YS/OUnjxgfkyNv4lraxbv+py1LIiLbTJ/87XYWtAZBMPttN4Rg3\nedHIejjx+Ayq6msSo0+LVgT0saAX7/UhmDRW9KO5IPVvmrmNXxstJQUXQqFR\n98MLCEFx9p7xtY3TaRToY23tLqnUOv/nEe0PJhVRyPZTaojWHjPTgze5G7UV\nfd1OmlGhjgKJMFjoY6tIHFoV93n0KfH6C2gSVPKzB0E/kn+JmNYwuTTM8hpV\nmQZ4+Snx2yUHuPfQTuvuc3zwUJsWP6k7bEeZ0P6EZvK7DJ/F4Ozv90xms6t3\nSmNjbIFTICYbwNDnpPpmEf7Uf4QIsKUcx9mvHdPWgYdxGju5Lv+SuMDTZCYg\n6itV+x0CqLg6io4LfTitli0UaZ4c+lgaoeccI+pYGyiBNT4JISFcngyIcUOG\nqEed9SaF+nnQuGeZqiGrJO9DKwZUo1mw/ySJsyV29z3rhQfT+dKFaC5I/GKL\nUzjHt1X3XIHNF2lhZogfv06kE+eWJGRJw2nyZBv2AEWpmUF4FcY0CrwDuvin\nVhu6KpOVjYldn8jI1qZS75GWL4MnbWpCOhRhHgeGMy6N0Plct6YjiBAkRxqY\nMHr6j08MMF2JVDxnycN1MqjGEeeqIN06MZ9EwASTdDzGjgM+Xy8Vap5pzXvD\n0mDz\r\n=NUna\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOjyyV2XRVVxH2ShOgJbfYPY5uoxq3jyJnnuGmWuRGIwIgOLrW1RstZJy8p1Me3jv2A27zL34Rifh6ryIw42+wEnc="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fd5a750.0_1559846100906_0.410017624978694"},"_hasShrinkwrap":false},"0.0.0-canary.4e310bc.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4e310bc.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.4e310bc.0","fusion-plugin-react-redux":"0.0.0-canary.4e310bc.0","fusion-plugin-universal-events":"0.0.0-canary.4e310bc.0","fusion-test-utils":"0.0.0-canary.4e310bc.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.4e310bc.0","fusion-plugin-universal-events":"0.0.0-canary.4e310bc.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4e310bc.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4e310bc.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-TkTQJmjwOTLJzygP3BhiUEtHueXbGAjTxrA40I8CymeJBD6FVumvhBavcRhjiq1Z4VfdsQE1m5g5o4W+7cOsOA==","shasum":"ca7daa489e04e4a84c9bac87384e496faf7fd27c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4e310bc.0.tgz","fileCount":17,"unpackedSize":39367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc+XJtCRA9TVsSAnZWagAAIQgP/0e1DCnI8Tx1l2JxR0jN\nBHugJaZgAg3oUC+tGsiDJALJX6f5TTer9fpYKMoqEFa93hHwDAdLXhOLUFsm\nqyEN6oL9/uxxdNSXDgw9eX5PHi4T1SrqquZ/Etu1kARuhMIxJK79GL+M0nh+\nXBl9qwj7gey5TEecmtq/UhRQscx8JyDKt9AZIEb/uqBk9VAinLQUJUMX2p8o\nrI1L1eez4E62xUQXgZiZLQ6DgkyXx0yRBE1uwRODG6EDqQU7a1Gern21rh6+\nlTa8yiT2qhqyrHM04pgHxgRJ84CCrlx96zIsxhWIxTiYrKm23YJ2s3AanGaS\nE1uy1RPK3xo9iw97EJmgQljfX4OPGGdST0bN5i7qGS+jMADyVgZacrBe3Pcs\nzq8tKo9niL2KwwlMSNBUQDcUgzm4y/ixKjNrumQrNnUPqMSBpcRXcAKSt65A\nWQ69AwBtrsW28kGJn2Y9gGsInzSawfENND3uQeutMe8mQfeSlmo26TcuEO6g\nAALLF9OPihWNP3TC1yO3ZKox024syvXyxfNI3QDCUY53yoDLGl7T81SX/Eze\nqrJ/guB37UeR8PpuPMe8KZZkNlaffo7pIj9p0BTespakdQwH9vcOHx54RYBg\nGL5YBt7WMdybjN4JXF9sT+waaCItt7k2KfUnrPZH0XU/Y7KcFY8i5qncRa12\nB2J3\r\n=B0oz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6PZuPKdbJSBnGRCmQwdE//UabPSjahk3+GT2sFg+NiAIhAO7GvUevdAtsb8/rSSCJ0gvRpI4z7ctg0s7Bq1jxRDEf"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4e310bc.0_1559851628807_0.19617555923721341"},"_hasShrinkwrap":false},"0.0.0-canary.5bf099f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5bf099f.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.5bf099f.0","fusion-plugin-react-redux":"0.0.0-canary.5bf099f.0","fusion-plugin-universal-events":"0.0.0-canary.5bf099f.0","fusion-test-utils":"0.0.0-canary.5bf099f.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.5bf099f.0","fusion-plugin-universal-events":"0.0.0-canary.5bf099f.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5bf099f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5bf099f.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-YcnIW6dbfwRQTwQskGcX8tfAMUwI6LXs/1LBateOkXjsap3wZMppjHeUyzAxWTODVPGJbogjC2U48OhU2Rzh2Q==","shasum":"fe4932f5b55f2595950c0a5062b1ed402ea03846","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5bf099f.0.tgz","fileCount":17,"unpackedSize":39367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc+aMmCRA9TVsSAnZWagAAELIP/jfOT8sua9NPhAFhQocR\n0kCZ3PBdYYU1lOkQu35S6FgI/EYa5IGL3uglW/PhmgAUgk+ciu6XRz4FPo75\ndO7fYUyoPdnEKRWuXIwXF71OZP5iI4lyD8d5MViQGSrlHlR6ljH65jpwDXqm\nm2hPxKUivryUJF28uuuSCXJIdZobUmV9x+7rf2IryaEK2791LYR9saCh8KCm\nQWnYfSbwNzHaSeuIwu72O3tYIQwuvjx9X4/1RaoVstD6TUiyjEQ/uEGGePoM\n4QViaGcw7H1eVbhkrVDbf4V1op/qp5APSIxqYTVuT54vjrw4geew+pMFCWSP\nlZVl6aTEKdmuygayznm3KOnPO82pW7ozEZgD/+AxB6bLvbhx0XNYMGGFEzYR\nXKzGRYTxskpMNW6AJtiCNNHT+rUNix0moZsDo9FZzeYUjfNqW4RDDDj33NOk\nIQ18UmxdosFpLIQkRWR/2XbEsagUQNHtUrCat7zwAjzsO+SGdxsz1rhLEk4q\na7WrXlbH0cs51Z0u00WFQVZlWXY3C9MmT1l8wNW7P0EaCSPADkcBr4N7o9ae\nouFwkk5AQCCIP9Uplgujwu3qxqkxapskwhJ4xUM1/yUw58eWMFNvugeRA0U5\nFokeOsW0kycck4s0MRWlYZG6AYd2dZvW1UjNtIIs8G/W3qTypGuDXsStNyP+\nGXFM\r\n=6f0k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDXiOfmTeqkiqEvpwCHfzmysWM12NxP3Vwm5/CHJ658bAiBjFL7anWqhamVbJD3N2faZhIve3ns7sinDZHNmQX2/SQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5bf099f.0_1559864101761_0.451740611158689"},"_hasShrinkwrap":false},"0.0.0-canary.2fb1140.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2fb1140.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.2fb1140.0","fusion-plugin-react-redux":"0.0.0-canary.2fb1140.0","fusion-plugin-universal-events":"0.0.0-canary.2fb1140.0","fusion-test-utils":"0.0.0-canary.2fb1140.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2fb1140.0","fusion-plugin-universal-events":"0.0.0-canary.2fb1140.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2fb1140.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2fb1140.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-L1Ol/eA64Oaq/U1mVEtXXjDzw/vdjwOi5gtOsU0/8M/bNIDdWDL5OWu3hV3yqjP4wQUKmpn9J+1rKAfQMVlDKQ==","shasum":"717e9650d09db67d2e754c556700ec2c7963b569","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2fb1140.0.tgz","fileCount":17,"unpackedSize":39367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc+qaHCRA9TVsSAnZWagAAu98QAKPLCxRzgvFzSePV2m7V\n0qFPjteqidx92tjPnwfVQNNR5hK7UJvfECPv8uvgpjleoYfhwu8rBqQ+9D3+\nvVHjm26nG0fudabX9yWpDgPHNqBgPYQ6SQ6T6/KyFNzqLPs9g5GBLhg/JocN\noTLgOAUczaFR+83AMUBdYHqGXf4NX28h4cieuPQX5dlliTlW9cz1NjXvEYuL\nsLv0TjM6e3ON7Lz6q/78kAPc3hlg3QqXOlpnsO7uVq9ejAw3kE0Z5wUUp54h\n7pW7h2sBSIpGSftPSrs5QNOmaAANJSz988YmjfBEGsPP1KLJCZRA9Ajj2rDc\n0yF22R76fRu2JH1A5UOWJHDBcXT3+dduFCKeU+HVUCHOfCh2EdTfT2+Ow3Dz\nZNO4bXUjnJlc9WoKOXQ55McHrlo9tcehDVbk9QZv9W5fb6Mug6QQJeZPRcz6\nt3aJhEWNY4Ptaie5vH+3Lb7J+o2Kspcn70YjsI7S0BkpwJSw+jkCQnUSz3ue\n6Iy2cR7pT/CzRlndh5OtQZXWvTthpWMt/NtyyzwqHSPcY9r4o8M7qyfWp/8u\nn7p4PFWvkNVlhpx4shN0oG1JQfjKBEfzI5tzkSTsQ0EVVuwxEL6h81BKZXB/\nJiiFq+2baGna5CkrVbFeOCQKnTTHxVBgvNT29ZQ1kS2Rad5XvjZZ0L34oJ8Q\n2agV\r\n=6cGK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQREiWCbOpv+GMJV0VZV3YCnJIFKdGSJO+pOGzOJEayAIhAKvlF5mJ7zKpCBWH1kfUSKcvQ9/rOc9h6FDa7Mhv0VXs"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2fb1140.0_1559930502471_0.5033885058843433"},"_hasShrinkwrap":false},"0.0.0-canary.d9a277c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d9a277c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.d9a277c.0","fusion-plugin-react-redux":"0.0.0-canary.d9a277c.0","fusion-plugin-universal-events":"0.0.0-canary.d9a277c.0","fusion-test-utils":"0.0.0-canary.d9a277c.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d9a277c.0","fusion-plugin-universal-events":"0.0.0-canary.d9a277c.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d9a277c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d9a277c.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-z7LU/xi4RBWl1bAmJp3zAUHlxaMg2sWKJU+xoSE5LcGHkmdJPpvn+ZFQEv6bm9gX2O+K2ZXdNKNnlnRq6/QjJQ==","shasum":"89e58c67695434af59547d8fce229149cdefadf2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d9a277c.0.tgz","fileCount":17,"unpackedSize":39367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc+qvYCRA9TVsSAnZWagAA5CAP/3YqCHT4oXUD0E0xY9p3\n7xkd1U2sA6nt9Iw7QHDrwYDusz3eaHsA7H0hdkj3nXTxSXRPZcFlRLl+nUYW\n+Sc47ETO+Z1Ux8PD2Yw5Qxb37eWutwBtTGoZALujNTng8TYApe1eDoARQDW0\nwdiethVFURIE96d1CRJJlyX3jBFds/fzrwdReXTYq8MGu4tcfclxRJqN6E1t\nlHXjHuaBDQ3UwFn7E0TuEoZk1d95FMZnCe14k1EjwmINwWSscTBcS6Kjy2es\nRq3KPnmPZqgWeW0gmIMN+Yit+g6gCyJ7mdBASRoq1IqP+AahwRLcv6gQSrQV\nK4M/S0NzArF1F1X0Z8en39aFI6LewD2V2DGNuBT189vZMbPsADtBAHU+n+7r\nfJjn2R/X+QlGhOORhKQf+NvFUOUmBRA4TJbnZEZllCaEWffMS3EOYXLX6zfO\nfoXR2RJ4IiXyqgxHCOPKaWsSQ2G8CRXZ4mkav25ua8FvBFRukPdsXh7jtmQr\no53IzcvchXMPTj/gXP0q4em/KGxjbirTOV8eTXzQSuS8V47uK3mdACncc3nm\ny2XW1MZ400k/uN+5krbUeNb8nT+bpb70sAlccm7bLr0ZF6sstSltCrzNnQDj\n/VJCOaqMkR6EOHSH2E2cN7WzFs+DdWMu63RUvRojoEq6pHsouIFbg/Bq9uQv\nRMm0\r\n=uN6C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDd2UTJaYd8tkYcKiKwQwtFpXJpsKe9bc13byHWAk6VFQIgIbPHTMtEu0oNtXHCF5tfgKJzbxw3mJ/rp4iJGaY1Tow="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d9a277c.0_1559931864034_0.2890841722612756"},"_hasShrinkwrap":false},"0.0.0-canary.9b5e4cf.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9b5e4cf.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.9b5e4cf.0","fusion-plugin-react-redux":"0.0.0-canary.9b5e4cf.0","fusion-plugin-universal-events":"0.0.0-canary.9b5e4cf.0","fusion-test-utils":"0.0.0-canary.9b5e4cf.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9b5e4cf.0","fusion-plugin-universal-events":"0.0.0-canary.9b5e4cf.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9b5e4cf.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9b5e4cf.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-GGx4Il1uNGFK8EsxVs6j/QSG6wjvjuIP70jJ2mw57ocIFRwt6iSC/ZbX7OKTNk4k4PULzTJYZh2lG0TdEWhBKQ==","shasum":"8369d817824198088337b8f98bdc7b949643b995","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9b5e4cf.0.tgz","fileCount":17,"unpackedSize":39367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc+wRmCRA9TVsSAnZWagAAmIMP/iXIT7f7djZ/Mr7y3HkQ\nRqPHsUOLv2yBR8Xqvz1RSKwEFcNBfzGzIVzzd/JgJ5mu/Wz7DPBNH0TGI88K\nEBgG82ceVlBQAb2YA3dCTWzyhXSWYu8OzYKT+L2CibY0KEjY4wK6tuHMwIsq\nQhOj0/NWsN7hgTYiq9Irgd0vPSInjJ0f6z/9ni6KmmwzUPAGTau3IPIF/L+E\ncU0YxX1TAZC/0lPmNJpVkgGscLDrIDJ/IN9F9U8lJJOyg3t0zPJaw6Kva5V3\n1YzPSo4kVElL6HR+i6FkPvSd1K9FzdnrHSzXZk1Rf+OMS9WZVhcasevC6gxd\nyl5dBU7AgXNq+zQmOAx0C6jSwIefN3OPwLT/yzUu2XfiT8G/emYj0jozewd5\ngxxNFz1BWPan2VxCNXIsPS+0tnoWQnp7kI2RoFHrI9RjB6zGKmIue/qAPS3I\n0T/mFw2ZM2ZPlNN3wRkMKd/T12pV7gNMHiOlu5GmB2smivoHZSIEX1TnlU4z\n85nF0yJtVjjZl41EDK3YbAKapZ+Cp2vVqLb3YaILNozhT3uG7asEB+rhRKPf\nbY7Jg3pvPpzcZmkJF2jPQlZQHSjKZzmUM0hvBImrj8ePikZlZyRGPvjdO6ys\nFjch0x0mcEmOYTQnhwNZWlVySNHLSAmt7Gb/qIyXxFB4rNVh/pg/2KLkDM07\ngVmS\r\n=esTm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZ4jGmoif4jvZRcLhgNmD++cgMi7+MdUW7Tpoh2L+ugAiEAh8l3Z7qMg6eWxCFw8AVW0q9VLpLsqb1gOCCDR96t5T8="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9b5e4cf.0_1559954533491_0.27038588423884713"},"_hasShrinkwrap":false},"0.0.0-canary.43352f4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.43352f4.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.43352f4.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.43352f4.0","fusion-plugin-react-redux":"0.0.0-canary.43352f4.0","fusion-plugin-universal-events":"0.0.0-canary.43352f4.0","fusion-test-utils":"0.0.0-canary.43352f4.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.43352f4.0","fusion-plugin-universal-events":"0.0.0-canary.43352f4.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.43352f4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.43352f4.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-YAyVueR3G6w91dCbkQJHxeHzAIdgb2/mimMcXUjvT+TXj/p7OCuAFHtvRS7/zoiEj9eP2kS8RjAYyEFKu/fb+A==","shasum":"8d393cca98835715e1ca8bdb33be697ca57dc950","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.43352f4.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/qeHCRA9TVsSAnZWagAAwl8P/jugWKJT7dF4X0y2nZs5\nh7PV7LhEGmWAu0Eb09JOr52YPyJcBRz26GffwCUsEXNhRIvhn/7Fre9UM7X9\n7IAlZLHnNJTwvuKIlhLZToWAiuneO+oXrneyMNsp4UHyWoF+457ZH8nZSrCM\nZ9j/0n6kNqzFaCx29LmuqVlruoF2rz961nnIcazk60APliPlxtGI/IGENJPP\nqmpjzTyOGawzFj4ebP8gh/sEafxIcDlRSs1vpIhzFCuUO9JL4pPwYBr3ZLEV\nyFBMC9ocbMz3HQ2Dbyjs5D4bG/ZmyMKota/A1aZFHScpctSy/GbtXUF7ouW4\n/9eeG3bmiHpojT8mtIWdm2KPwb6kD/xJpFgcEpFbxh1pcY+eDJK6dvPFUU8X\nWDVv4sg7LcfQ0zyv/fmeLLc94/Z9CLLyPFWFhjclDyK3OvuepFiKq3BZIiVS\nzTBpjb24m9u0O0FB2QEutaLxd9Zp7tvAQV6MR2sssUmnH56boDKWl+R7WgI6\nPeu5qWDyRgSGj31kQ0fw9rOuKJosQiupA63qcjtQ7lXl6kyAm2d9OHegvIN/\noW8LHXijoPEdJJoxvFh7CxwUI72bPvEvolra8AFszYX5Gp/WhZwYHe8l/52g\nSo+s1PLUSJqKz5iZXaMWdpkIuuBDPXjfGEZe7/FlFQtgRi5oIDt7KcUXLSem\n82Gt\r\n=1Neg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFCvjB6DPYVQ0L2aFRcSSnz2f4LzM6nie/bXkJ8KIKEAAiEA+ED3UEIIjl4VF7KpufNQM2JWTvNYkihPY2Vd3Aj3ghc="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.43352f4.0_1560192903011_0.8669213513495193"},"_hasShrinkwrap":false},"0.0.0-canary.43352f4.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.43352f4.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.43352f4.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.43352f4.1","fusion-plugin-react-redux":"0.0.0-canary.43352f4.1","fusion-plugin-universal-events":"0.0.0-canary.43352f4.1","fusion-test-utils":"0.0.0-canary.43352f4.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.43352f4.1","fusion-plugin-universal-events":"0.0.0-canary.43352f4.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.43352f4.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.43352f4.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-MbJpDfjRVbeZ9EbYFGe5hILTN68VSNLeNN1KhvDiQ29cGv/FG7b4i2CWKT0Bj5aa/XtXtKjpyH6IcqUbB9XGkw==","shasum":"d40579bf9f155a1e9a2cccd2a31021d95801d98e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.43352f4.1.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/qf2CRA9TVsSAnZWagAA6BoP/2MIRep/FPI8VYXpII0o\nkGBmMdU1S+hP/LiyfzxLluTkXWo1QGd6T1naT//dseuTs5IA6+JPPRQwp5x0\nxByekUQYCPslvb1FoMUxseNSzYW150xd0jjkzHFDnrs7LAxjJM2VPv3g1Qoh\n/Jx6tu/fsgUtD0nHjJjfnDAE0Qim7tIloD7QdBW9V6qm/gREKfmyr+TdJgmT\nJw6+xXYMoOQZjKGt7gMx1BS7HAPQGKx6Dn3oT0vUyRpyATRlYSkksbShqY3Z\nOn+T5zDcQqdIFTjbkTcVKWiDLUm51L+TkDKTTvuiYfVTQ0436DSmLZa+TIoK\neJsKeRs0HK3ob2MfzPRGJqrjS4zb3a/jrTIg7lcrjlm/i2Yfzx1bpHLaau0A\nmqIPL0OuJp7OKcFxMSyUag4PdfGbtEEs6FxzglCCUmn99o/Ma9g4tMssdGy2\n9FlbiHMXKVnReSQxG7y+FpLe7slgUHpmEsYGYi7WqBtzzHcJb/NzNb/ewm+6\nVg7GB9roYdOJlT2EFxoWgGP1cEVAigpQqpqc87FWqocRIsDky5bGnZpooj+O\n7X/+XWXB3OfnysvMu67O150ArH62JQEXTZVDm0e7YBGuFgSMgIDn+8JFZKf0\nSDukrv4qvDZe+SB4zb4Pom/dmjenxJid49ScpHH2UsY9uwMAuMuamO2062Kf\nCUtp\r\n=xqSy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEWkn6+F13nJe/bbxg0cz2UpIj/kSkj/Oaz621j7QGm4AiEA4f6nLIE+jJk9YBQ2ndI9bpV1x5y9PMuKFuWw8oHRR6E="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.43352f4.1_1560193013528_0.29004176110392943"},"_hasShrinkwrap":false},"0.0.0-canary.4fb3fa6.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4fb3fa6.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.4fb3fa6.0","fusion-plugin-react-redux":"0.0.0-canary.4fb3fa6.0","fusion-plugin-universal-events":"0.0.0-canary.4fb3fa6.0","fusion-test-utils":"0.0.0-canary.4fb3fa6.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.4fb3fa6.0","fusion-plugin-universal-events":"0.0.0-canary.4fb3fa6.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4fb3fa6.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4fb3fa6.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-WprEJ7x7qLe9mMWpW7FG5nsowAXW0Ttaqu0kKVUQV2Io3N5rrVoulXd7xGNRJAmspfuE3y8UTpS9suW8QDUCNg==","shasum":"547cbf648e221434188bc22e8502f06fd6416aa0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4fb3fa6.0.tgz","fileCount":17,"unpackedSize":39367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/ql/CRA9TVsSAnZWagAAY1AP/AlxpLoW0mfhZO+8hI8O\n7WbhODkFcVRT6cKzjPCcRn8+K5JgFHsysjxQx4miSuKeb1gyALqW4+rd0L4N\nKzx15Zg3EuVIhia/HseEL2V1Q3xuRULwBwMzhV2oAStuC5jFTBNlGk4phxtG\ncI5DGdcRMKd/Yht90ULipTXzfKQkXDmXJal2aTFqyZfxxOdL8ICUtTXucwKM\ndiXYv17HZGY+z6mvay5ob73R4Mhfgk/VCYHjMpltuvwzTwC1qIHZoOo025Oy\nxE86uvCz6g2vvy3WyUxLxlNh++kcQgXrodcR1wG9s6H+OwoTKVLZDIS3o7zI\nZiiyxEkbzzObURTUzaXlVIqQbKrwvYzy76mb1DzdLCd4n68RpozSHZ8bGtxl\nIyvMttEC/cCQrsMJ67iKBZ7iMuw3d1v8M6ZV9BoWqKYrBNKCYuGpL+urTYPv\niVVU40j4pCIYrMcC+z0m0ta+aUULsSSC74YCGreg9nkN8OKIXkgRkD0kxaKZ\njcojnyP7uk5xSn/Z6ZijlGD22SDtPVXtihWUjpeH+odmgKSmksWMEIYSzgQ2\nGkMhDaH1ttZSdfL8rEA8k3KE+8ybAa0cbpF0hwF/+q4/U5WmJo7kbogMRmDq\nsHvJ4tHrSoufvMLGf5ptKNqHIrq6qtavTSTnwbO3sHuNVMRcmiUYeMQcVonG\nPgYL\r\n=UlJi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmR0Lh6iB0gUiEGQWGqUDCMN7MfIP5hAvw2imFh+yrcAIgDygPfsCCAe02U+s96R4Nz4S/hLHxoQuNFrBh6aLEb1s="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4fb3fa6.0_1560193406607_0.24177498900122596"},"_hasShrinkwrap":false},"0.0.0-canary.4fb3fa6.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4fb3fa6.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.4fb3fa6.1","fusion-plugin-react-redux":"0.0.0-canary.4fb3fa6.1","fusion-plugin-universal-events":"0.0.0-canary.4fb3fa6.1","fusion-test-utils":"0.0.0-canary.4fb3fa6.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.4fb3fa6.1","fusion-plugin-universal-events":"0.0.0-canary.4fb3fa6.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4fb3fa6.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4fb3fa6.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9hHh5KSvC1eqA5gUJcQi90nA2sd3dWphwH8osVJWUk7qYDUuic/yzls9tBmIfxb0WyZNi+zYq5dDWBW4AjxInA==","shasum":"e0219a215c166a8bdcffe65dcd15fd3c4b64f9a8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4fb3fa6.1.tgz","fileCount":17,"unpackedSize":39367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/ugUCRA9TVsSAnZWagAA6aIP/12Txkb19yBSgEoUJtb1\nqLjaNqGO5GDU5xtInk+tCWx0mIfuT1WqPzbgrdqCtSCvOlO3pnGfEL6HXRZt\n15Qj/F0nbfaIS4hqbni/+PKTihXgKIELoxpYTIJ7GPSJdMN5vQC2U+EIV+IL\nQsfpCETE16j14cRAGgMAz+cGwwRjubAv1+o+McosKjVN94M477lA7RDkrFt6\n73Nl7KRvj6c3UQrn9DSeyURs+846JvmtF2xjz7NIL+dyRD11zaNZv/GCZ92p\noBfTMax5nOXvvNujndfZxb5crheh/oFpGPDUMXvptq9GOC0P6DR1MT06l+uU\nDXQEwXiptvTdPiTKjPDved2xPRIX43TV4orP2EJWu8/lfIhHFaMkE8HUZVjD\nymxTUph7wIQmh+eEDWtZPpVXYavXeIRMF+oh1k/luVLRD2Z5sw87ZtU7VTed\ndjUAJn536YA5WcxKOLNC1ywutzgBdriZHOrykZwr6NotTDGRtqsh7DysPF97\nY9A7tdr4rFstl9xhnMEXpSPrN2739dW00TNJDV5gGzTQY0mXFLigq/TLNFV6\npNZa2tvQnKF9tUxp/BDVwBswQpQvdeZdn/P7D76KthT3ZioAKxGZFaV/yG7T\nOAm8gVTpFF9+2B8inqHbFmzKikAJ/XI1/LxgK7Ql2SPfIjGb5xITRfDwwqr9\nfr3Y\r\n=myXK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbk+GTLYQ25U7JmVYGsNlPKkHQVrFcS4YtJSGJZD4fiAIhAKuiE9bFDHrxrmdaGLzX7MidTPk6E2w751AwUCYdNJla"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4fb3fa6.1_1560209427545_0.020236760926267028"},"_hasShrinkwrap":false},"0.0.0-canary.72a6835.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.72a6835.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.72a6835.0","fusion-plugin-react-redux":"0.0.0-canary.72a6835.0","fusion-plugin-universal-events":"0.0.0-canary.72a6835.0","fusion-test-utils":"0.0.0-canary.72a6835.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.72a6835.0","fusion-plugin-universal-events":"0.0.0-canary.72a6835.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.72a6835.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.72a6835.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ment2z/H1+IfnGmOrFkXRlyy8lsXfA/XCGxF7FHonUFt0BX347eKFfhR2EFpBGJ64ikQfAik/OU7icyale8D8Q==","shasum":"ce5ec846ee7407688d771dd0671489e03edda545","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.72a6835.0.tgz","fileCount":17,"unpackedSize":39367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/vUNCRA9TVsSAnZWagAAwaoP/2OLkI3u0Li1EjQ+MTzq\nKQTUgzv8iYclLFcn6VTnblbuTBYx5hpsVAehciFM4yJsTq8D3YES9+dzq985\nNCwM1QhAr+m/Oej3H/mf6UvI3Y3Sv5/e1gLfPl4XGpFDZ/pLT07ARsVtcc9Q\nwFiAPY50JquEQMCKvOLJLjXSi0rNfELwV2CDWyl2RBAU1z37QRHTrpC3NN9U\nhZok515G0V7VhY6Qx3Glrs8wHRbh/vGbYczcS0FQxHF0QhFECGKzswrYgKd3\n30y65YcxEYxWfsUOIJaPiXmYw0Mq/T6h6nFYI74hsw++3KFQ55Y0vazDC/cE\nZGzdSpRLHjjLhDH4ej8Xs+B6vqwRiv4FyK/3E3/3t7bPrIwHfjFlYDzjjZNK\nALqNCbNdw56KWMDWixnFoxwAFcgbD+YFf6TsI+ZQtnmfYxyEGif/3LY/r/VQ\nxLIIUZgwQT8B+J8rKGc1Vt+G/liIDtFwpWSJTfUGMJK/hlY78/j+Tscm+mwa\nG/Vz5Aastyrnfl4d2snmnQG+Ho5P+FUFhcyWSSdKwm1/fUOdSktIoxW8AJHb\nGLDGrVyZQGlogtLuHbw+6tQ2pUdo/H7kO3H5T0fmz/BoA/4kuYz0JSnWOU4G\nGylwlNpKXJZC46xgFLDgEPCeFB4oUgIEeMoXbuEMzWU2d3sgd7WXpYrtarTK\nH/r3\r\n=oXU+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGW1LqWOVXBx6JFr3005ijRAjpknar+DsbXdSUVKXj5tAiEA/xVjpSY+aIZIHWl0I9j7pt+xxT+Ij5mwNop72TJb/FU="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.72a6835.0_1560212748996_0.6309796734731146"},"_hasShrinkwrap":false},"0.0.0-canary.af0fe55.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.af0fe55.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.af0fe55.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.af0fe55.0","fusion-plugin-react-redux":"0.0.0-canary.af0fe55.0","fusion-plugin-universal-events":"0.0.0-canary.af0fe55.0","fusion-test-utils":"0.0.0-canary.af0fe55.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.af0fe55.0","fusion-plugin-universal-events":"0.0.0-canary.af0fe55.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.af0fe55.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.af0fe55.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-+c02AyvHhs+BH38WRlTjNOSdk0Kp2ZNacNXU8aVgS2bJS6mLxXSQF40xlPqFNlnsz2ri9urMBwx10v1JISZG3A==","shasum":"a0e406998d99580fa17862386f6b36a79b89da3c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.af0fe55.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/912CRA9TVsSAnZWagAAJuwP/iXGKgkIwJj7Kg/HpMLg\ngeLBX0sAI+NGqo3vL6tP1iKNSYCSvN8IZf/WOBLip7OvudeDClYia6xHkIiE\nWMU//2T6NO1eTIpu30+zSiW5H80G/67kAfhks+RlOVRNKAgccV7w0Q40dWOb\nYxkpiscJluZPi0yIknaxh/4NtKVpwsckbNA5uximZhLJzwn8KbfwxxB4FwWa\ncrPNzjGhSvefSY4A63QWesb9GhuWcYzto5Hxpjx/avxhIOPvNpGsSlDDxKM4\nWfN0EXhBZxc3S7/AeoqaWdFFkQ+APxRALtZaqox0nDWpIX0oCnj79LT+5X68\n7zQaRfrZU5nDzoxVM3AYRXw+znV6TTJfzJWs8EQWY4QUpkSZf+O93gKFVAvV\ni8E96S4i32AbBHmH4Na0P1DG0fNChWcMUBzY7KtOuX15Qc9ALKromdlFC+z9\nYjmYtCp2v6u5PRBDMqSy1B25PDVY2NX5t59frYhZOf1i9iQS+EWWXGNLNuwE\nFHT8AyfSgsYa/FfMPGbnxv1vdErnufcy/yEFfxLAZmMgJfVPhgqxV7JOCIAE\nzThL8LaDd84TEGDD+ECYl39m8AvTahz2F96qwgpe1O8MtBwphM86sy4TBE5l\nHi9UE8mQWaWsp14y+X+NSiJ2Je7H7LzpLs0XiSKwPEyrMetcpXsn/5pKp+56\ns7mj\r\n=pp2m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUQ0II5YQ14heQbsJ52AH3lZ6QfqTJeM8Juk6a8BSidAIgMRDph+j7QNAxvcU6z4lCc2eURZhUoyLV2hszx6lxWWw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.af0fe55.0_1560272245032_0.39340190641350326"},"_hasShrinkwrap":false},"0.0.0-canary.af0fe55.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.af0fe55.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.af0fe55.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.af0fe55.1","fusion-plugin-react-redux":"0.0.0-canary.af0fe55.1","fusion-plugin-universal-events":"0.0.0-canary.af0fe55.1","fusion-test-utils":"0.0.0-canary.af0fe55.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.af0fe55.1","fusion-plugin-universal-events":"0.0.0-canary.af0fe55.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.af0fe55.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.af0fe55.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-nQGZ7rtLUHfK+ccr2G4Ty/d0HueSr8I+HoTKkBKFUFQYGW8eGi3icTbvuBn+Y4lvsgNjocEMM8tPcNqrkJy/+g==","shasum":"ff936dbb9c7f4932cfae4b80883c2e32e7732ac2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.af0fe55.1.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc//DmCRA9TVsSAnZWagAAjMYP/RXCLw2ou8xm5fZhZAQu\ng5WUvxYL/IlUn/Ite0qPWZQt836yz/xEC/quwyUFg9tZpIlpoeTQw4sMVmF3\nS71Ye3Kp9jklxnosjZJcTpvH4SnSawDzj+ps5Y1alENYEbjb9WXVZLVqFWoO\ncMsFQ3qENDnPB4AyawuUQ5mlfjaF6eAQIqgH7Ostf9rby9au4yFtRUfdUham\nGeL46GOxwbNBePNMHPQkQsYbAOKvW8NVsdlPvYOe34UKzcODur3wIk8Q1xxK\nfiMLIbEFrRgIxIvqBMWLUaVd0P0BkTsp6FDvrM2ImKRhPYA/HDKVbo2o4oNr\nZqHUwtroNv7qE2TU3Zw3Rj0uvoir2nNupNx5OUzN9NGlRbP4sTecDKPBPY58\n7fwfqo+1NySijUNtpJClKQKYgEVDIda1KocWTOUW985fj4IKGNvl/Vqih0zh\nFDlw987Mxlqiirdv/48OQFfW8xSDwmD5K9zdMqUvCBVdoud4C/A3gZsPsHln\neAB+LJIj5iK6NTRkvs/KIyB8x+HJ6jF4LIBg3Llq0yCFvAUnGM55seBhQ1Tz\njyolomsQjO7SVK7DfFYug6HpP4hCpHjOeoS5tf/3Z0o1quDQmraeyWv91vjT\nYqJ66U9v1R8/YbV6SApsOUC4O2bqiT669Dn+Mol3UdVoS9GgSVGkfzYXOnEj\ne7vi\r\n=ywcA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmPSiqMzmXjXYw/7zUIjn2ZmbGUVhWc2FQkjvulrb66gIgBb0UOePXTIwiaJqntPighjl7JEptkq9xEMPNNzp/5mk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.af0fe55.1_1560277221406_0.8999924903414003"},"_hasShrinkwrap":false},"0.0.0-canary.1131efb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1131efb.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.1131efb.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.1131efb.0","fusion-plugin-react-redux":"0.0.0-canary.1131efb.0","fusion-plugin-universal-events":"0.0.0-canary.1131efb.0","fusion-test-utils":"0.0.0-canary.1131efb.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.1131efb.0","fusion-plugin-universal-events":"0.0.0-canary.1131efb.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1131efb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1131efb.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-eclW1XKhXzvEaE3bdoQy/nEviJ7t08hsl2/dCB8gICIWRBIIHxILHY1ZMFoIlOPElr45EBOF/Tg30RzzQVaUwQ==","shasum":"cfacd529935f22a8274d861cc8327a90fb25360f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1131efb.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc//U+CRA9TVsSAnZWagAA1ZQP/iIOymidPyIzk+mO+kJW\nuAxhpHZGCBHb/s1fnmrwag+Atdh3O4IDQ8+ryaOSlzIu/x7uORcbub3uCTfz\nQtgc0SRiMu4l5bwXus0sdB9s7VfkgeIfJfCC08xbgnpvSyoGlG799IqpXum6\nYFI7siLvRH7SxrwuonYgjVSPJRknmrWzIDUEU+5v/W6T0nudbLa6heX1SuoJ\nLWoMorhVVqnlPw879514XZzmOb0Ql+cUjWazkag1+C/DPqk6FgUsqb4bTthk\n4tYzd2oWnkJKVXqsrsruzqPfBM6cg562i/mwnqhtF34gwqZgXg8I0hQHFHTe\n6KSIvr79hlpZmgsgEdjFwK1yGOzYqR3HXbHF7oAwygZxx7Lq5yU6DcUddA2Z\nw3FcLsJlT1zVmXnL0Q9Mkb8du7lQZTEK7cG9R2uMAb6or4VXpUBmNIu/fvWe\nsRTX+FZm15mpG6w1a8pPAjuaQDsfTetv9COXIeoEYpc5iezKy0A6KWvL4zQZ\nCyahNnCB2Yrm6yRa787lUoPHGxzCd1TzZuGUd1h+SUF6avnou6XinF2D7o7y\nIWUQZXjNedrJhCa03aKB7gRArC5GmuOxMEpx0M4v7RDWEneujVyM5mUNQB6s\nfvDmId9dr3W6oIFA7iFUZhnBHiYv1xYrk1pNJh8anTKAbvFmMDagJoT1k9gn\na4Cw\r\n=xjCn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFikrVJFC4wcCnZ0pUnExLZmkfYp9+X5esZ9VpoaB5GgIhAP1hltnovGe7UF/cqmEW63qIcLiRq0E+htwzkGH/mO03"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1131efb.0_1560278333950_0.8316152914148298"},"_hasShrinkwrap":false},"0.0.0-canary.2fcf0b5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2fcf0b5.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.2fcf0b5.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.2fcf0b5.0","fusion-plugin-react-redux":"0.0.0-canary.2fcf0b5.0","fusion-plugin-universal-events":"0.0.0-canary.2fcf0b5.0","fusion-test-utils":"0.0.0-canary.2fcf0b5.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2fcf0b5.0","fusion-plugin-universal-events":"0.0.0-canary.2fcf0b5.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2fcf0b5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2fcf0b5.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-51AZsd84wqasfAPbWBdCMlBfJ8CnE8AcKajuFKQ4GL7BF0hPwQDTys5+8amg+mohwfJ1ZcQzoS9B4gMR+CsG+w==","shasum":"d8635a26b8e38d74fcd75cbaae7608b28d97ffb8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2fcf0b5.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAAxZCRA9TVsSAnZWagAAvPcP/jmmnuMxkWjY1pYadzio\nzgsEh2qsV+Ti9ebf0ADCavjQ/cc7VT4YcBEgvk3ipeX8JE6z0KnU5x95MdA1\nQRzmCjbPlGKTawQ+8MqQBBW8EepItML8UGLGWFAGtZyA48XP/QcpZ09DyaGK\nzfINLsBV05kg8jcJTDwXG4LJq6qh7IXTCbDxrfcSJeHHen9SqpAwDxBQiz70\nJgC2cQkMmaUOB8uEJjyw/kAuXe9MdCjanr4dXeQwLJxJEN6jqrj5tdHEOmFY\nT1Jo24KvZRzBG1EV7DtOwSCh20S5akjwP4THwtxTXp1/oAYbldWdkYAOIOQ6\n1Cyey8iU5hNlTRODL1p8czR2ltpJ1zRWHWyGo2uI+n4A1K67wiBVs9pJmqfY\n2i+TljFuMB63JiT9tyluEQEZ3dEIe3nn/AqTuU4qXGRi0yz5PAWIdzz0+UkL\nSGonlISf0Gfp0dcSO2fXxBrq87wZ6iSPLQjk3Yh4LJtRRaYSgmPqwUOZDwAj\nVHCzEgbRSzJM1BkOquqhWiB2sbeiln824Ksmb4zesnGgWU+56UB8Sa3anLkz\n3BquGPCiKo547Ypa03tOAg8gvBe3htQDfQGAfsL67GCZD4d+UlDDY/dVMW/Q\n1O5LipdZ4h8H4sHs2rmOeRPJC0YOCAzy0I7W1Kr7jStzKkEjhnwueqWvm/8f\nCG07\r\n=scKE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmTrzfV/9r1UudC6/JYm+SIw3XRjCDQP3qtFJzJR8JoQIhAPxdwsk0E0lpNGzBaYtniAhOYWIyO1eSUgl05uuDLRyA"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2fcf0b5.0_1560284248843_0.97682838006582"},"_hasShrinkwrap":false},"0.0.0-canary.2fcf0b5.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2fcf0b5.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.2fcf0b5.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.2fcf0b5.1","fusion-plugin-react-redux":"0.0.0-canary.2fcf0b5.1","fusion-plugin-universal-events":"0.0.0-canary.2fcf0b5.1","fusion-test-utils":"0.0.0-canary.2fcf0b5.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2fcf0b5.1","fusion-plugin-universal-events":"0.0.0-canary.2fcf0b5.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2fcf0b5.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2fcf0b5.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-HiWl38quQk4WXmyxW18UK/2LEjp5QzpUHVZvsoN8HNibKB6URc127/MhRkH3Z8EUx9surCBOPaJDfw/Z1EwGmg==","shasum":"67739cd8c1eab4d575aa630949440b554910005b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2fcf0b5.1.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAA2BCRA9TVsSAnZWagAAqVMQAKHy4G8Z/UbQ5EmgpwSe\ndbGazkVXjMdVHiLWTHeD2Hpd9OwBRF6RNaYwu6drU7v84VlCDlItgNHL4+JD\nJkVOdl3xs9p+WQBQJD4ezrqx45NCqoj6N9XEscf7dNTUQ4rzQ1BVfhTYcW2H\nYTiQcmqKoypV1Tlnao+BSI62KCleXuwXj0zr3hlguKBgsOnbBHxbbM5CfI0z\nLc3s00nfykLY41AzWx9ovuSTBWL2G4AE05sKT6uUe73Uow5AFV+SXO0Ne/Iy\nL1kjIuYjtmpxX9Us5+wKeOMtYHRMQ6+nwOnyHlMP71Kr9rWjtjnyK5ndHmhV\nqTY1KQ65s1J2dlSUobrcuCD5Ku7bNefjS8j/JWw7y9X3XuMeram99eBiGoNi\nvGELawSTZq+BpEgPwSmH1Lxg7V1SrqoasOoXLi/Ln345ukMwUAy2WJkdUXSj\n8agcxUQ9HXtXm5OAz6uamyx/JotpKffnxY9iSsvvEBck6M4MgvypNsjIkK7j\n2rJ9H/pugGxg1t5Jg2HCpk65U2t2jjySlos39uWjlbrLiew5ynUX6d5BKQqM\noQbRkhU+2WumIyfehyxnG6h9eSlryZzcmyrOzdyxf899H0eAeiBL4fdIItGu\n/XIP8ziMoTkW46skn8KaHab/So9GRbgiHGzahdUaKw5PZaThsH87DaYWblKw\noLFu\r\n=9HSr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDws5WpQlkQ7AozO86t/c0kKmhC65JadimVMdgt3IIbWwIhAI5BeTSOlkZ1kCDNfO0prGfBat5YzjQUwELmZBig274r"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2fcf0b5.1_1560284545146_0.7167458074629425"},"_hasShrinkwrap":false},"0.0.0-canary.c237758.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c237758.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.c237758.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.c237758.0","fusion-plugin-react-redux":"0.0.0-canary.c237758.0","fusion-plugin-universal-events":"0.0.0-canary.c237758.0","fusion-test-utils":"0.0.0-canary.c237758.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.c237758.0","fusion-plugin-universal-events":"0.0.0-canary.c237758.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c237758.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c237758.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-VZzjsfef95Sr+wk07LMLzY62+QuDvkZFJ3BCczuos0ooD+9UgBmjpd+p/tNz3Ma6dtpz2AtxQJllJzgR0zEPqg==","shasum":"e09fb42e047d0c22817cdcc98b48df87223f5d2f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c237758.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAETHCRA9TVsSAnZWagAALrYP/Rra+w5ljKE+VWryvdVY\nLt3peuxfUIlHnUbjwUp2/M9t5IXJRjreRHXyIQ7h3CLhkQngvkNlll4lcMXs\nvqj+1pbkiGN73ZFMYZ2adVTyn0VuXRtqXlSPfpGoxQuSHh2+9ttdkTA0mrep\nMaheA9/udb1HKd3V3SlFMVJGgueRkVh/d3botdhTy7fEl2D0za8XLVw9eYlF\n76JRtBf3bnY+7Cc42k9su6q+rkhc6uVZSDwgRdRdKF17A3dDmZjS6kEo97/L\nNvBPdE8vSMo9lv4FGD8ZfXsxZUHu+KnIznhx4Atv5BSN55xT+uNfn5YzNfOV\nvNJq4XJ1f3CH2KapE+py062NTpsXIRAKiJ/djlOX5pzsc02vDxOPze8ZXu5S\n9CG4mCECBs0AoErB880YDCcH7ecDBUBHrivBK9kgU2dRWQ+KW0iHc59s1Bcr\nyqAR6/FrWPMySnQgPjqlI8tSTGUhQtrhnWIM6kcwbBgH4txLKvHDUjteKMJG\nzzenSd0+Nm7a0OlmzyjsBQTD95SXhqUFGXhLU3NTxENFC94G1i/1INvTkPMP\n2Dqh/BAfJf86061aRcGvJbM9o+uCfbOQP4Iil9MAQmGkJm/CS5D26p+XXCk8\nZxX3VPhGtgnJOXWSUcJd3R34wks+oi8c2DNI8+n2if4TF0c6/QlSS4hyBb/8\nsqdA\r\n=aKii\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCW5iX305QXXipmp7opSNPQNErSvoE4JMZEGD6cZE+ekgIhAJIEiLzFPVFw3LKZFJOHeqlpPcZNROHtzT1fgPp9nfH6"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c237758.0_1560298694138_0.8046405276004294"},"_hasShrinkwrap":false},"0.0.0-canary.8c0849b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.8c0849b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.8c0849b.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.8c0849b.0","fusion-plugin-react-redux":"0.0.0-canary.8c0849b.0","fusion-plugin-universal-events":"0.0.0-canary.8c0849b.0","fusion-test-utils":"0.0.0-canary.8c0849b.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.8c0849b.0","fusion-plugin-universal-events":"0.0.0-canary.8c0849b.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8c0849b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.8c0849b.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-+MiVr6sIbhRlfgUOoiL02yjOP+EwyEmNIqavPWaF9Ye7mKsBLFKUSPWhCwqST3R95AeGp5bhNYE6cgQI5Caxdw==","shasum":"7d1601fa71bb8972d53b9dd34ef20142db39a8d2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8c0849b.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAHA3CRA9TVsSAnZWagAAZzoP/0Q/yrqeKyRSXdjPwE8m\nq7evsRi8WgZasHENp8RkWbED3KikvDDl58ch0MFFdWpKrFouNZf3KuVKxRET\nOdsUzejysmaj5uj2N8jdAGC9iTZnY0pRoW/T/dz0FeX5ty9oHnUni0XDHnaE\nbEjKMk6yaiIIybVAmc6fOmwfO//7tWL1/t7K4kX5SynKY2j2rBIl9qdqIeqN\nBVAHa/bqUl5pPOgWVhYhNe55VxFPU+3Qw12kW3hJs9MfNBfiUBi/kWm8a/sx\noFt3x6hoD4rq/xtNWrNoqCnMzf31tF4SEV3ZUz4Uo8Kq6nIdknMN23Kl7OEr\nmLHsJK0KMfgvGm9O7rukA0BheQfYZ6NEnBej47pQ4/n1r/0TXppmhJ/uvuZl\nsLbhTIEhOq7qQMgECSSWRGicj/C+hhJj3wo2Z8Z5Hol5gIqhZqDsmeuV614I\nm1IUUnJenb9n2yY5K2s5ecevvlOImhQ8Ca4Hvmpph4iXWrnTd5gb9vLTx0vl\nF8v1aMkaCPkxQPn5duMdzu/khZsU9sJz6CbyQPyyVTyUKOHQ9x1DZAH+n1C0\n6AjwzWxlln3cC4mBQLyA5YBqWlGwnP2IWQ8beMo9BnXHhTgPqtAt8xysFXoN\nLvrKkBvrHBCwro/zQnf9FnBHq9vrKIjrrf4kSv8cUxHRK96QEqfC3ky97iVT\nkwYS\r\n=qq60\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF86aAxmpz5HNVzhlsqi/rFQz64OyFO2CljVWvKXj4b+AiEA1xqjThvb9XDaXH9mL/JmtoVismK8u5Qc7O7Ekvk7gQg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.8c0849b.0_1560309815026_0.23853011513534295"},"_hasShrinkwrap":false},"0.0.0-canary.0b1303b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0b1303b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.0b1303b.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.0b1303b.0","fusion-plugin-react-redux":"0.0.0-canary.0b1303b.0","fusion-plugin-universal-events":"0.0.0-canary.0b1303b.0","fusion-test-utils":"0.0.0-canary.0b1303b.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.0b1303b.0","fusion-plugin-universal-events":"0.0.0-canary.0b1303b.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0b1303b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0b1303b.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-JB5H3SEXLEBwAnGjPxlEV7eMpTJx3qBg1VTqx3AiIorvDAiO5jSlYgBD7h8aOAWFm4bbe8BQuz9y4J4otYSXVg==","shasum":"aa393f4ab5aa6f176a7f913c3668bed3c35942bc","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0b1303b.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAS0CCRA9TVsSAnZWagAA81IP/iaV/SSBUqTXwzF3nxgS\n2X8OfX3gSn+2APhqUgPSq+601WMYUiUi1Re6kM51dgYVLs3WIFp6kyXvUc6P\nwuIK0UktjxsfuEaQ1Vg+lQZ7091BTjUa6PQC7HCPeia/t9emhZQ72ZpJioKr\n6Dd7Zl1WEHyp9DW0TiDOtg5uryqN8OwNWHLHRO+cDTYXzbkBGJecW89iIMd8\nldmrzA/AlFryS1sOUgNsZfj8KV4Etdk7tAzOPwUhB8zFuo+8XvT2BJRizY9m\nxZknhGV3qVmVW7U+z5ShtXNBdFzpxlnNXEiUZVVDdlV2ysMcNwZRwPFZMV4H\npeiCAh211NSosYMMJFNyy0WcZcDhUBTeJmWkdvxybMmVZ8/s8UHmyTnN0G7O\nTKc6Byjt0RoY9sqq2cqOZ1ul21VFF6zU2Y96d6TIbLP3NtG6hEl82yZB6eXB\nnAHiggP886c1AygFAUWw4kcL828aTd/1rfe94ix4eNlQXdKNgTXSK9iVrIVm\nxKgalsFixLmidVCPYP8dJ8dGxByOsKuECCMOhND9cAAeA5peWFYWxvoQ0SLJ\nFm5LmGcN1OTTm5hM7PInir37OPZSlNaUdCFLj9N6AiOEbXU1uc33o2ejQ/dl\nyVq+wyLKu+3yYt+t5v90m1HjxxiALscmnnbjMH6Q27xOHv+zXv5E9NBds4lX\nL3Wv\r\n=rT2d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFlYMUNJsyuDHXQ+NYNS7nPQUUiqAdKZkZtoA+WA56hXAiAuB90GloXSzulKU/rijwFcGnh0isoMft3XfuD7lZzIbg=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0b1303b.0_1560358145634_0.40293831441923644"},"_hasShrinkwrap":false},"0.0.0-canary.7cfc88b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7cfc88b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.7cfc88b.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.7cfc88b.0","fusion-plugin-react-redux":"0.0.0-canary.7cfc88b.0","fusion-plugin-universal-events":"0.0.0-canary.7cfc88b.0","fusion-test-utils":"0.0.0-canary.7cfc88b.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.7cfc88b.0","fusion-plugin-universal-events":"0.0.0-canary.7cfc88b.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7cfc88b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7cfc88b.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-fZxSdQ/VI4lT0SQEXTwUySZarOXn0XCCx3lTmMoj9bgiVv6LX93yJe7iHKuCgWf303ZUORK+BffEpG29+zPmmg==","shasum":"71e0f17d087976bd353dbeb2142e001953ad0941","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7cfc88b.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAS/5CRA9TVsSAnZWagAAoCkP/1f2uYNGKbkrHqmPRBva\neOy49K207gdvPkC+XCYe2rE9ul9yHNe6apq6J1+z0OtEpTYXUK1zy5/8K40e\nE61wMDxrClW4DeoFNttbCAe3eq1HpsxaE3XPJ1N5vuoXN8jC5V8ScWu6paGd\n0F3Aei2lmTAv1rxe7xlf5vDl7svOIoMyZz8Ewp2lBiXJ95gXAg9QwN73MB/1\nX8j3otqlQX3fnrE8afxu4VVulpPcWBHg/y7908dHsA3Qanb3RnplLGCqxcCQ\n8ineCZfa4tkKRGnICaCtINKNdk4tOuP9RH/HYVWSdt5cBJqp5fEmkxJob73W\nOR8qQOSn1sWpKChNigALohlil70WBjCiZyBJCt74lG6SEZh4hiv1HGC9Q2G0\nk0ts5bMkQDNE+iQpEWIOA7oeL9d03zzCd8spgXCjHLkNPjje/y5HEAIfqkhe\nefyERZD7hB+VDJCK4RASVfRJh3qCOij+V7+XIvHX2ba/Fhjk6SsU428m72NW\nV1sMsA6Y4oh8afbtXuqHmi/O7ccEb7YssiA0YPFLX2koH1WGvLDS5g4mhmbv\n1ruSRshOK8im/1je9nopOoBhLWjNit0yu/gep1G0SVOd/cUYTozD+kozc5Jp\nOXv1CScV3rpRVNLGs8AGK9DZJ5a9P7Kv3tHHadzZyj3xjXjk55TduwI8gFD4\nMXSH\r\n=u8rc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHA0x8DIPkZkW+TIyHU5vdkF1VVzKeKWhSxdYAfZUwPEAiEA2O0JzdsR6y92cFcvjl30Okfx2p7oPHsAmBz0U38m74A="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7cfc88b.0_1560358904484_0.36897664151598986"},"_hasShrinkwrap":false},"0.0.0-canary.b7caf15.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b7caf15.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.b7caf15.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.b7caf15.0","fusion-plugin-react-redux":"0.0.0-canary.b7caf15.0","fusion-plugin-universal-events":"0.0.0-canary.b7caf15.0","fusion-test-utils":"0.0.0-canary.b7caf15.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b7caf15.0","fusion-plugin-universal-events":"0.0.0-canary.b7caf15.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b7caf15.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b7caf15.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-HV1pFhfnZItrUo79lQ0LYKMAuiwy/0k2N7IvG1RD0/6fIZ4R92YysxFAKvIlqglsohFFcXOoW/8VAQAp0gk9oA==","shasum":"fe2f8894b4bd409cb167c645bb3c15cadb1f6c91","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b7caf15.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAWkMCRA9TVsSAnZWagAAVIQP/AxVuEeKmU6Ez/z39VQz\nPPu6JRuNv+I8KH/t5P1oIe4QjJyfgrpKG7xlRObDr9MXi+uSOT2HvFvC1afT\n99fpLU7lTGS7vxEYTNyGrHhktPNWpZZGB5bGnNJcMfv4JeZgyIp+OxhmYq9E\nYbVbZh1PPmtzI64aLPxgPNA9Dg4OI8JXN7w7Gwcp4drhz2Sp4RgLIk59j5Ev\n6GsRyOhPlzx0DjOqy8Fqv7YWi0iXwpTIJq8w+aV958my9dfs4CitMsL/XKNc\nIHWCLOFOs/lnvREZFfdMNO2yI5GQvWlCsakc8FjuLwUpvNgQY7XX9v593jV2\nMiO5zcQlrv3obttTK3lXC/bx5/jjen9lldIsHqN+HTyyGsRmmk0Q7+NC4usJ\ni+7OcNIy7npdODxsgf1PXWyGP2jKlj9va8wphPlSiJ5/2J6VwcLiR/Tv5Vdw\ng7+dGWQZ41VPlJBZsfX36vgeaacXdBPWZQFy3cigSGIS70Ku/7Xk4Ln46jro\nXWQGZ2yfCKf8irhWJ8DCb7uQ40zhONWFVZQbXZX2OUAmoBxZkVIuo2Ud5iNQ\nY+b5IpR/kT5DQmVGdnYiqXUXw3/HX5lgS57gcAULbDH2Fwbd3gAULS9HJgnp\np24DXOgEbz6nzK1NlVdqaU8E6hASCk1QqDd9dOTdfmrXLgPF07aXm8ZzbU8U\nH7no\r\n=i4ae\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLlPzxVNx59f4uptE3qDSHNQNYfyub7T/ylsBz6ob6iQIhALTLr+eidbEQY7GDRw7bnFrgX82YiYARFVDfBFAg31zP"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b7caf15.0_1560373516370_0.05132530663689283"},"_hasShrinkwrap":false},"0.0.0-canary.b7caf15.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b7caf15.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.b7caf15.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.b7caf15.1","fusion-plugin-react-redux":"0.0.0-canary.b7caf15.1","fusion-plugin-universal-events":"0.0.0-canary.b7caf15.1","fusion-test-utils":"0.0.0-canary.b7caf15.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b7caf15.1","fusion-plugin-universal-events":"0.0.0-canary.b7caf15.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b7caf15.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b7caf15.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-GYVWZJB2u2jfugOlQgW2c4XBREPZcG+sCsDotEuCUj3uCvQ80Q5A46YRHgJdEP8hVaCvHpPdEeRxUJcTfaph5A==","shasum":"4762f41e4fc44a5cb4b3c84c1e59286ba41be980","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b7caf15.1.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAW2vCRA9TVsSAnZWagAA8yUP/0fy6Al99Lgj2c55lzk1\nEpkRNfxwCelvOC8ayePfEkMOrIwzXGhcm33KGtO41YosNJqiF7oe1OHW9VYH\n+g41jEeIm74uBD7VvMFj6w+dSmhpma+yux9HTglW/qRbOzObGK9YKiquE0oA\nz6c4tBJGwMKEhQRphzr4PGXN85dlaYagb9uNdghSs9nqev0st+w0NVbqnx36\ntvu34Y9MPy3ia+MmdplmEJMZMwGJHu94w8aqMQRH8yCpsGVkVSpYmAlEHXgh\nKTq14+tKpW+Kd30BioLL/KF5vhHaA6qk21axk3xVXp12B3g4zFwCByXoO61T\nphOOjCtgyz4dywCTOlF/ysCumpGWBHpLjiiyw/6hs+qSgf/uEj4WSzaoav5w\nY8EGAMkp3v9tI2baUDXjFZjzFR+q9URzH1zS+wsgtXHsgr85RBCuLSUdcCyK\nfvt52/uT8bmvizg7PoW4yLfXtkCe1wRp2goc6xZyx9vNybCsXR3Y//ndziQT\nAdYORCkkd5rNg83CJOBqWkksBZRjMdaVnpEpYLkycR+YnkZ2vt7djo38RM+H\nFIM9p+4UEJ7whXvlEydy7Tdhggv1OzHHShu0AJHM8NTJXkq9hWJv2acDSCKx\ncpQUKqgA+EQugrMDDYp7Ty2CU2Ak17H3x2tL4St69eeuXTUm89fumPV4dMsw\n7LmK\r\n=6U+z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZ6jmh7MMtTWtd8kLREs8Y8iys75eIz6m8Nusx6i4XCAIgBkjqA9LsmlTMCfvToKjXLYcOvinGKr5Xlk/xA23Rrws="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b7caf15.1_1560374702299_0.9469959458748818"},"_hasShrinkwrap":false},"0.0.0-canary.8ae44a5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.8ae44a5.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.8ae44a5.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.8ae44a5.0","fusion-plugin-react-redux":"0.0.0-canary.8ae44a5.0","fusion-plugin-universal-events":"0.0.0-canary.8ae44a5.0","fusion-test-utils":"0.0.0-canary.8ae44a5.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.8ae44a5.0","fusion-plugin-universal-events":"0.0.0-canary.8ae44a5.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8ae44a5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.8ae44a5.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-jHQvTtlDtWQE90TySdWZnzsY+fFA1s+PYItu9DX3pxNP6GP+qCyfk94e7KjjFCdEBfaxwu1ZFetKRnkNgTLY3w==","shasum":"707ae657a622550c3cc4c7bf8641f4396c8f30a1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8ae44a5.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAXpYCRA9TVsSAnZWagAAllQP/jjuNookN1tXPb4aogDn\n6U32kQ7vWQQPEvuNA/1c5aWl+L4GbOPIaksjK9BGFddP/wtsYJszBZxTXD3y\nUxJKMKKdJAv5aS2bp0Rak91U1ugLI7x0SLWY+i77t3qGsIDw7tptvZkjzNNj\nC6Vbcjuhz4/NzA6Ct5PdPECmzDALaFUmZybA+aQPEpHLmkBYUOzRaWC+Recz\nCiA+GFCVUQR5qialL3XzmrEZWEikcafDun+0CWESVcyLMyX92/IVtzU7HaS7\nGE8PNJ67NO9SNCOtZNjg5CN2vYwINhMy52+jFaFImsxRR+w2Y/Hq2XANgo9l\nW0dVwrNh6pRvqCm+0abYNUdLTSQesXZhFw4WJaQFLB8S7DpJ2Flt8PJV7yuh\nz5XiF23cDGLFkak+7xuIW+ck91HWyb0AB+/odCB6JiFrA2lXeN86OYA4OJe8\n4Gxcu2b9Z0Q0AScgMkejOv1et0su0WORGHBWY0Cx7GD5GGHU49cDsSykVSmJ\n3LeZxOmB5wxKB3Z1PjzTcInTW+5TXigrNRb0NY0Jtsv39sVURZMuGOliUAlT\n6ig45q8Gqz2Hw0jAA1knTal+hemxB98/Dk+EIzSwtJplDDeYkxHo61RqdJe+\n8PMU0pF6UDyygZdi665/Xgs6IEbD/RQybyMlRd+yzofMkW8DUV1bNtKHaEfn\nMyye\r\n=psdM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBBb+y2kaemWYboysXZfW6VoxcWkS537xB564GugtecwIgC4Tg1Mdp4BjpAZIujkrTENkQmTilWc8RL2HK4m3yxLw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.8ae44a5.0_1560377944328_0.24113620256263668"},"_hasShrinkwrap":false},"0.0.0-canary.8ae44a5.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.8ae44a5.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.8ae44a5.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.8ae44a5.1","fusion-plugin-react-redux":"0.0.0-canary.8ae44a5.1","fusion-plugin-universal-events":"0.0.0-canary.8ae44a5.1","fusion-test-utils":"0.0.0-canary.8ae44a5.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.8ae44a5.1","fusion-plugin-universal-events":"0.0.0-canary.8ae44a5.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8ae44a5.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.8ae44a5.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-K/orwx6flrDS6b37fT2R9iyDD+ZQVldz7x3tsX0lN683nj2CSMk4diUdsxSuSQ7Pneo+5aDhd4YmH9wSOKim3g==","shasum":"d82b0815e9e831ba9943c14da740acd9af9c346e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8ae44a5.1.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAXvFCRA9TVsSAnZWagAAIYYP/RmZb6GaejyE0fh8MJ4U\nCEPbRJ7BbC8qouUA5/GgAsUVtljdnSttHTBhP6cillbO0OH+crheql5ESD34\nFLdmH66XDDiJxAyBCu0vfvZz+LAFDIEp773H+F/uOnF9biIXFybZ1j8GaNJs\ngJ8JrxLFNlQPEJYYzC6PK8IbQsMifaOOFzhva7AzY/6VAO2liuqtVopRxV82\n17zaQ3r9RqReb6PlmFIr4CYmLWh8i7jX/h9RjKcm9mViDIf7G8mD2c7Djg4S\n/E91DynLbQIRgjIdrffEazS2XYWjOkrwcTgSpzt43GbTzQpblbo7RsrP2+da\n2aeg267EcMhnEXDMFsCy4OBmglZz/87WRaZemvvZezCjfBefuCEW2OJ41M+u\nnmqv+iWHpUSE/bahn6KeVQ5YXM+UDYgxzBvVyiDZh/0bJ2/mcVsoUh7oioXf\nf8sE9D5JQdPNvy/9rLq5AAQzupEEjEMuRhjG7KqWPKt4JVvt8Zq340nLztjM\nOmAjZHV+QaeE2EMl0tC+/EVUupGFGBRpEy3rDfSe98EJk6Y3Chrmu1YVHMQS\n1wKa2opuXRX3bqFO6X2HowbFvMGmoiMmatRai8yugQRKs9sZpWzm1kDIMWUX\nvkaTrqt5EkFEdhn3B+GY9lq45qf4N6GLO52qprus4+sj2rpxCjFlFVEOVmFS\n1uGL\r\n=0jYd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIERrQYJUcYih86pyCnH5qNLDcWHKEM8zvh1EFOEWqrYLAiBfDtlR0G+2p+bRSn7vn1XEcIUr4IwVtPzgdpzWwCKKew=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.8ae44a5.1_1560378309244_0.08551915611414951"},"_hasShrinkwrap":false},"0.0.0-canary.51752cd.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.51752cd.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.51752cd.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.51752cd.0","fusion-plugin-react-redux":"0.0.0-canary.51752cd.0","fusion-plugin-universal-events":"0.0.0-canary.51752cd.0","fusion-test-utils":"0.0.0-canary.51752cd.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.51752cd.0","fusion-plugin-universal-events":"0.0.0-canary.51752cd.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.51752cd.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.51752cd.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-xdar9Tms1CrKjWYdE9iiXkF+U8qmt94MA0Fduz0mfuaEpcWNwZuQ/J5TITmi4resy07MZZ1fGFt9Gi8/y89dTg==","shasum":"704193a23587ad6c84aa8e598f6977dc6471f466","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.51752cd.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAZS9CRA9TVsSAnZWagAA3ZEQAIzBhvTHMeoT89sDU9Cu\ndfS0J/JbWojoueT8FT1K3HePPbgxLUq4xTMugOHOsFSVhUuOTk523vEQynas\nKS3hJS+8PK3KIvzTx5F8343q50k0mCnMpXihfQVS9XBUQjBuMprMzlR2Uobz\nCKMGF0Nsy2VChmps7PYGyfEWHmFg+7E5MS3c1/FF+spgc1YU4n0x6nM7p8ip\ndjjg2xfaPjo9T0VspMKo5L84gEychA2FaMnBhXmG+FbqKdzAimI6WY0uArfb\nEH/RN00b8S9RUYBmLtFpNOnH+X0ZsYDBjB0NIJ60pC+MxTh+WIsi1qEUSRRp\n97Fgf1Du++lI53CMNybrCsQkRJcdn6VMuBPtzGys8nAVyMM2kwd97F+BscTS\nBCOoh+0s3RE7/toEozWNufiPL3owMgggEjlFWqv2MhOT7AZCTG885m+gKNz/\nrEP0yghAnh0PPTmfd8JJRKhEnzejdAUCh7NaQ9J5SKWhIETry7L8D/rD9q8G\nsYUbiI1srmkwsTt/Afu1BDFj190r7gO8vuz120fCM/vwdH2b4hf4zyW6qZ72\nP9h70Fl96CcFKLxrahbqiV95vZnBc12BvaA7YCf1MUnPkqNkaSX1gCX0J1po\nesrkhnG4NghgU5DbYOMkASLytpZepm34bzotzOQwck9HAX9/TfYWPRITFCFE\n5XPo\r\n=1bUD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5+Z/zUHYfxrLipluf/xHHSBrD5FFxgDtjP4oEiR/3AgIgdgscn51hG2p99Tk6wmgg2SNPZxx8FIDoT7gUMCILCY0="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.51752cd.0_1560384700471_0.4132005000235215"},"_hasShrinkwrap":false},"0.0.0-canary.27245f3.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.27245f3.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.27245f3.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.27245f3.0","fusion-plugin-react-redux":"0.0.0-canary.27245f3.0","fusion-plugin-universal-events":"0.0.0-canary.27245f3.0","fusion-test-utils":"0.0.0-canary.27245f3.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.27245f3.0","fusion-plugin-universal-events":"0.0.0-canary.27245f3.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.27245f3.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.27245f3.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-lFwKlW4M+CRtwtSgf57RkyKGUJYmIX6yTJYQFHpKLiYKAj5cGgqqAr+Jp0tOc2YejO/H4eOIau+YoSA8EKCRnQ==","shasum":"d39b0713be7774b7e8826fb6c8f2f5674abb612b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.27245f3.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAoqUCRA9TVsSAnZWagAArHcQAJioaJnQ6lJf6fiBAScm\ndysyV45IreWj6XTbvvA1QLeEoCOkjI6e2G5vtA6k/h0yapSBwPvKVf4WI9VH\nRti2Dxb89av2+YTn2fm5m4Gbg5dhJS0eyveTHknXSQlMXcVhK/V0KxscX7yx\n2f7qUvylglbaBLHXvDYsMUj4sSphMrMXWQF2CV2taSfWT6Nbp6zqbo+0oFbI\nlzq1g2sRavfwTcKfU6CtKboSS/xsQyBZolNMJs+1cZ4s3CBeZiAqmf7O/wVz\nqPofYUBX+M2nYXwr1kk44psrZbHuLrQ3CMSy3h9BfYkYBKYMnXQc75N9E9IU\nktWf0dqhnen8g0/RVl5zBjpI98RXKJo4b9FsmVspArptLNwBTrpw6/0tFP16\nx8ZHn4WMRgkr5Wkpc3oxyZz5hCCCnmhKn8yYrr7VVyss4KovszNTdkgSf7xF\nqAcJlY4zBQ2s+o0TmhjuNL9iSMcReN99TpdWf5Hv6HnW2NMQ3lyFNBLRkVY9\nt6hjECMh/MNU92pZwufWBg56R3O3ZHQRtWEDIBNqGjRZIh84YI+Qz8v/c3nX\nHME25vBmCHSIzs6OTqk95IW2/K9H332TT/BmHqBrc5TJNih10aUHCJfLBsNF\nyh2+pKzTUij0hf6D15zGZiiU2ov6vIGWE8yC3rK4oOBY4mQ7ln6Ezx9tBYJS\nTzPM\r\n=PWL7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChaItiZHkG9Hul4nwbvd2Uk/IkuKQvtvbsHfb9bpfkPwIhAIYHbOGoYH5Y99KEJ5VShGT++bBfHf16Vy60j+aqXVN4"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.27245f3.0_1560447635896_0.055681476445302414"},"_hasShrinkwrap":false},"0.0.0-canary.3703af8.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3703af8.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.3703af8.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.3703af8.0","fusion-plugin-react-redux":"0.0.0-canary.3703af8.0","fusion-plugin-universal-events":"0.0.0-canary.3703af8.0","fusion-test-utils":"0.0.0-canary.3703af8.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3703af8.0","fusion-plugin-universal-events":"0.0.0-canary.3703af8.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3703af8.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3703af8.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ECW20/sdhZAwD224AuvtoUneGqy6l5ecPWd5bqFQtAcDGDQyyy1Agh2/TQmSQVFAiKmma1nsiFxZp7rEnSyELw==","shasum":"bdf05435ae11bd3b61a5d782b150c896a2c326f0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3703af8.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAw6ACRA9TVsSAnZWagAA4cIP+wYn8eAlGEHp3YKw6vX3\nQDPuozN8Ua7Cxx9SiMFd74Hc7fHbBDcKZq+8lrbbEsYoli9/PWn4+FAg989w\nIBjvdb5TrFLWZLka5+3ZwVbKG+aJ4Fm3IjllXz/ZvS7WbRH8O+6ghKcJEgqg\nUa+3uJnW+rl/3VfX45aTBzuqYzEaGeNZp2YMPECK2CyXy3f9ClWQx1wtR0fF\nWRXYBvWajKYTgBlHfcHF21dOfDN5l8hSl3MgMmdB8vCQrYokmZ7KV0OZ4obY\n/utwn4z/3/0FDDhTHwrnpF9Z57TygS37gjuzkEBIAVKc/DCIJKt1vYdu25U1\nLlEfWRh8DhC756u4FCglzF9nTioImgxFK4AfX6pQwh7YWH0+DqILbhOWb8ZP\nnG+0NKjdJnStMrUmUHXALpz1zlTIQwLbonKfHMSK/hKHngHVCNpQWNeRo2Nb\nTyJ4eEQB0GDB0UYvzxDPrUY3pJ6JLjk2nh03UwcP4H7npXfjnjp7G+tfjMsN\nNSwu/oHiaS2Tnr+/uwokWOTreLAdBlO04kdEeRS6P05R1Wtj36YrCWHV7PUL\ndatYka0ZQKPWduKPlHVCwwKFAJpmCuLClSPxqynf5bOxEm4iYyLvY3y4fWtB\nERev4rl5dwbmsbbm/ZCrdY/pu8xw4YJsrOogJsHy7/NPuzViq9xrwGuYsqkb\nvZNU\r\n=yQF2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHu5tDHfM7B2P0wSD5mQAmOAoDml5h88HaqufdMMuQCZAiEAgsLS99efL0W/VQgXaK6nOYB2ATNld6ro457fciVNiE8="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3703af8.0_1560481407752_0.509938537573676"},"_hasShrinkwrap":false},"0.0.0-canary.3703af8.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3703af8.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.3703af8.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.3703af8.1","fusion-plugin-react-redux":"0.0.0-canary.3703af8.1","fusion-plugin-universal-events":"0.0.0-canary.3703af8.1","fusion-test-utils":"0.0.0-canary.3703af8.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3703af8.1","fusion-plugin-universal-events":"0.0.0-canary.3703af8.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3703af8.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3703af8.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-CGlvUadRWwmqK+WRKAksy/kghGdhCj6aD+B8XQDvaz5MAJr74aKM0m0ttZkwFgkiwT7HNLHVARojACB4c+pE7Q==","shasum":"3fdc534667ec0832f8dc9940f8663ae40142fe07","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3703af8.1.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdA7otCRA9TVsSAnZWagAAwmEP/22IUHmWEA2deQuH8vP3\nEbrfB8UJ8lVeFUrudfSdiBk8SgCLeEapw6OxLgrxN9IU9FYx/hnglQp7gY6H\nPuuA3jxm9zKqK5ojoVzBCxsw8gXIbWNeunLBjMADszg/HxpA6lkJ36QdbGR/\netAfQRZoqY2H7TjU0jV/0L2PKOyV1ORX8xE3wgcKLLzH2DgJSROjsYjUAC4b\nU0688y2/QJRp4xvob5diVaXZRUKmw17t7g+TDDtkKyGKJj3RcxFICNY2Nzj0\nrDSopdS3J5jVluX+i9groGW2EKq3sFyYD2UoK4cXQ24yB3WGCkvMj6OY7JFF\ndcEoDXHQg6JWkbMtlnPJ4HilCrnmUD4SphYegjBgM4aD3oNvDIIxKIX28iF/\nTx1I7uYzFCd3luLwWGmiD5S6kugKIM5HZMqX3xVYpiZjgj40QXA/dCI6x2RN\nUfA/AmVnKKaRF5NN376mlM2rYyM91xlt+qwte8UzRcb9bWE9qS2UbDTO2l8V\nEUI8/f2OqUVmyFN4YiFhMVbcm7yLY6Nb/cJ5qmDnDZFSL+9ZREL3lH0HP8+P\nXvfjj8clySjZdWNduo/MDS8czUbkcCIWo/FNLI6Gmnz0K80bnc0jX04jvZjD\nrAzOX9JTJVkOQDqVyDlTdTezxCFmp40D0hXuannP+Mb3Qfh8MrTeh0BvQsHq\no4vj\r\n=Onff\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWmghw2+m9ArYLtiizUUyIaMz728FbvL0XrVpLbpLEDQIgMoiYTUJZ8iMAC1HrA/gWi2bICTd6Zx9NyMRYMBnSKSA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3703af8.1_1560525356415_0.6124421940190772"},"_hasShrinkwrap":false},"0.0.0-canary.d93b398.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d93b398.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.d93b398.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.d93b398.0","fusion-plugin-react-redux":"0.0.0-canary.d93b398.0","fusion-plugin-universal-events":"0.0.0-canary.d93b398.0","fusion-test-utils":"0.0.0-canary.d93b398.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d93b398.0","fusion-plugin-universal-events":"0.0.0-canary.d93b398.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d93b398.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d93b398.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ki8bR7c7/tZp7aRIHdZZWxZ75rinFILwTce2a+UBYgxxecK7qpJkcD1NfTR+RNTaHJ6EUEdrNeN/VeSya3N7sg==","shasum":"b6282b935aa2c93c8e10d7d97d5d36699316ce26","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d93b398.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdA8zcCRA9TVsSAnZWagAAfpwP/iHyZIYIueWVhN/C2Bm2\nBL2ouvjqMOYp1/DvYVSgRe+PueR3hf0vjQp0dGvlwvgNcpfjI0pvDppomxOE\nUmJNC8XYXKsBY+tEVxrqwKULIrv6wdy6ZHNzXjROrDwYKSwK/WGBiqeiSl77\nL/y/ShKBSo7icZxVRiN15HEIqjkBYgAbYjJOOcEGVkj7WHrpVzi7nuAFAYwe\nIzRSRY3rLu6dfYGErJv2iYinEeNb1GNiOxdq+1ORm34DeclOIo920iVEPlfl\na691dQClQIVFLPTl6HUEUrf4YEbHtK3KlwdPksxOTQ3rPWccRpoH80rQk+zp\nxqWtB7J8lxtcYJJpvFQoBKULpdRyAviNM9PndizzzwNLeVix5Pe3RSth5lAV\nj3xjzGLUZJ/oWnQdS/07XAI6DoutQerafr8rddBE0utHQQ7ScUmu2LkXmitp\n/V21X0lOOEdVqMNWp9yLzLz0cLOI/EY0I8j+sHTgp1HgiHnbVOlk/2n85EFS\nvltf49Y83h7ShYFNuRPKC1W+pXMEMUwG/Ab/he+pdMZZXsXBttAs4vZeaDVW\nj0vYOSWP0eddhzSTtbZeT9o+T6AHPSo5w45UZjYQ82uE8qPFIaQdLdR1eVve\nb7xtzpBG0xanovlD9sNRcV8UdzO/lkVvP/XB4MVUSSwpyrLpSIxrzijT7H/J\nhM0B\r\n=yrQn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDB//VVe8DEdE+/gcxKav4tdOok4qTCvBL87heG+JDyBQIgCq4ibfKk+M5of2sXxaI1QnLTyz3VKWEuEzwbD5WU6CY="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d93b398.0_1560530139734_0.4861721236381811"},"_hasShrinkwrap":false},"0.0.0-canary.d0b5703.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d0b5703.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.d0b5703.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.d0b5703.0","fusion-plugin-react-redux":"0.0.0-canary.d0b5703.0","fusion-plugin-universal-events":"0.0.0-canary.d0b5703.0","fusion-test-utils":"0.0.0-canary.d0b5703.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d0b5703.0","fusion-plugin-universal-events":"0.0.0-canary.d0b5703.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d0b5703.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d0b5703.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-wdSThreZ//tak5xObCO6x2AdkIF+QJ0m5CG/criQ/Iko5NvYGp+yRF9T+TvN8A2YJx/lzbgYBQDOQo98iDIBwQ==","shasum":"4eb1ac9469d94c06d341084df891bbd66ba32882","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d0b5703.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBBXgCRA9TVsSAnZWagAAAhUP/jMRsyOUd0lNPsei28mk\nokPqoJJxTtFdzl13mIIxnRA3BXCsNRnHOKxUC0p9OtvIJBgLHdXEXmG3eTpJ\nkwVgJJ5y+qPSz0TneJrSWezWjxmF6k/iGQahbtB7Y8KutRofahx4OHn65lxw\n2o7LADU5pkavFW1fmEDOMcF6ahV1nVIqyOTwLrReb11gh5ET/pu0XVGZR4pV\nwnCcDunCEoGY65y928dpQkNYZGHxpohum5JLSU2sXDZZsxI+MozeakaThOz7\nabgSVe5XqweofB6vvfDlybIqVnfNAi0QxBrGHdthz7WNntkRveUrBqlz1laX\nGFFxwhisQxFeHGWcDV7TJauwZvDbaWdXcXjUu5NyIGYFDePqnF5UnEAkWQ8x\now5NsKByNFCI7WCwkoC0C5NuiaykDrK04ioIQrnAgATEbkekB0OdaQE++YJc\nTUo33Rzx2a+sgo+EzbNiNkZ8q8dRLfFh7Yjqt1tg1mDPeMeZiHflNNn7sSrq\ndaDJ+qicRaum9Bjt2ZFFYVKrGidi/A9ycM2rATnIuL5Ludo7ExT6/SQXUmAi\no+BnUjCcgbYzJL7E0ivPZ/tDrhF4kT7Gu7ZJesTf5UrjBHHFC+0N4n1iAhpm\nVLCKwcTsA4YJyxsjUZurpHumP8AFWiQE0uv0oqUNrLlwRNbctHJ99GNtvfcd\nHUC5\r\n=F1fm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALUF1unfIH7fA66etxCPYLnjuwrcRwS3MrZy7B1ijkIAiAr/adGBZMG/rbgV1Fs1+N4qaGKKp7r6KbztlttBmY+/g=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d0b5703.0_1560548831842_0.820861246209591"},"_hasShrinkwrap":false},"0.0.0-canary.801e47f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.801e47f.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.801e47f.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.801e47f.0","fusion-plugin-react-redux":"0.0.0-canary.801e47f.0","fusion-plugin-universal-events":"0.0.0-canary.801e47f.0","fusion-test-utils":"0.0.0-canary.801e47f.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.801e47f.0","fusion-plugin-universal-events":"0.0.0-canary.801e47f.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.801e47f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.801e47f.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-VOg2MvWDaAx9/5m4jH5SZS6AzAKtDm+ZRXNi0ozZIow+XWhn19GRKPD3jUexmHXePcr34jqeFbSHMMPMFeg8qA==","shasum":"d652e9b78dde33238ad25903c84f7813a48965e9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.801e47f.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdB77wCRA9TVsSAnZWagAA70kP/RXIva7WX2dArPFV+po4\niLV9D8HsVAsl2E3+qKcJtyX2KG+HKPF+NCpRtp007Uv0mhEvxCFCYmvzj0J1\nL3K+Y0CyAHiU0l8Z9q7LAzBstba6VxYbLxkfQlDk7rnsU0UO9dh7oGopuQIs\njldsnNcejB9epgVqfAVYDcXdTb4BKAMR68ywVLsUA2h5hQjA9b4OZ3QQHOxe\nFMFkZpqRcXBZfCCkycoCaFvA5XXS0VNqTK58vjQwsYz74deqNW2TeXg1OJU/\nPSvda8ZyoO7ncqhSOUEUylhYl3eaDpQDIpmdqTKyYNrtmDQlhmbxsWES+f6T\nxxGFciNDBwx00qRF59yvufQSHGSfs96GiMtsMu66vxnnETfrrbon9tALH1ln\nLFGYTdHfFx6DdF/hxcDI/Ndi2I1HSGl9++rS5LzzJoongp5IJlle/Fqcq+Gb\nRy4ZONHONuBVJAlkkmF4q0f25mXPxYM8eKx/7WqIeECnNrXpmUItMLS4smVn\ngdyy3vP1z+ouOu1Mug6TbTiumj7Wu+KDsLMRfAogM2yoFuh15r+pXwoPdCNY\nrTD+C9tQ36xj/6LQ5zO4ZmfEunousvtkOtbj+9Pq7rqNHqXtUYNfQW4ssWQY\nvNJbOBGmf/zJkeGGpr4SGQTQMuq4FyhENNfY8dI/i1AvD+diFgg49i/m8ZB6\ngR4z\r\n=L2Eb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7HuRUkJGNRrJNBdini4Tfkj2ECgZk8AhScjx+NLj/pAiEAn83mu70qMgxcCtVhmRYe8Byn55BQlGYYUkadY0/mzAI="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.801e47f.0_1560788719403_0.8934853382836285"},"_hasShrinkwrap":false},"0.0.0-canary.63145f9.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.63145f9.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.63145f9.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.63145f9.0","fusion-plugin-react-redux":"0.0.0-canary.63145f9.0","fusion-plugin-universal-events":"0.0.0-canary.63145f9.0","fusion-test-utils":"0.0.0-canary.63145f9.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.63145f9.0","fusion-plugin-universal-events":"0.0.0-canary.63145f9.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.63145f9.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.63145f9.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-/3EBgMn3Tfq30LWsgVqRcqYE853ygdM+KQ6MXzabQWI/jdJh7KpId/2GwZTTsHyZtI7D4hvyawTZP7Rsi9MxVg==","shasum":"b46da7aff29ccde0fe79c34cd2d4dcb599ea782d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.63145f9.0.tgz","fileCount":17,"unpackedSize":39384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCC1TCRA9TVsSAnZWagAAKMgP+QEJX71v1Iu/LxyX2UuH\nyB6mbgxFECz6renHUvbBtWoYFnJBjsVI0mcoXtEVTUWOcMubWp/5nRAIcBuF\n7fTUuh8Zy6zoUIv0Rn8nFcBoW+I0PxpDilHyzBnfGSR6s8yzTXkvm4ZTNld0\nRYzthCGyrevjEozjERqiinuA5wR/jXEPFLSFeK0B11UVLu8A9/EpUnWL5cfd\n3NexDhN8GpdfVH8aZPS1bm6k2uzjTKM9/EJssnKVrTwkmcNnbUKp6eNCEiYG\nfhpw14fjVLrE/GnkS0ft1YMO2MqnkQzjaQIAS7yimnVbArs5qmA7v+F5G2X6\nfFaORdcT5mYbg9urK7DWeyKMXPUB/A6bnFlpx+6bkMyg/1REXJPvTk124WKN\nfCjGr/gwmltwbtLlCpbECvPcGU3oDeolvFE9kRs5Lmhd+TubnnFfm4EcLAYj\nk2AJp6MKGSOCkGXMu0VPfg5WAXRyY2vofFOh8YNecy2BMDXIHCFzxX2PKN+b\nsWgRNlBPZMJKUNUkdMvjKnwaGX+oeQy7c7ZtNvUu1AAo6Ne/AfS700LCOu1F\n3vmBDCIgEjdqBn2s+ldU+kmdWJGnsufxdwQnlXquQC5SXkt8Pu3SzWVOgxFw\nG2b8GCgGa+fZ7ee9F1tbAiCbWQ6p58Vo4UQE15pa/4SOi1Gd1qEo5grnme2O\nbLar\r\n=Ja4Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB49m/AZF5XLkQx8/mZZxJYwH4lPElK2kBUIkwmq4twGAiEA/HFyLRNTZG6wvqXwrUtU9KensVcDfq6gT5z5WpW60SY="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.63145f9.0_1560816978287_0.7114453479601752"},"_hasShrinkwrap":false},"3.0.3":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.3","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"2.0.1","fusion-plugin-react-redux":"2.0.1","fusion-plugin-universal-events":"2.0.2","fusion-test-utils":"2.0.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.1","fusion-plugin-universal-events":"2.0.2"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-3.0.3.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.3","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-AuptwhvQo+AqIaHrA32GCSp+fi2/rYOEpaMAt0nvWwUkDf3GIvdv/VyGGzy9wBC7yoNkmHQzm6N/Loicbg2D2A==","shasum":"6200cedbbb67d51a6c2e70548f0ab1a1c07f83dd","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.3.tgz","fileCount":17,"unpackedSize":39248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdCDJcCRA9TVsSAnZWagAAUyAP/1q5dDEjJyu5vgxZbL8r\ne1b5I3Uhaj1x7RJFKE/vpdRsidnxaIjf9XAgMtXQe7zF0KdcIh9CWzgrtcmo\njX1h5lGiYlRvy2LN/wJCkOUaUwJGJyGMrb77bonSqHmqQU3qxdVYs2YnZJ2s\nIt+GLpn5QFDifUSim5zHKJC8jJAHteItUQ0iMtqomqSjXxuazHUAK/aqUYMF\nh3+sHvvIpsy3YZ/CDnXLbuE+QYLGce4JU5V7mdC9jE639f9YrJ5Go04ebHuX\n+MrHQ6G2E7PgTMLr8v8PmfJDa4a8Qva+H43qt9Z1NsLNM8C/0eD9hJIi4eH8\nQ0JCL7xaRkk5GSWbr2B4OaC8N7ReNPKu2xci04kntT1BvtciHW8sNa9zmnmU\nbDcLe4M9OW4LXRUd4hsKxh+jSvocIT+qiUtTeJTOWJ2Y79CTfE+UBV/d7KNV\nDrtG7EiqTiQAGL38fYh3zlELhpcpu6G916LZqM5MkI8ZMQOKtRBrZEoClVsl\nWOW2+gRAAxB5xYy2UdWiWQ5ozYfDeiaPmy0o4PLAbV1m0ndM2y1nET6GUnHc\nYqbuqi5hFR4i1fviq8J4xjJqBvvL02q+apjrcp99V8mvdpCqzqdQiSMu18Zl\nvlLHaagzNRqAcq8YMX93N/vPyA2dPVKtmJIEnRshfPXuzLj4T0RjXVnvUJRb\nAEk/\r\n=y6QK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFsJpcEB+FdL0Z7Yot+3DfCNwLLh5dXOAVfc/gs4arsjAiEAxbgkjT89uh3qZvzwJxRptVTYaRt5dok2ErJtKJxggno="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.3_1560818267624_0.038219316336324693"},"_hasShrinkwrap":false},"0.0.0-canary.407b8e4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.407b8e4.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.407b8e4.0","fusion-plugin-react-redux":"0.0.0-canary.407b8e4.0","fusion-plugin-universal-events":"0.0.0-canary.407b8e4.0","fusion-test-utils":"0.0.0-canary.407b8e4.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.407b8e4.0","fusion-plugin-universal-events":"0.0.0-canary.407b8e4.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.407b8e4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.407b8e4.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-/EPcy/rbn0NaqlTxZ5XPCWrlpu5aL5kOYNbIRrg5PzRnklaSANvIKdAmuNiXnQb6xqp7+LodtoQCdXii011ATA==","shasum":"dd6d40a43046c683b0f46d03b5665453489a4767","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.407b8e4.0.tgz","fileCount":17,"unpackedSize":39367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE9WiCRA9TVsSAnZWagAAqDMQAKC7U6iyDfjc8xEww3CB\nChoph4XKKWzZP3kDEqcwGc+A/rBB2f40SVKkUMfBh8Do8f8C6ckqKK1zKxMC\ncUVKJBIJSizYdH0ytKXDOfBzLzwo+pWQXPRgaAsYVoIlbXfMjxqeWsUUShP3\nBLMspwUGX+PyOT3LzDXmhkmaKye6kJ5N4j8EXuRa/4yTFKToFtJTwpw5gfB0\nHKxUm/FNOl4ZvlxHEnWRt+OZ/bD14QhdVMYLAyEDsX8Mpp/uYVvNF3LjlsK4\nNNq6G9WsDlzpr0rQfc0N5Z8leq9S7q5cX5hPVbm37+TVOHpcCLQhUK0D3xBi\nKidmeoHOY8lG3fyxEgUJeWfYu73dO0IxEaR2pjhhwDcKq2v4GMSy+iCIuW7u\n2ZklwXWbXuI0yFOxdKAlwn3mEEeItl6dPqovvtIr1kxG0gnkGbgTVJwwuthK\nim3sk4GYYYKURy9Amt5N3WI6qswyDNjC2DZqHsQ+v8HVK2qY440jHt6h0oMU\nVjpNkPXHXwOS8sbK0IYB8P/LXM7gg4+gn22Xb4GTP/Jc/AGnBufV6Ntus1r4\nlsRBgVxN+CzLCKjUo7tKF6NkjQEx6yre78K7II/ElDWWmSyzjiMjAau9l27L\nqMgExn8ry+jaPjvQOvhsp8SWlGN62bnXclJH7K63nIZ87uS87OYkSVo71pHx\nBmsR\r\n=yfZC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGmlPbcMWbzXuMAP3uULYk80chTuN5Ug1Xv/glrTqXOiAiBbH9HuT1vbpQ8GyzmoS6oDy/qrCDVgfvwB1bT4DhfdOA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.407b8e4.0_1561580961935_0.9236833901739707"},"_hasShrinkwrap":false},"0.0.0-canary.ed79452.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ed79452.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.ed79452.0","fusion-plugin-react-redux":"0.0.0-canary.ed79452.0","fusion-plugin-universal-events":"0.0.0-canary.ed79452.0","fusion-test-utils":"0.0.0-canary.ed79452.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.ed79452.0","fusion-plugin-universal-events":"0.0.0-canary.ed79452.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ed79452.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ed79452.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-iEc/tgod4jRcmeko+e0FKd+sMFoVZ03VqVUh3ks4G+QVTC202XUs39HphgitIPsIaK7H1Ys9zbZr5/PzHeWk4Q==","shasum":"4172546783e3768a6851cea6f8c7d150091100d1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ed79452.0.tgz","fileCount":14,"unpackedSize":32439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFRCaCRA9TVsSAnZWagAAZrUP/AvUAbBBle+x2tiAmlHf\nLOMgCy2cXiB3g447U0R/7ZKPF50/0p2XGI9DppjVij6smbopH+iXEiOqCTcn\nC4hgNUFaUCdy+1EDUWL+/I9Xdzozrm5FTsBOALzpbEaT2DOOovc/s2IYg2Jz\nXeAfRytlgaQX3JxnLd5Zl4UDOMPr2RUqJsdVDhgYATATu4Z55IY8kASiNFou\n3IckcqZXINYpH6J0PVdEdp0u+QLq9yPMqt4pnuH4hp8V4gANfmqVVc3C8Rpc\nQ0KOObgTaLD1gGOJD/vLZnxNki4XF6Mp4sx6JRbPNpaS4qrSeXoT8aITrv5q\n375kEI0tbCzFDhrkUfak/ZH0GUjEu4Yz2BCoymMB3FhY5ti/AWpxlduTvJNG\nCMOu7+00NvXszus9oW4YmscsjOjI+OC0zpGAk/gL9aVkimAMc9FkaDOje+1k\nmeasTt9AyDed0Cba/9e8bY1HOAndOcMfxyM7B9dO7JJuoei698L993ABrsZY\nBylObXtAUH0Rb30mZmelgzI12AJKimdYei1MXgQoBmbK/tsDKTF1zt7RYouA\n9xvMHMVw5Qh692FwOhnrLbTcFpOWFPPEHRIf9X8kzWKl0r2i0q8HuZfjr9W9\nGxLO/uYKbVdsKVX7IPprzhUZvV9KrRYkyDPZnaLHwHzUE6NmnFJNstxyu2TB\noVvm\r\n=zKO7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHpG4psiolas4E9rxtxtPsWRGchyXVYKgFzKIE5mt3V4AiEA/5SQ5nFfvgiLjxP12JAZZiT+/hNf+fBWZ3+ZXHpdyos="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ed79452.0_1561661593159_0.1888789871701222"},"_hasShrinkwrap":false},"0.0.0-canary.3e2cc31.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3e2cc31.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.3e2cc31.0","fusion-plugin-react-redux":"0.0.0-canary.3e2cc31.0","fusion-plugin-universal-events":"0.0.0-canary.3e2cc31.0","fusion-test-utils":"0.0.0-canary.3e2cc31.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3e2cc31.0","fusion-plugin-universal-events":"0.0.0-canary.3e2cc31.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3e2cc31.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3e2cc31.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-hSteHgk/ywLDBihLZsS3HC0Kh2OIhe1ux2+sXHU5Ax16OS5zkoiK7QikkOBzTJOThD26ULaDVznuvy71V7cxsQ==","shasum":"a58e70a85217d9d3f9e054718d0a24794e59f157","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3e2cc31.0.tgz","fileCount":14,"unpackedSize":32439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFlK6CRA9TVsSAnZWagAAOMoP/jZq4Kj3awqhfYa2+sKp\nXvbOXH71G6b34jLZqw6yPsO4XFTA6P4nEKXHQ5deSFBR806OZY4iFlB0O7oB\nucM3u2YBk7RRg1vuMMXibEAfU5jR5/aURytbIIpENDlBcgRRELhhQVy4ztii\nSRs7Q/vrL7PMioycSCiIlTv7oPqJPywM0hzNfTMq4x4RTua1O3R09kkGCKHX\nYqUfoKnkGB7MavHVTRtmi6Rcn6wkatq1w0grKNVLyDLmIpVX3Sbb3jKZJFxL\naqyj2lsJRWv+rBOMIEBlST6zdEia+6pyMhZfUOgC3aybxHMyeUXhwI+l2Pvr\nYim3M6rWWF4hjYOEuuhHv8sdPmVR9wfolVUWrqb63Ui0oWjJlOoeZ66gvKeI\nfpOdVypia7i/mBYlU6jgEETkfGGJivVguqjAhWh27T5o2h49e5JerHGgRR0X\n8ApZouFAaVoWh/awZi0EOZ+S9RqF6fAbS8Dkr/oyWPGkr+xmJev4hN0g4HCv\nf0pNsuZfhyBIeC+R/397mKFU0CtzCaVFkjqq6LbnbkDcs3cAYFMwMHo6Fh4m\nXHHyLGxkiJnIEK8OVZVgTSz2c2TeOl0CfNQ2ePl314uSkGJl37wdFxNkCLrr\nVYeTadZ5HL2Rrfiui7h1RiiHwCpucfKrr8tWR7CNzaV0impWNy1yYezMwzfa\nH0Yd\r\n=eE81\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9WV7sACkyc8KmYFM63ssu47gLkd0HXuEwsY39n3sQwwIhAMB63CoLLmCYJhn22cOV2nOrUehDAYqLQPQJxneBeTyK"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3e2cc31.0_1561744057348_0.2437723559974616"},"_hasShrinkwrap":false},"0.0.0-canary.5c3b351.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5c3b351.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.5c3b351.0","fusion-plugin-react-redux":"0.0.0-canary.5c3b351.0","fusion-plugin-universal-events":"0.0.0-canary.5c3b351.0","fusion-test-utils":"0.0.0-canary.5c3b351.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.5c3b351.0","fusion-plugin-universal-events":"0.0.0-canary.5c3b351.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5c3b351.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5c3b351.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-aalL7rxrymZfb9zS2z19KyHeP0ZiN5W67l+94JNrrQA/KGuDIvUud94GwaQ7eDAUbQJZA9XdctaKtE7lISfg4Q==","shasum":"3e3f084ef5cedfdb3606c059b2f7937a9ec84b4e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5c3b351.0.tgz","fileCount":14,"unpackedSize":32439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdGn1SCRA9TVsSAnZWagAAJRMP+wY4ICr3LPHWQ+2f1ei3\nvqxuHQOrSoLBBrj4qhVdbb8XM9PtNrBIjMVuu02LSRNlzhjCzhEVeYHwDiS1\nxC8wWWmY0GMfwLOjihetXkYUhEfH+yEmomRO9nHMV2apqbQTpmFagpjalJOY\nb7+nz1wnZuJIM5iBsHynYcJDAfe2gAtkpRbdKKofHClrcmdYjwkoxsL3bQpE\nFXyCfKb+kwIgxG4L0T07J9AaSpmbbpTzBFSMLoSGCPUM37sZWzzuh893gW+k\nMysK0MKwxv+hl1cEOAbgE8uSEan7Bwh9/A0C9cbuwMJXPN2/2k29ajRjzhx3\nmog3b01z0WTfn073JaezWggdPTtuUNZh9G0gpeYVAZJrVyjBj8epn1/5aKAt\nvpqLgHSFSotSox6QZIlfAWld4ImmtYZp3mFE7A06z1Fh/8bH0ylzrRQkWHye\nZizdK7oWT+0YTnogjeobVL8i+Iw36BT/wwNu/rsVy1c2MU1KscsHWOVhs9Mj\nqhlsP2mDWhN1xK36Ju8zLpJJ0gPDE0fLvB7nvTYerV1GA38RcB3fZz9FSa1t\nhcN55aTDuhJB/5cF12YlHLTApOKo4nZvhEE2njKkL6kZKkt46SIvreqgDMcV\nR/j09SdHCxQp369B5809/le0P1nT24+MHRykRmbX22e8A1QHDzMioWVBFlkG\n6MA3\r\n=XPyI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCG8nq9W+ou2EJluNORHXYmGyBqHCxycjZA5gCaRTNQyQIgI9XWKyEYDa2c9H2a+NwHyKGPcdt4L393QqjCn+1+Mmw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5c3b351.0_1562017105483_0.7440281160272164"},"_hasShrinkwrap":false},"0.0.0-canary.16ee004.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.16ee004.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.16ee004.0","fusion-plugin-react-redux":"0.0.0-canary.16ee004.0","fusion-plugin-universal-events":"0.0.0-canary.16ee004.0","fusion-test-utils":"0.0.0-canary.16ee004.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.16ee004.0","fusion-plugin-universal-events":"0.0.0-canary.16ee004.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.16ee004.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.16ee004.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-iHxKYpxeURZon+diamNAS7g0pa+zj3s02/2kF4u7mx9SxS79BPFImrNONwB0JXUYiD9hujxujn4DR4V/Q4RahA==","shasum":"006e773f9e2d8b96227380ab7ae7a68abaccf40b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.16ee004.0.tgz","fileCount":14,"unpackedSize":32439,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdGpP9CRA9TVsSAnZWagAAba8QAIyVAbCppEEqvODEZYjs\nnE1CVi4Mt45t4Hfp5Q2k+nequ7FeaZ2VXoJjECcxRnCZVDbfeKAuy9T8jwXg\n1DfN/fnnBV8VX1cILRqe1AzP1GBy0NtZyZba0PJWbrYUt5Fo8eB1/jxYPP78\nrZ4+ll5zgaAtFOZTJ747tjbp4kW6/7Kn52gcYEu95U6bk1pu9RCs5m4Knfo9\nmxPF+s4QWgaNs9Aydy0LaDx33shxAFpvBvERZEnIvTn9I4MvBLTMpavAy4E+\ncDqa9nJ6MEY93Tcr8vOXw0KqlHuQpPHPLs/I5TDzzYHc1JE7cOONwVNta3F+\nlm/zQrhl0czPKx7r8AQQKnTBurA33uU9ycFc5/RXRlIKIg6b5AAgKe5UZyyR\nYKO0pzgUmYSYhHFd6iWK9IVyCAz27crhq8/iTcKPWefMIIyrZUwOXwUsAWgx\n+fIndLX+JXTFYz8pMOZ8eWtxEvmjTyf7rStvMg1PoAtpawymMe/ZDUyj/KGB\n0Zxe++ye6ssscL2YLjPRTSDo50XqwPB4VJXtz0w/0l6ZOyub+QhuKk4qzK+w\nBjjsYf3FEqJ1SzoIRHarODelluEjPmAOHMcIIm+Me4kqxY9cwg/UJTdz+fZh\nsvZk9Hd8deYQQCmLX2IrDgKnOHEbdyL+lMPnnRq5BrhoRkvHw/rKHqjIKYue\nKC4k\r\n=wHQ5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsQPU6lOeLoxZxDo02YN3NmbW6EG6wSo1ibJCqTboMagIgUnEOf5ovUJj4lkfTTApedtw2u/ehaVi1ypjuSvsmEEk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.16ee004.0_1562022908447_0.988536732491788"},"_hasShrinkwrap":false},"0.0.0-canary.69d2497.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.69d2497.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.69d2497.0","fusion-plugin-react-redux":"0.0.0-canary.69d2497.0","fusion-plugin-universal-events":"0.0.0-canary.69d2497.0","fusion-test-utils":"0.0.0-canary.69d2497.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.69d2497.0","fusion-plugin-universal-events":"0.0.0-canary.69d2497.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69d2497.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.69d2497.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-zewRxAILAz18zGnnUU15grc/CC5o/OcpYUsZRhCA+CSB1kGTRKoJfqnhPDVgDoClADisW8IrdF+IfrKLbdNavg==","shasum":"74e47169f94a0189ad1c2ad8b10aba3e62ba8bba","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69d2497.0.tgz","fileCount":17,"unpackedSize":39544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHO/mCRA9TVsSAnZWagAAagkP/0cFtuGABvrnarAzdN24\nNoW2/CVhEf+K9N3gZf/s0KJCbuqNS3SRLKiP5Uuq1w3qsd2BfIEHmOs4T69q\nFaPLSwJ10h9XyWd1dZ2zaK38d8ns3wemOewecmI09/CvHrsespCs93E0Wxir\nStqaY8eaELjg8rZtxXwTxc0TCjMX0iiwhpW/Utp2niR2bzSSAozPLoiRUIXT\nD08Ymk0bK50oC8/8ysD/pz3uCsEXYgLeQsR+TbUktTIPFq8IxWGsxbG6jFTN\nBOz/K+r6pJiydawBRLxQjT+3YvekvUd5C7r/k3gO77A8VO+GLk12bNm9GRPB\njS5JQpv1taiHx0dq8ne2/gi7lifwrI7kGQe1CeDui1Ey+15AfClwCCp5XnUL\nuTbjsBxQNUYQFrIA6ud5GPFkEcoD59tpWh3nbU2Lc0yMb/1zWsTLFMTrgy49\nKsVwhzEP9c8nuDZBFBL7kS5kVlZoeXbW5IsIvgKelO8rp8wMgJI78lFh+c6L\noLPvJojKAUU+z4FDIyJoGeAWwC80uwEOfC9NSg9UZLkunAh4mKKoof4eC6WW\n683Vy6rAGEPh75yyCzTz8OeIwNzHqXg2PAB0S1JSWYd0GcR3u2ZJMFjmayfR\nB+doZdJbLy5k8Is8ojKhTMpkC5KfRXsGnTqe8Z+3t9F1Es0UujvloZGlv9L2\n4boS\r\n=BfQa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIByI+gcwtjxynea9fBVAaN5rEBHhtdCTvTWnYUlXQkc/AiBU0nL7YFNdVcis6o2JpzKd1+ATHr5sKqvfrTmh4gs0xw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.69d2497.0_1562177509274_0.5923996231782278"},"_hasShrinkwrap":false},"0.0.0-canary.69d2497.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.69d2497.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.69d2497.1","fusion-plugin-react-redux":"0.0.0-canary.69d2497.1","fusion-plugin-universal-events":"0.0.0-canary.69d2497.1","fusion-test-utils":"0.0.0-canary.69d2497.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.69d2497.1","fusion-plugin-universal-events":"0.0.0-canary.69d2497.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69d2497.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.69d2497.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-5+ly8UVlCShucoUHbKj7cbg8vjjlMLD9MUXwGkoNdsIaKTfeU07uLDzrCBcd9Z0E2K6hSy88Fg7QnxI61W4k7A==","shasum":"5f6bb715ca1cb3cabd62824bf7a6485ad6356e73","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69d2497.1.tgz","fileCount":17,"unpackedSize":39544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHPDcCRA9TVsSAnZWagAA7BkQAJztKJO9E3EriBoEoW2B\nCVwa7SxN/76GVCB+P6duA3ANjEGy1CC2eSbrwR32NiBtTKA/3gqdnxXbzgwY\nyXiK8NNIp/cu0LVo4d229q5Dtq70mny7TKZIAgLsdPXOnaTehjXf8Upoihxm\nMsTlKc233jqtT71xPWzOh0VRQ3U2nzZ5P8O/Mdb+GA6RtGLqUjwF3qtwFD2Y\n28cTlRoJtZENHc/NtX4HlN8DArzZU+nRyjvExXx+ahCwDB1qLVcs7UBbkCKL\nllXO14NKuqBG42OwPiqDFFGhC7XoHZdxGlnLwkDC3M1owRYcjT1VZR6ouICS\n9v6Df6aP9vRZkzjJ4gDtmll0bSs8F0fgS06SA6TFyrdvsjhheZF6kyPSdz9q\njuIiTBKdSYeYsH5lU7bB1rA/RlU+OFyV+4WUWuwfUA7CLm6nLSkJXNE1FNxC\noIwVS/NTTVSH1TBYW7j1kHHTZygfUkiGaAE9ZivREwRLZmt8BTzBYFFUzQyN\nmfEBn5dX0HIl05/Q5fPcWFhyYdVN3huzHMHHzMSwR2/VSsV8V8y2v6GEZ6HF\ndGMPAkKV0CCuAb/GHv6eW4PeSZL8xQnc3HzgOUWOsPNMSsulDNnUfjNEVUFM\nspIDhxho87ZQ4XMTl1wZarfalo8/ZXOwSxKCziUhINetPmsC9UxE3IuJ1q5u\nK64W\r\n=lhK5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDClT8QZnY/yXMcrSMwOL5Ql7uBOwGPPSRYsfdGNOaWfAiEA8aXag8xTJIQUsQbrZLmAmxKgJ5DbaTe+x2L6nMaoWfQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.69d2497.1_1562177755691_0.1715199810345176"},"_hasShrinkwrap":false},"3.0.4":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.4","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"2.0.2","fusion-plugin-react-redux":"2.0.2","fusion-plugin-universal-events":"2.0.3","fusion-test-utils":"2.0.2","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.2","fusion-plugin-universal-events":"2.0.3"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-3.0.4.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.4","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-y5bcCKZa8hbkms/8/TjMv6DOCW0zGWSEhYHrJkVxT0Y8wrI9RfHPgzj2oXu/anXOersnzxnKLGmiCmWowBPjEg==","shasum":"94cb0e3b46231bd48ed478c3b99a507faf592025","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.4.tgz","fileCount":17,"unpackedSize":39425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHSntCRA9TVsSAnZWagAAIX8QAJTnTerdCbCth7aE/XLi\nYmgh70ryw9spY8j5G68enJUrg6XcX1hRWjbA1/0JFyt2ffJRbdgcvEFDn0Ua\nU0GN59QnUxJIdLN8WZxcjy6OCCndjfC6N4dH7au3RnPztLYLhvc3LEwAk3V9\n06NdCTT7U1sjHSjZBuGoQCO6eqlGELuGvTenegsCn5PJolRqR7jELs8k7dxH\nKg32WyY+JpktNEcQ98NBhB8I/4GRB4mMwPptP04OeUdIvb8hWhuMjuuPmxl5\nrIpgJyj1Td0L3EN6tNJRR5hx9jzxbd8Rvka7oK8/afensXh6kyLUvJV+lNGT\nIbWhKgWzmi56kMTJLsKMx7Oce08XEiVHF33A1MnmPg4F/awrNACDIfGBIhNR\nIYkWubocXP/6rXOi4X1cQev6NGwNIMwtC2USY9FlV3BqUo5bKM7xvygHag8M\nJC+N5fIxcJImuKxR66LA3VJ45Vfa9R7Lx/rn/nHCyGbBxP9DObJRc0PswCgZ\nsVB/TZ/F2ZGUgnxIDcHX1Jpyqan2AFdyYXUbq0j2/+V0UVS4/gjXo/tV7ytI\n0hOAYDvTD6r7kL3lnKg8Urk36fPKhB9e52wkbDbjDsKO6Dx1sfV0Nt60+qbt\nVqRRNm7HRWOUVuyFWcnlzifFPYPYzBNgaJIYsD6lBnfqhxDqTYgH7Gwb71AC\nJSXH\r\n=5hYc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICFgx6Wd66Pr3wLq163/tgZjDp4SDU/kICvv+0bqXYj/AiBwBAarmaPK1DQ044BiZzI/G0KNyoOR4DjYNspMzxlVAw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.4_1562192365062_0.14867250360688833"},"_hasShrinkwrap":false},"0.0.0-canary.98adb08.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.98adb08.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.98adb08.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.98adb08.0","fusion-plugin-react-redux":"0.0.0-canary.98adb08.0","fusion-plugin-universal-events":"0.0.0-canary.98adb08.0","fusion-test-utils":"0.0.0-canary.98adb08.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.98adb08.0","fusion-plugin-universal-events":"0.0.0-canary.98adb08.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.98adb08.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.98adb08.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-xi3G3ZXvjab6xtoqsKMt53I2lOPCXAv9jB/PTCmpG8zUPeMiYBrU2UVrCYssJ0fJaBnKu4xwvC4dthpnpqrDnQ==","shasum":"d6bce2c214fc81adcdb7f7f0ecfea139d2df378b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.98adb08.0.tgz","fileCount":17,"unpackedSize":41739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdI72kCRA9TVsSAnZWagAAzEsP/jdAtFGq31GAwdX1FbXz\nvVd6VoOfu6C9I5+d2YMUtV2s/UoYII5x5KjEGtFy0P20zyGmdlm9uD1IBAUx\n3mBsGs1NDPyPmuQkdmj22F8yCWt0Hzb0ikEUP1GCAFKcWMnN1eCBG7+rhHmg\n4XhKwuzgQ69U7bbYY6yKmY/BmuSgqVI+Nt3pB1msOvAMuRzMu17pGWnXW4Za\nfE2s5a9Ft+WumC+MIBncdA+TuCHI2KAFp9QCR01ruz65cgu6hNmGWhReLv6j\nIZvR8XF8xL0lQjCXdBlfaQtuiOFA+eJTCAKha/9nmrFiMO9jxNbNrFULSsdA\nh8S8JEeuK6DU7b8FeGz5av5iWuzuHPHKWlYPJe048wo/+1QI6f2445BSaC5C\n9kkGOcYCQBoFTicgVZ5sLo7Uoov78FSyTNnFjj4y0PkKxun7Fev6a0ASWcWS\nGTa07Aqgn6md3jOccjc+Ak9vmxc/s3gjMo5N69GDJ4lq4C1xJo2NUhcs7U1f\ndUKrzRlu+h6W+4R4p2hV9ta8tD3+TwbvsHWNVirc+vMayWzn8meNR1qB5BIt\n21V8lDw4zBYEUyzqsr1OSFgodz6E96ROPIrhBkVZYGl+NssPXS1OOowcHK5l\nZpQ4/k2eNJTp+Jt83S+19P0VWCOIwY6tS9IEG1F7t6WWpQjXSYcNW/5slfwg\nNZlI\r\n=WoxM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHeJmhRSoh1+WCXxrrG7WyssKZzAoQ7YMfhzk1dNO09lAiEAkHStvibnslKiLQEgMm21zcmr99kvsoRwSUZemLoOu6s="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.98adb08.0_1562623395429_0.31887386073658885"},"_hasShrinkwrap":false},"0.0.0-canary.016f954.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.016f954.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.016f954.0","fusion-plugin-react-redux":"0.0.0-canary.016f954.0","fusion-plugin-universal-events":"0.0.0-canary.016f954.0","fusion-test-utils":"0.0.0-canary.016f954.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.016f954.0","fusion-plugin-universal-events":"0.0.0-canary.016f954.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.016f954.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.016f954.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-wHKZ2FFGpH30mrW+yJhE9+Cmxuz6tP1urJP8wY1J5vA+RbOhi+ZMFXBqMapSbWhLKmCz558O6+NFuUwnDE2dRw==","shasum":"c3b57d71dd2cbea11a3a64bc4103d14992b9dcd5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.016f954.0.tgz","fileCount":17,"unpackedSize":41722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdI+DTCRA9TVsSAnZWagAAnpAQAI4E4ce0tdjUmsLaiajd\nUQddDCsVcUlXDqPauNsd/d513EgMKbIvzJmES16/zHws+LqVamr/TDQKxnwe\nXVPFs43cU2KHfuxDh7mmkiEILOsXM1JR00gWnCSLfIZQqAhKiZj/x+fH6uDo\n7efQzAQQtn8+KQySmdg4VhRvt0vLP1N5+F9scv8zehA5QH3TbiKtNxQgMcvW\nSjY4P/CoraPukAd+BecI/87eKmyoBepIrIFaEXZW5+sn7aqs+/eFaxOyXsEF\nEqmbfljBNSaiQHH1GxxwVO1dmE5YFZhWLNWvus7E3XLDIs2hrcnUbW0tiFvm\nbbtGEikgQF68q4NE4V4JgPQA9a9L4P/THoB9/PjEeb3A8wIYJmvmx8Vrvvb8\n+n0mmS98ra1X9gRn0RiI5owwe7T11luCggbiIi2sUQC0ljrrjmuZt1cYctrA\n+GW2rIUQESmRZZfDCtGoE9DtSisfAFqyweq2DuGyScuPOO2bgoG+TTzCHs4J\ng/YceyafNvD5h4/yE8aLXAlKn9Bh9XbDsDDo7uyWLFI8uNqKYDTVLRL5wV2I\nIpLrqlTpjB0AG3Ff0N0CzrH+6FlXxGSxMmK/zxmwTkPFFagky0KyNnapHqaX\nexvRySSEtgeU1ero5dhhrM8qdNX3JV6sY/eHolswrATrQ6Z3XoqK6itCgDbN\npm9/\r\n=KX/q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICjDSiL021mWL79694TmqKYFXmS5nDL4H/PncsjTPbgvAiEAmMtDMRf8AZjj7nzp60hlrNy5cMC4N3/iruZ0TbN/hKk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.016f954.0_1562632402998_0.9904212375017818"},"_hasShrinkwrap":false},"0.0.0-canary.1ddabc1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1ddabc1.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.1ddabc1.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.1ddabc1.0","fusion-plugin-react-redux":"0.0.0-canary.1ddabc1.0","fusion-plugin-universal-events":"0.0.0-canary.1ddabc1.0","fusion-test-utils":"0.0.0-canary.1ddabc1.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.1ddabc1.0","fusion-plugin-universal-events":"0.0.0-canary.1ddabc1.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1ddabc1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1ddabc1.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-kBZrvshs3hnejis2WFQsxkdnIxvq/rnOPeqhSzkBrP2B6mSKjR/G7EyaRaoB0Jtzrp4QGVxRK8hsBfP5KjROdg==","shasum":"7cfa7f70e0a6742f90b9a851f6e0dbd2ee475c51","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1ddabc1.0.tgz","fileCount":17,"unpackedSize":41739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJNsnCRA9TVsSAnZWagAA+qsP/iEFzzPkhxzjlLWTuW9q\nmDMy6m24zg0ODJa+UU7A83ZHwa+82v6vFsBZDFu80ukDXqcORDJCfyF/vI+M\nhVHCcVzG2mJBjcsM0HYEDS/1Ikx7FlIRSEu7VDAVdelwUYbMjlqAR3BkrjV6\ndCt0uIu/IC4vWhgRv6SSZ4kuLP/a/WCBkjAItLGBNaby0KVm07DZrBIKdfBa\nFnTAvBKcJm3q7dlVXkmmurZFxXFwqABon0/mca/UR0Dx8qDmwZMlGO3YA5fU\nyaAmuw5umdcf8k0qeC3rY5zcrEQ/peUIKIUXCbddUblv/Xznx5NtLQ0CLnQu\noNogFXOZ5VU8SGII73tDC+t+LoQ33QQkq/63juHFQrjNaPS5VAHgBAIaXb9Y\nQ2zEUaaErgxL/JRrGoDG6d0NwCWyK+l+XjiLZf7ZcKo81ASYGu79BgHZA53W\nhahFiyeRKKXH0Tc8BVzmrQmNDYR4u5NyEaw6CwhPHd5BoQoPPmYVZZczKFwy\ne1mFwJ2C7jfigpsILi2oPG2w9nUs5JLBYhpx24nosqR5zbupA6dPcy1hJnUR\nqrepc2Rk/m9aW3rJlp32ev0QD6Jb7op9PbPdJRx68eK0DLrkhc7hda4x00S9\nEbJhWxk+ONNzJ7QH5hxWaWUHCYj/ZnAawiG1ND1ovj+EsWoSQp+Zubk9eZco\naPRi\r\n=QEJc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqwmCnusxZL0+K+7+SILeSjVVW7fA6EhMlt5PrRKSGPAIhAMK5OZn40jLcsquE+wXmxFqjgPLqRH5qKaAAc8ziRjQI"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1ddabc1.0_1562696486710_0.8163641998301294"},"_hasShrinkwrap":false},"0.0.0-canary.1ddabc1.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1ddabc1.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.1ddabc1.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.1ddabc1.1","fusion-plugin-react-redux":"0.0.0-canary.1ddabc1.1","fusion-plugin-universal-events":"0.0.0-canary.1ddabc1.1","fusion-test-utils":"0.0.0-canary.1ddabc1.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.1ddabc1.1","fusion-plugin-universal-events":"0.0.0-canary.1ddabc1.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1ddabc1.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1ddabc1.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-AgHCmLKLLI+jpY+KNQRTyKYgDxIMli3xnBm6lAEQ4XJEiQ+l5myAxpaqbQg4AYCGWlBhhSvn/javlJ0Jlt2WqA==","shasum":"b4a3088077a55c1a89caa442efcd6b2303a53b6a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1ddabc1.1.tgz","fileCount":17,"unpackedSize":41739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJNv7CRA9TVsSAnZWagAACBIP/RK/h2dGLhEjQkz3XCO0\n7r9AVBlKDbSTyoUzx4IODUt7hK2My0JMDvKfcVrxzTEwYBHoW4ySJ8YuKRTn\nLJYDnF1xm0YLWJva3VUCm+QoqvA0zbHs5gVGgno4G2pJ/crRxMR9QBlChr+U\nT4BvA+tS9Drhc6gxh7HKFfKALewA0lapKFllDgT96E1SqGmv4I0HxKyLgllT\nUvhwKfYnkABJ10odBwuSETJFUIMg9s4T+bBANWUpe7OUVvu8+AVs7LXeMIdZ\no3SJqr5jpjsZvSFRevafATf4p9udoYT60qszoBWbdt+HuisvtxoB8uAL5Se/\nKuF49Jbk0voReA9TQ1GrRpk4WCLe8jehFtFhmwx3shOIvfHSKrG5/Nno6gSX\nJjMbwBZbBI+R7y//aScyB3y1UCSJfDXXkRK6PBk0bUklwCL26iQ9rvtynyNj\nE9qoqEivbTJLHV1pc0rI2NQWyoY/H2G9Cusb3MBGeXhGpXXFXGc1eYkC7YSp\nWcS1BCmYxSUexfwnXOdxdEwBn13nKx9cCVpA4AfUIduDM+ld0T+06kztl4mo\nAe05LI9rSBoW6gkv3XD88AwFedKDqky1Wwqp6KYC81S5V2GZGFIbgFm9n0bJ\nDUmBzFkRI+hSFKG6Oxasmucjjq50QLq3YJWD5uIiT+7J7RnYKbaPLPSOKHpB\na11A\r\n=B+sM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEp133xjAg4lON5Hds3Ii/1nK9gXQ6dOae2J4g9qRbR1AiEA8qsly1UENeIGBw96xHyXX/BN2VyTd6oQbzAS5wM/UbE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1ddabc1.1_1562696698647_0.8478683030597922"},"_hasShrinkwrap":false},"0.0.0-canary.40eb0a5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.40eb0a5.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.40eb0a5.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.40eb0a5.0","fusion-plugin-react-redux":"0.0.0-canary.40eb0a5.0","fusion-plugin-universal-events":"0.0.0-canary.40eb0a5.0","fusion-test-utils":"0.0.0-canary.40eb0a5.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.40eb0a5.0","fusion-plugin-universal-events":"0.0.0-canary.40eb0a5.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.40eb0a5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.40eb0a5.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-bMKMOtz086V41N93VoVpd+2rUwxYvt29dijRn/rSyJD9bmG5Hq7FiCkgQ3g3nWRLuUOn7Ll0zfOVl035FXx9Zw==","shasum":"74e1c51522187dd8ccdc339ab5714e161fb2a614","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.40eb0a5.0.tgz","fileCount":17,"unpackedSize":41739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJPMHCRA9TVsSAnZWagAA2t8P/07Cb+jo4jeD9kNkgd/F\noaPw6C6ppvXBUy1+gW3esE17KiG5uD9fkwBrbdQABdkPZ/7UKw3I4H6kVT3c\nufNQUdoFYK/sYLCAHWbEaOdgUSUHbAeSJHPx5Y0jZdtZ9DsVLofHreD4H7ml\ng1MYhxv0zKWBBjX+LdMmEpFr58BHjCqmejMAAvEQo0g8OgAPfksTAyZJvjpM\nA0LoX+l0rFew3p4XeQ/Y6d4PfpqA0Y6AMm61PX0gurwTUC7+dCoB4xGeQhxw\nbLc1SS++FLhnUR3WnfqB2IyhmraoOzEAy3I+9S0qXzZ+Puw1pCfIFBCQonn6\n1Qm7k0BC70THuq5jl92M2PkRLGtBotkALkH70a00/TfMwCi1EqHwdbORdy0l\nC/yj2OLJSWkW4Im8ekfajHvshar2ylGGdy7Ix9aJtcYNFwaompASgq/D9O9e\ng/U4OLkp9fQSalTCUSGvg4Yuj3K1tjGHKS4fuTffCesK4VP6mKUJF0OsZ2mj\nAco9zFMFVnAWPTZ1866Mopw4zyzVs9dmBoX1nwPxubLgTRRftAWxS/HFopNh\nFfv4Ohhluxj8sPeMwSROR/sUHfhg8crdX7ymKnvyIHDvak9DCqbUNjYQVMqX\nFKLXDDV42zdOqR/QB+dD8m0b9lTpQSWxihCLpu1FTSAahGNN/+nHpr7+ieGp\nBXW9\r\n=gfCU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBWcL/U3AYqkikLTmEC7YQlWXBQVIsjEW1BuCuhQ8nmSAiEA4vTM8+rOcA5jb/ai8EtvgeT3dyc++sO4THn/HWUWvD0="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.40eb0a5.0_1562702599264_0.7768604897778695"},"_hasShrinkwrap":false},"0.0.0-canary.40eb0a5.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.40eb0a5.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.40eb0a5.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.40eb0a5.1","fusion-plugin-react-redux":"0.0.0-canary.40eb0a5.1","fusion-plugin-universal-events":"0.0.0-canary.40eb0a5.1","fusion-test-utils":"0.0.0-canary.40eb0a5.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.40eb0a5.1","fusion-plugin-universal-events":"0.0.0-canary.40eb0a5.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.40eb0a5.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.40eb0a5.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-UvWGO2jCutOC/a5K0j4aYs5KvDSs4WUjor9DijWMiZZCaIRUu9O7QmI9fI1SrIjUJNMmVnEi7DKLnuaGLYzkQA==","shasum":"9b72216b60f79147f0938906bc9bc37506b96cc0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.40eb0a5.1.tgz","fileCount":17,"unpackedSize":41739,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJPPgCRA9TVsSAnZWagAAzlsP/3VPDr/YSL/fF2eclp/n\nlvuy5Nowd/5eMMgeBmQCGI6C53oviZPa8eTmIuiN9i0cQ20xQOF4NkAWISms\n3se469k/WKmU9zGwCXLMw9Whuxf6KJbhDcQEdDJd32Pt1/DLMZbtYIpOe5oT\nBhwV5oeITvHjt4UkGlJmzWKUNwxEUet5ueKIIZ+9vee3xhowzI9S4XqMkIUA\n0WNN4j+s0X84lw6LX9Hg6BCCCe6X/TF2a3dxuTLI949cniXZdo1vPrmJEwoE\nJPdNqtCqPohLUcm/YJDdDSYr+f1+kkAFs6uPPGDr6feTnbXyTIcg3sEw0HKY\n2ofANOEAcFi/8QihcGJptSJA72BcuHEstmOfAxqjftdPhH2YcCH8NpXwcT2U\nCTE+YBZAlVDVEB7MBxjGb4mnmLDuXqAgY1CcUl2fvavVbTj7/uXx8xKtTdaB\nGdya6xVF0xwdlsC647Vhh3D12gOeUh7Xcb17LoGr7BVY5psI8fK0yQZiPiYD\nDBMvngMsbOb/XSfgj6vGK9L5mO9AO48TCgEYa4idg+Qbu64MUXHrbeOt3df/\nMbJZQc93Pa4AkytJ+++8rabF2huj7TPafnyoN8CYp/dqbtvfR6A4rZ6/dDJv\nat0m+n3ds3/xdr3whi8CRRnAWKizyIlbugTinEogHqLJdj66gzYuePZM1J4N\nspIh\r\n=511+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdI6m8pZ/bxAnYGZ4FtQLoSUPvUgJyHfsItnPH6R9yZgIgDnVepQ0dPH00gHzAy5U6wkR+NguiyaKD9J4MvoyieTE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.40eb0a5.1_1562702816428_0.6040000475168925"},"_hasShrinkwrap":false},"0.0.0-canary.fbfd207.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fbfd207.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"6.0.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.98.1","fusion-core":"0.0.0-canary.fbfd207.0","fusion-plugin-react-redux":"0.0.0-canary.fbfd207.0","fusion-plugin-universal-events":"0.0.0-canary.fbfd207.0","fusion-test-utils":"0.0.0-canary.fbfd207.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^5.1.1","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.fbfd207.0","fusion-plugin-universal-events":"0.0.0-canary.fbfd207.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fbfd207.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fbfd207.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-7QqTvJ1JSzSX9WfOvC3QIe10MK77/lW3dtqtF/AJr1F7y9nGf3SYUO+wmcd4GD7mkhIFTKU1flaU6YuR0EyCGg==","shasum":"8116b872d6dbb259cedc1eec966c20674b8fb676","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fbfd207.0.tgz","fileCount":17,"unpackedSize":41722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJi2mCRA9TVsSAnZWagAABWkP/36UL+R8DRY+vOUjkCAP\nIE3spC9TUmNgkh7+En3Y33D9OoG33KwLs6E7z8Wz3Nj016KhGUEFttB1/pi+\nrdj8o3Y0B+upbLcEuIhLfjqTQe8fheeR73twv9VLzJKPYGU08gUtwf8Nobpd\n3VfC5rUNVBHFayLy85Ub7PuSTyzH0saDYQB0LLQUk56W+Xlbf0ulY6v5NtsW\nGF/W87/xr80bp/5wlvxR4ggaIFtZL3hqB5NNNd9ZNHM2aEk53RFQMjbtFsl5\nwAPFQ3BAb5HIXJlhLcNJ5s1MYMy0pZjhP55ykxlXFB3bE11IcgItuX/llqfb\nsPH7khf2EGn0fbPCXo6qZlmWgH0/2vNlgSac1hKZumVQtAdt8EAL19/WrMZ1\nAQkVgHJD5V5DHP3HrX/+sPLvXAQ5nB3UxvXvLGDXdNKygQ44t5crTsxNkn2O\n+LWdbx8WGpW64V4H3uCmPFr/7gSNuurBK60YlTQohhVoFYF8pShzPdEqaTLB\nNNxedVP1t2YXLrqPxeDgA2jdY3AR96beaoLXBzCsQB+dt0RiNyX4yJBVxZWj\nLcqajAg8uKT2xDLYqovZyjjzv57x2Jw38dw23Gl/VRRue90SsmPCLfmcezcy\njOWYL5EmHBuxH0Z6Cp2gaVVOdluHPU543uqIgyWY0sVssyoVvNZFQv3eJ0zG\nytrg\r\n=OuI2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDkguMbU2iuLaolvuAZc10xdSwBXfLaDMIlIHOYhD4CrAiBZRwGUwRF/77SN7s+HLRwqCQfrSfJwczv/3qdE6FNLwA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fbfd207.0_1562783141674_0.2298748416722356"},"_hasShrinkwrap":false},"0.0.0-canary.4c30d33.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4c30d33.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.4c30d33.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.4c30d33.0","fusion-plugin-react-redux":"0.0.0-canary.4c30d33.0","fusion-plugin-universal-events":"0.0.0-canary.4c30d33.0","fusion-test-utils":"0.0.0-canary.4c30d33.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.4c30d33.0","fusion-plugin-universal-events":"0.0.0-canary.4c30d33.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4c30d33.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4c30d33.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-d2pEcQIU8yT5/Ps2xSeIKpLtcD99D+JzLxlDNCu2eveohc8ylqVu7xj8uf4h6LXttXBcMxfg1BMLJXjey+Y1zw==","shasum":"e0cb9a5696eaaac6987264ea18f1bf89b3bb4d2b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4c30d33.0.tgz","fileCount":17,"unpackedSize":41668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJlOnCRA9TVsSAnZWagAAKRAP/iFAB/982b0te9BvtMOs\nk5fbjbsh2Iyigr0FMTzlbbwKMBwCnhgjDGQOtb8QG9fDvikCCOsfLJp9BOFg\nn0sHC3z6UBidxDE4musS/Fa1FJIlbL9pJYj9GNvlprTnO7O3KDXM/XaLQJ/J\nhXv5HyndQH3EAfoSCljVqkGyIZGOSUVw/j287YC5nXiJbcMMNn5HsDX7DJtS\nC7B/wfe/9Fp/gXarnzLXhtaSfyJ9CLRxl/s29DPE+sB6N5wXP/0t4jVNciZu\nvm1R2hgSHIlPWwy7ozSIed+Vjv90G54EmZTb8K2Se2DK2s5hX4Zb3QTd2E7t\nU1bODNo8KQtXNF+U8tPp75QVnQzKImWYtH168R8jbKp74v1roxRczeuVQG6u\nv5CTLP5OOkfHARTAph1OZFPuLT6jQK6Jw+itg7yXgLxcK+zM0SuaAsjtYBi0\nJuVWzk2wm8pw5PZvoQGH3FWGab602kXUkdIQroanebQW9p8Aa7ME9ZHtgt14\nrHxYCpirl7Bjo52wXmx0KyacUGCdXTVLqg6ERzzy8NzU7gSJdHavF19St57m\nmNglxO0+I3w84Uc+oNVGAUzjiph2q0HqxXk+TzpeJ7/0/D1h9cwMMdxrviwR\nR4z7if6+Bk6kJo21AdjJPMwUFdBHhZwXRYXL91uMetS/jt+uquFBAW+3sg4a\ngQJT\r\n=d4C+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHE25w9DB2BpHPV99phzmGrhcuSTa7KIzcsBSo/kx3AnAiAtAtXZG5U+aV7zDASGhj2cokAa/ZRlYL3oYqOeClm/YA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4c30d33.0_1562792870768_0.8874821779167481"},"_hasShrinkwrap":false},"0.0.0-canary.4cb9c2b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4cb9c2b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.4cb9c2b.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.4cb9c2b.0","fusion-plugin-react-redux":"0.0.0-canary.4cb9c2b.0","fusion-plugin-universal-events":"0.0.0-canary.4cb9c2b.0","fusion-test-utils":"0.0.0-canary.4cb9c2b.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.4cb9c2b.0","fusion-plugin-universal-events":"0.0.0-canary.4cb9c2b.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4cb9c2b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4cb9c2b.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-2dknzPkmvyT+rTjx2ROXpnWUk00z1gREIgaY81F9QPvh3iERefLijMEDGbVtE9J+qReqY2pRT9nZszCVJpF2dA==","shasum":"9d7074832cb8e19501b94d037eb041e26072ca1c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4cb9c2b.0.tgz","fileCount":17,"unpackedSize":41668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJ23+CRA9TVsSAnZWagAA2AYP/0DS9UDJRMLyOCyEmZMs\nifgYmlInPKgaW8mlDHN38Ek98EDO+7JfjN95Y254bmkG9twmIDuPm+nVKYr3\n660H3LzCx0psNYIBR+819AdxpxvlOeo5l4WpEfwDUV2mPADkT39x01JCXmhH\nvOl2DXqii57/A0Eh+6jnZe0BC2/S/kR/2hR1l+3KW271QPFAjE4JLEuizdGv\nwvOhA7eOi11BfhY82pflbbXbpFBc0kkvY+fJuO3k23IQUWtijPKdM1TvgwZj\n18UM2uJI46/uGuvPVxByvG4w7hcKBGrRxTqoKoRzeftC/xz0s8F9Yy7sBE4d\nW0vgKKlUWG4VpAHTIFTdLXsuwnRcK/RvVYGuk3MWeTX71ebziCTvKABbKOSn\niNcZrnznyTVY2P1HlJiaGs+OmOUz52WZ47MBiudpE70BqindfFDwHZmcTr0D\nBZu9m2qrUDgSsdgmDQgtCSu+HqXGAgrFinHbDLisv6iWCip4KhLDc1De2IJW\n5vLXWPOan4+D8XA5OCVkn5Pdfctzh/Kx2lgcfjuO01gpu4GztA0pyDzf2Ao0\ne9HLyq7iP33AdCcOGc2JjEmdzAPPDnh8WedIj96tHbosTctfYFpXUWzV4DAH\n2l2kzymQN4IEbBoW6Q26A/in6DfxDxsRzGVm7j4P2bp+BBZ8n76S3tj7wYQl\nk1r0\r\n=5Ykx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFN8FbmMhXNJSwiarcFn7KZxzaOGc/23aPB+9p1cbQmkAiEA9ecZpuYFFG8imtNmeqOpljuinzegWhAbtOcsF7h8qZo="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4cb9c2b.0_1562865150148_0.9070478540029991"},"_hasShrinkwrap":false},"0.0.0-canary.b0e5994.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b0e5994.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.b0e5994.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.b0e5994.0","fusion-plugin-react-redux":"0.0.0-canary.b0e5994.0","fusion-plugin-universal-events":"0.0.0-canary.b0e5994.0","fusion-test-utils":"0.0.0-canary.b0e5994.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b0e5994.0","fusion-plugin-universal-events":"0.0.0-canary.b0e5994.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b0e5994.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b0e5994.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-LZlX9Y3Av+3teBdbhTXO1wuvwOOpNlo9udgDs7y0azlbmHVLe5rKLS8uE21EXjpubUFIWA1+zCHguC/EwJeDNQ==","shasum":"11153a023d6dcd83dc8d038b9045a4749529f0d8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b0e5994.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJ8T5CRA9TVsSAnZWagAAKIQP/RdPbntaC5ueAhmU8wyu\nGD2Btg5PCh2cjNs0rtFBHNq+SzFDfEmz9xjThMv4VphQoFNfojaa4+bbq+jh\nRRlDwL8D1uVua2nLS81tjpL3VwsuwJhgt6LxYfgfBC5Ci9xQiwh3bQWqC4FU\ndEfte48zcfV2GTf7K5lMQrZ7AjOYOQNg7jMMUxetejBZGeOE5xwAFfhPOsdF\nKzZaEBo9NSsI3De42DjSEvBa51wU51qDFFwQzf7SJqYnYda33+QGrnvZSX08\noz5+VrVve2MaHM78fJ7VDrbp5TmKt/JIhe9/YdxgO31vf5Ggm83cWirWtCuL\nX44EwRMx9/o+lJHYmxhE5ImCseAxHMzvJbrA2AFnGAT9spbDwuuW0q23HTBR\nID9zDjhOLGAV1OY3dNcuWmyfEaKnUnMgtmgMfBAXkTndbLf0B6SzgsFK/tlb\naHj4ib+XQlg0BrvcDQsWkYWocVtGqWEgLWZudk0jIabh/jgBevGRZA8xKBdc\nJenckCPrk1yRG1NDjHrmNVhjXrlH90eKl/r0Sp2B1bYfKWE1f2rsgBj8UD59\nO2r/snG5/YpnvvJ4v9GqiepCU7Cb7wMqV6iGDDcZIZlhJnUVVRAQPCgMcsjc\nS+WnBQ/00yaf0K3+tVPWd8YfH1w/kHc3v7Ivul1kd0ojBUEEjQSqWAEdyp0m\nQXYU\r\n=K4zg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICYqWEV1R7gyDCAS4+VzoWO3KxrNVDHI4++ChZ+hx128AiEAplZi/ysd8GL9fHIxcJz0VHYpIZ1OPq1l6GGBfexxUs4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b0e5994.0_1562887416221_0.42332593019693543"},"_hasShrinkwrap":false},"0.0.0-canary.50aa07c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.50aa07c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.50aa07c.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.50aa07c.0","fusion-plugin-react-redux":"0.0.0-canary.50aa07c.0","fusion-plugin-universal-events":"0.0.0-canary.50aa07c.0","fusion-test-utils":"0.0.0-canary.50aa07c.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.50aa07c.0","fusion-plugin-universal-events":"0.0.0-canary.50aa07c.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.50aa07c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.50aa07c.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-UHyk/A5FWLZRdz+uy6In1CT8RCtVGZSYvbwuo9KvqzhhQ/ZvvwAoh8eMZQ2xiNld+P5nJwC5St+f+UiZpKr4yg==","shasum":"3c8752442055aa7db0e31e6dcfcf49f29efbb8d9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.50aa07c.0.tgz","fileCount":17,"unpackedSize":41668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKLKaCRA9TVsSAnZWagAA2GIQAIwF8c0hhSZ2sTEZme2R\ndOTImQrUwfRTkteweoUI/VcYHjAspWk1fqXKm2mkCedhXQnvpq9iruEPb5SD\nxjUP8vJBmSQ1mtQ9Hb8vbAkoxJSCKJRC9VVIb3kAHBlaR1Gp6u0GvdRNSqwf\nWwij8dJnIrmCBL4h6dY3fK8LrEKjkUFZixaOXnXubhhVFH7whJ06DIiiwakf\nlXwcEJzmjIcUoICwEQVAZJC+oEgwUjsSo9jXCxXbn6T0svYTgoZE04Y4bbY/\nNWo7w1mtCjRVpTo39zWYyKmdgYXR9WvgrcqU2qqhhS8yw8HHf3ud4xQ//S7H\nBHWLbFPAmo+ueSYfqrei+SiqrVM0egjjZ8N7iRqm5qFEDFnoJwSY6f0Gvmke\nE/gMmXmFy6gKVihuzcdGGL2gkV0nBUjPplyIaWaCjp+aY74WncJDIRzY1P6h\n2QuBfC9Z9RiRl1QklKbKFs8yhC+PUJAg7WJIqf5c9+ohx84uVL+pKXf9NxPA\nnB9dnVYj7UYSIHqitq35GZIE2dameRoHczb/9+GozNhY/DtaNNiN6ii+NWiS\nqP82Kq6FvBXAujVaMasl+qSSVFgQtc+hTzoEWihstDjFVYrEdDxEi5f6Gcr/\nQxY4XNmDBr5BNf25GoeYA6J9olLf7bmvFNgCWtgh4RhQ5/gyLooKP9qZ1Wxm\nwB1G\r\n=Nn0L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBurFmB21lLEiD941x2m873q6ssWgPYIJYVHB2PsgdYHAiAKX7huCdX528DvG792N7erNR0o7xyk9TM2MrgzELJAFQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.50aa07c.0_1562948249939_0.18009432646148094"},"_hasShrinkwrap":false},"0.0.0-canary.0a4669b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0a4669b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.0a4669b.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.0a4669b.0","fusion-plugin-react-redux":"0.0.0-canary.0a4669b.0","fusion-plugin-universal-events":"0.0.0-canary.0a4669b.0","fusion-test-utils":"0.0.0-canary.0a4669b.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.0a4669b.0","fusion-plugin-universal-events":"0.0.0-canary.0a4669b.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0a4669b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0a4669b.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-j8pMjMPK8sfw/5BDoJwR9kvdQl2esk66YsHavgFrjHsE5OVd7jz1TjHIwYgmzGh36qF+J9hnLh6FD1qn3HxHDQ==","shasum":"72c3ba12aa630aa9b3e02dc75fb012176de12efd","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0a4669b.0.tgz","fileCount":17,"unpackedSize":41668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKOUQCRA9TVsSAnZWagAATS4P/1hNwhi+u+nxBg4yPgCK\nP8byroyEktKNqBk/zF0+ejr/9IOwTL4+3aOP5cmbGSV820wRZH2x+WoztgeX\n6pRzdSsmbPSgCBBmkVV1SWI/pXnI8VzvBXUW4n336jINwOpk1RcheaQuPl47\nMK7AlYH6qCoKMnsVlOXJZ0baF2hpenIHO68cb33kLFbLKrKYnvvnwNkjGWdd\nsWS/BejTp461INGxV9lBa6uagTFafitTe6NB+lAEHT/nUHaJjH1FPDP1xajz\neGYNhtMXwJ1d1Zob6DyI9WY/4v22eCHeWYTubkdFqyek/kcnQMgmsWZUdY5S\n2Wu1al83yA0YSNawF6hxmeqn6aFz+qHhPtuzlgrrVptEPo6uhoS6iCna/aGE\n6YuZs7WM0o3hSsct9N53LJGzf7caBSwa4FnuZ2r3gPjqDhO5AqpmDMJ3UtcC\niz8gVxFD90ToTLr9bbABP9NUruByX0XPApbSLGOZIGuYhh0HmQqnSW86m08r\norFPcANyVaL9RgBKTCYzcZREywU5c+bDiyoiBy/qgvYy2OoxiOzDW0NHx+aD\nL+V+rJA9up8tRs0FgRP1JvGOvK7URAlsY41PSzSgfJXZKu1oMC+OzpMtO5m+\naF9Kmi7xZpAHN9jBLBXamlqN7szeNeetW5T138xx3HKIt/VT33Vv8XdhAGTv\n/B2X\r\n=yKT0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYReDweZVAQgUqLsmSXBR4u6XH+MEHYdB/ysaDuyprJgIgQSVPXUIAOgwwR/kZ8duLwPtfmNH3ut3Sxpe50qAUNyg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0a4669b.0_1562961168155_0.45498600665998445"},"_hasShrinkwrap":false},"0.0.0-canary.0a4669b.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0a4669b.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.0a4669b.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.0a4669b.1","fusion-plugin-react-redux":"0.0.0-canary.0a4669b.1","fusion-plugin-universal-events":"0.0.0-canary.0a4669b.1","fusion-test-utils":"0.0.0-canary.0a4669b.1","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.0a4669b.1","fusion-plugin-universal-events":"0.0.0-canary.0a4669b.1"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0a4669b.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0a4669b.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-k1M7PHTqM40hebGrM3ZsBN7fYt3Pv4RPsic6ruTGk6gaSUHtpk3972rBWqqUE/fa5hy+q+mkQokKkzvwDKNmKA==","shasum":"a9352106e9b08e379af2c7e9ba778ab7ad8352c9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0a4669b.1.tgz","fileCount":17,"unpackedSize":41668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKOomCRA9TVsSAnZWagAAZQwP/1qu32igN6p8KyOTU9F9\nw9MpVSMZ3Szj+yjlhJzOI6SiKTKGO6wCtJDrqcSQcd3ATWg38oQlli1GXo9Y\nFKm8eMS2zIOAMjS838Hkl3Ba8hUZzHzsw5vXQvpnXtz2VY0Akqnz/6O23Vmh\nqhKdr60Hq9M79wpIWYr90IesdMyLkHBe37Af/XPaMLF2olydIsA3msiDyMUV\nbegYAQXKWnVzUOeb+Hoa3fQSotq/LY6l4DOHh05Wowl5UW9wmfaL5yD6zMoQ\npR5iOg5+BEKHqwYw999uJB/3lMWmQS+1iRKFQywp9rbLYA3R9gJb2A4c1Skh\n8JWK6ru7ati7MEHWhldxaK+qhf5tzS5z+HJNEi2cB3bku3MK6fjg3jfkL2X9\nic80oAqi+OowpuzzknxhtpmPj4qc0PpfP4z/y0QcBJuQCarjXVIQBstxYd3t\nPJEm0SxsTnFWzMfjV1wWc73YTyuxF1zX+sdKFEit30SnSOhtEhXC2qnPbnDJ\nveAl4Cz2CxmlgDOGUPbqnFw0ePHrjCMogVrP/oalJv2WeN7ruhhWMJi6w7zd\njVzk1bovDkmSnKz+U3IyblBI7YWm22xxSzvKFV8e3VLHkjwgsxrNIoU9J/HZ\nfTS7ONo4PdR1As5hJIhDASAqkpMrzIIHOvq2+a6/t71GBi6s3y7ohUx33sLa\nmTOr\r\n=p8nk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBr/jwWmMdEZeuS9g4AsWC3XNtJJJJqH5m4J6+l89rHyAiAv4R6SyVER/dwvE+I5bcl49AyrDzfv1b32SEUfUfAJmA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0a4669b.1_1562962469606_0.6903620155431769"},"_hasShrinkwrap":false},"0.0.0-canary.3b5ed2f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3b5ed2f.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^5.16.0","eslint-config-fusion":"0.0.0-canary.3b5ed2f.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.8.1","eslint-plugin-import":"^2.17.2","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.13.0","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.3b5ed2f.0","fusion-plugin-react-redux":"0.0.0-canary.3b5ed2f.0","fusion-plugin-universal-events":"0.0.0-canary.3b5ed2f.0","fusion-test-utils":"0.0.0-canary.3b5ed2f.0","nyc":"^14.1.0","prettier":"^1.17.0","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3b5ed2f.0","fusion-plugin-universal-events":"0.0.0-canary.3b5ed2f.0"},"dependencies":{"eslint-plugin-jest":"^22.5.1"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3b5ed2f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3b5ed2f.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-BF3zRLk4AiZ4kRXHbzWhS2RE/9ds6Q1WPpQqkZgRbSXOWBxJjoUTbmweKsZpXBaHdQ6605tV4mcRa1j7G0Ar5g==","shasum":"10d3b235fd37d33bcef5c5a1fa72c28709dbb5b2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3b5ed2f.0.tgz","fileCount":17,"unpackedSize":41668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKPDgCRA9TVsSAnZWagAASvYP/3SHLlvoC18LE1pc24QZ\n3e2bkQqtI6GUILL1pdlO504i5INfbFxHeOWzdrjI4Xw1IZDcw/QRZI1k4zeL\nCpr6QH7vMyhBjXmUnxBElE9+yFzd/WpPTA7CUXOPXf+OLyO+AzlSFHq0uLOX\nb9LUi42zI1+ZJ5ExWTMRejidFJ2zMsFyCx3NlIE/3WZ0oVTmgVc06QCjwy3r\nZOno+KhpdTdUJp49xuDzas7DaY59cGCjJeD2dy5tcHkSVT29wk/Nke34ynLg\n/KD5JnrV/IlQ7oIac9SVoIypoCYgqHF23xj7UUfxfZlIEho8VBByVKS+gl7j\nuwbFhHaR/17AUQiLxw2leI3DiiP7kR9Jld7rl4y4VlEICGXmGiJgAI19jOgP\nJ7MK0qvOutidcwOcBTBs2YKK+MfvhLLrQs5K9YudgCyyyHDCzuZ9zVsZM93W\n5HlsZhO0rJ2ybNBfDsx3pyy5azoOzFP2iV3ipFFRYtRvYosRxXEbMVa3Qr1m\n5xQNOOE/DktO84LetWBbKiOsxQ2UOhWdaIomsUKHbC6g75FLxa/BqIecJ1wI\nwHjpgi295QhvmKqPRY8oOQxg6CRDkvln8qpJIne5+N3xze5636pMk1WAtDiJ\nXGcFHw1lubgDkiCUuJtVN3lUwxSsyPQNolRjaogZaIUUJVoKieO2OsPEwP/e\ndQ9L\r\n=McSw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1Wd/RQHBKj1ryE/n1Rg9hp4yNBc1Gic3owUle3YPQYQIhAPq5V9se90N2ETF9y1dGKxLyNBjJFvyTTNCXtDHkweTJ"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3b5ed2f.0_1562964192224_0.9844903875910986"},"_hasShrinkwrap":false},"0.0.0-canary.db655de.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.db655de.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.db655de.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.db655de.1","fusion-plugin-react-redux":"0.0.0-canary.db655de.1","fusion-plugin-universal-events":"0.0.0-canary.db655de.1","fusion-test-utils":"0.0.0-canary.db655de.1","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.db655de.1","fusion-plugin-universal-events":"0.0.0-canary.db655de.1"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.db655de.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.db655de.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9YUNhg7Tf4l7+GjHDef7fQrrZ17VvaeQs1RkInPDsfsccdxj2sOK0Ml3CGOTKmVW4OR6NovZWzJDOtzHmdgwVw==","shasum":"e7d71f91cec550cf99de3f8e49de97f3ab7cabdb","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.db655de.1.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLSMJCRA9TVsSAnZWagAAGdUP/2VY7sD4Sqmy+iRP7c1g\n41FwSQLMxAasE7TqMXzAflvGVB8cDPjFf6Yqew1p4WJklPF30WYTsvewBN9w\nvtiyDKB/u7DsKfvCCUteSUYSLA0XgjGK3C1NVroDPD7vu07UlZvNSdQwmBCF\nQKOROkXNgqTy0ke28m/OvWRBR/o4V8uZTnSfx6D3jsyy8DzDxPojoVjjwA8P\npgQLkPEHG+BQ7hD+El1SQGGAGZxO/l1SGo6RPTMShUeFioocUCStr/uSXPv3\nzJcJwsAUCZ0RthJ8h8rTJzNXuKwuo/uUm0H/o3wqb8v6DpM/neKuHWdvXF3S\nYUkwL7grkZ/9RyBVj1ejDx32b+41bGUe6kzq2d/4xdjiA4fw6KJJTGX4W9Tg\nMkkXIrlps5GVKHO1DibtwpI6duBfg/S0ccTaLBvc4fnp7iJxEFxJPXWM+0kB\ntbKgLTehWXzDLIdy0kvGpJ8Z6gRU69QS9YABtDoAHetSX5DNUK0q8MmOFQPb\n9u+EZL9mHHNJgnjVKFvPfefPQoVTlB35/msVW775tyF0hK3x02IwnAgZK31c\n3dPEtwysZ/tqdLioxhyyoBdEkaniPExDV8uc9xAwNLyyqPoixihhQB7m6BdZ\nsk90kpSycLneUXaIPokztDd7uoazOZCSV+MsHAnldqbTN/QaPwK+M17eJ2x6\njRqU\r\n=Nsq/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBtUfPAX1mrPV7MTwDmSqDGfcgNA3K6+e/2cRIkweFz7AiEAmuOIBpKqF+8Hg3vPmpTlCy+0gdycS3kVxpBMkBBIz3Y="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.db655de.1_1563239176572_0.6090685853681665"},"_hasShrinkwrap":false},"0.0.0-canary.396f8bb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.396f8bb.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.396f8bb.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.396f8bb.0","fusion-plugin-react-redux":"0.0.0-canary.396f8bb.0","fusion-plugin-universal-events":"0.0.0-canary.396f8bb.0","fusion-test-utils":"0.0.0-canary.396f8bb.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.396f8bb.0","fusion-plugin-universal-events":"0.0.0-canary.396f8bb.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.396f8bb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.396f8bb.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ES203krDXEYIvZ7qKdR/5n2L1xTFZoLdJbu8e1u7ceXTf9cPsObWfdSkcdE75gjo0h1DEj/XXGyJ6l2fMZGa5A==","shasum":"f24451a3079aef652afe056547500344b4cfeeda","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.396f8bb.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLhQvCRA9TVsSAnZWagAARZYP/2UARcwTV6+zCgiE9V1c\npYKyWzs6qvIdsPGeFoSkLMwtvAfL/IVp2UZjHqtW12jJm3CFwGW+bE4qbBv2\nSu0exBvQKj7vnqhx4p7rQFjEKUnGJ6d4jtyQAYF//74vFx9sWoa4ZnjXNFHN\nT4t4rY8zkUpX53cnnHQuf8smC4iiq95yUQk8f/HcCt/7V4w7pBqiJux2Qshm\nbs/LIZhTxZyg5l925nnptUiMIOkdVUQOqQ3kweWdWiG4o6HACYQd517y4ZJr\n1n3rAULuC8Z8f+O/QeaFSublmJ2IZceIxDxaKc6VYz5mJMUsB+OgFcJS808N\npCDxevZGwbXA1Kal0bLiury8PvyP7bM8NGtoBwV6LrK+Nt5VjPYZnee3pfvb\nTDHM55RkJ424Rk0FEhR63JQSl+f/733CQ3cTCCKmrH+eEN7bYBFTu08upk58\ng6cM0mFzJljYgoTnpn6BPhCwOmTvhy2yQvmJGWPlJBJV/TWVKRIR9T7sdEjc\nWzVhIewzbTnteXHnMjYWeurPIGKNNZRUqPB2D4nUdxJqH2w/JGhTBmQH9d5j\nAyCZFJHLnHGPtSEIU2Rukz+s5o+xCW9ScwkBXo0i07ZbWHRSJXFqwgrmvw+U\n16+cDc1C7u9jDvFXhFquOuHKaaQ0T24nPalRVdmqf3r19Zz3b4O1rWjdHNUu\nbAQ5\r\n=LkGg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHCbDhhpdW98VBOTk28IbzfusZoshVWZsRMacUcwTDynAiEA3h/1nMk+poF7eI26YI2DcxGq2HZl2lY6GH2QJIAbfF0="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.396f8bb.0_1563300911076_0.012941217044790232"},"_hasShrinkwrap":false},"0.0.0-canary.66cfac0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.66cfac0.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.66cfac0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.66cfac0.0","fusion-plugin-react-redux":"0.0.0-canary.66cfac0.0","fusion-plugin-universal-events":"0.0.0-canary.66cfac0.0","fusion-test-utils":"0.0.0-canary.66cfac0.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.66cfac0.0","fusion-plugin-universal-events":"0.0.0-canary.66cfac0.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.66cfac0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.66cfac0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-gbB4MJIqUkJj8MzOji7ZUeFiMxhpO4soZVTOHw6GBK89H+qgaZH/A9ov2L2+ENK8y7PFoX+23eOzDZgO8ZZrRQ==","shasum":"6373667b1e1c1320ec85db25bfe47d7046270916","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.66cfac0.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLiAaCRA9TVsSAnZWagAAv0MP/2eVj91fEJZmCEK0NYQP\nadyZTD5fIR0T0w1Gpfe0suAWd79ervpMThkm/slBdJaYFpdDLRbTk5bOtvlg\n9DSrTgYtFyz37Rr9lXcVAExq8NyHEcj/hkHZl/RvZBGpteBotexRP5Yvpt7Y\nWk/umrffF9YVkX0it8WyS3aqXPATl2yznvqv/FmuFOgyfFr4vD85mFZqxvlv\nKDCUwovQr8rYVJiiX7wGBaqGqMPemOeFkTLsClTG8OwMSqL8jESai7jQgPsA\nQUjIMHY+fqjwERS7Ha3mkYrOoxkECcZJS+yqzAAlG9EL6TL+k9to1ynKM2Vu\nyt4/5SjtjOCAyrwLTUc7Bwtal8OQ5mh9Fm679y9IEueBm8G8SEmUwz+ghchx\nKKMygll+A4Vq4f6v3XWf2uSXNyrXKRt+ZoSqZhUHF36H1kek1cs2ohYsUXsx\n0iNOdLY9herv0Q17tSVRambsod6rT+fJP7TjV9SR0t0/Fhem0ASyQaWY1So1\nbzKarBs0JT9rTGZIQh7xXR0UFrT+w9AH0qrTkTOiw4Q84zsj3g+9e/Jl77bK\nlF0OZrlJX4O1YcTlQSgp8erxI2hWgkMayqX3nIJp2oJGNgRlkqp7NfXdXF6B\ngLL1fpkN0BN2eh3pyB+Juat5N5Fi9LmzF891xkVBLBM2GhvFis4yQLWuQftj\n9GAI\r\n=IUd9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCURdMYU2VTy7Z8+i2hePk1z3kcxjtRktIJlFcIs3suHAIgA/yeUaoQxD6ZYhxkfLmvqhA2fDQwFYNo5wap/wQcTUc="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.66cfac0.0_1563303962105_0.2986170567012918"},"_hasShrinkwrap":false},"0.0.0-canary.403f456.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.403f456.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.403f456.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.403f456.0","fusion-plugin-react-redux":"0.0.0-canary.403f456.0","fusion-plugin-universal-events":"0.0.0-canary.403f456.0","fusion-test-utils":"0.0.0-canary.403f456.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.403f456.0","fusion-plugin-universal-events":"0.0.0-canary.403f456.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.403f456.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.403f456.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-p7yBaot10NG+n2niWRKggeudkA0014QO/JMCEVIkxVyIQhOQn9j+QSHk/gP+ei3rg0H/w1D2fimbLvWgz3bHpg==","shasum":"8e2ac59dfdff610ed6633d287acbcb67141cbde9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.403f456.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLnGPCRA9TVsSAnZWagAAFpgP/jU4ZjL7DvXi6MWQsISh\nemcB1v9hA2DpG+NhqMPK+wn3UEXpwV2mZrTnZLdeTRm4UELd/WFkxrqoy13O\nEquK0JOWK/NvzFSoOHnouGX5evoLtDkLwKPWtNzCUzeS8Fv7Fz1rEIKX1TK+\n6ytIDSVGFh0BLbQPDXlea/9z7uKUvVY3BiMRyOsM7Psf4xEDLvWxas0bPI8F\nHjTat+Mtxs95Z/o0AKwviUMbvI7GUJP12/nrIzrUznj+8GhAZg6o0KW6Kzgz\nsYSP7+xQwOWlgOJEM501WV+oJAMTKpmqV1YMdZAOw3eHEJeGL+XkDCr7P0kH\n7bAdDZVbGk9y+gtkgZElNP6R0NxdZiPsVS5It5rt3Oec05vW15i+BpGoSma9\nkZSH2Fq9o/b/6+DU4DYFx753Ik5qd61rXzRlmHji/ExXfZfO166ecu1n4/eL\n/vptBvDKmQ9nwFWrQkzwors2yn++jRi0ttL3xeoUsr9BLgoZtrIQp+BYXXaX\nSMMt0kHDgoq/oQPf0xqifkCYDATG/OywgED5PsnQXaevFmswqwbN/zRSw3Le\nGQwe/2KjdVyBD28fKAtyqcG1h8+cV73bgcQvUhrWG4uVviZwX1sRBGd8s2RZ\ndjQ7gY6DVMTaV9F8iotT25sXv0fPCjvJfu0cWrZCDnpL7z/cs5O8RI6xuHzr\nv6hA\r\n=OiPn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDROnyK3buNvP+aXh5d0CoW+JEy2T0aZ9jzTzT5OtZP5QIgW5mipx3Q4BdMvBLSzsWB19V4DndiWyX/J049dunpGeY="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.403f456.0_1563324815018_0.8766143752262432"},"_hasShrinkwrap":false},"0.0.0-canary.ec8188c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ec8188c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.ec8188c.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.ec8188c.0","fusion-plugin-react-redux":"0.0.0-canary.ec8188c.0","fusion-plugin-universal-events":"0.0.0-canary.ec8188c.0","fusion-test-utils":"0.0.0-canary.ec8188c.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.ec8188c.0","fusion-plugin-universal-events":"0.0.0-canary.ec8188c.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ec8188c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ec8188c.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-8T0g3ogKVRIjUkypyW8q/kPt6w84LymMM2khTyodVdwCXi4VNmqGnzS8TLlqKpNFUHjDFBx3xsQ+lNU7irYkzw==","shasum":"663547654a800857045d371017f691d93d2a98fc","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ec8188c.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdL0QyCRA9TVsSAnZWagAAecgP/iNCG4rNWy6O0rKgwNRi\nQ5rcNrjpHLQMrNyP5Q1zF446BZiETPW4XEpWyKmTHdh0Vz4juOWc8ZkcYD4s\ne07Courn2RO/LIGIEdFbqYll9r5p3ybqUXCKmZ5gbR0+0NoosIKxzqZzyvtp\nNbMGANTjnyF2EmZw7SnTkrW5jf+MXU5Yfbr8zE34715WbQO5+dHrk1hOyT/o\nGuXoIvbDqVpFCcpIRkaG0Ik3tQMaCcfMexIH1xiwxy1WiI3lTTl6nOxFyUrf\nJTK6mQeNBi0WgUdkuXGH2Jf/Dw+vPYGbqrrkcF/hLO8sFoZfmCZxdIiqmu2L\nGA96QBMN7Vc8+WOJMNKJP9fjMS4UH5/IDIsw5/M7Y30w1Sa7qBOHkOlV5uVs\nbGnBCC4S0RLHzjG5YN3wRnWCahbjZHJt8k432RziYA4hidJRg/MD++vrD6pe\ngal36zhMyBkPNj0yMYd1BahI3ebu5JaXCHzPBmMep+GsOM7LogHLnbVPaEH7\n67LLX+4T7Uud0MjqJUUebDTQuP5m46eAAttuUjTgl9F8B+128l8DzwSbbDOE\n3UjtZEPHpUf1Ibqx1RtPbYPhXUJ/URGAqzMkz5Bd4X9OhkCmTWTobP+8HsLi\nHycQWnnJVRUBgaf7gevRUMn+2Sx+ZrtN+T44GGHuaaDHbM299q64DZReZfZ0\nk2ip\r\n=Nfys\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHNfYMoesBedNsUKEFNj5psBFKCmzHTsd5u/XoPjAyLtAiEA4QLzQXMpsjTn18YoG8/cQXltuw0h8s6/lFJS+l5+IZw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ec8188c.0_1563378737351_0.6289987802145132"},"_hasShrinkwrap":false},"0.0.0-canary.e9f07ef.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e9f07ef.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.e9f07ef.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.e9f07ef.0","fusion-plugin-react-redux":"0.0.0-canary.e9f07ef.0","fusion-plugin-universal-events":"0.0.0-canary.e9f07ef.0","fusion-test-utils":"0.0.0-canary.e9f07ef.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.e9f07ef.0","fusion-plugin-universal-events":"0.0.0-canary.e9f07ef.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e9f07ef.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e9f07ef.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-w7uB8TO3hm2uU0dBvDYOqswvqwP6M/0EhbrxSLP7QGPbTDrMzgDrdoX0Fs4b2HMjfTKqAlubHsm63kFsW0ZL8w==","shasum":"36e25863bc6a60273afeb751b990e65377a12a6e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e9f07ef.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNeqTCRA9TVsSAnZWagAAT/kP/jAy+Yv1meAzox7XY7op\nt4cWS81Zmn14HaTPGS4V3plHcMvsvWPKIh5AsB1OBr8q6Z/Idm9SVFVCnpMo\n4Rx672n5vjSdvKVw8+jV5mC/6FX5V7Q6ipYlVCjxKUfezsmUghx6dZvIybgy\nx3ziDGX5OUVITGxqm3K8KlYB4SFEm1h4xjPyOmfDga5jfIhgbKaA9iA3pRGs\nmlAJrECU85bcAGZ7hRFoMe7yhKOQUj7w4VrTdHhetPwz5DA6IJSu8hsnDzBf\ndsXU2UDKstnEWciJU0kfRfB5+NPidIgtWqleqRew6OkrdnLCpl0T13MnUJlx\n+IiqGuUPr5gUjVo3sDX0U017p6kTpfZHhpfFH69tljRXmCvFlOyUayrPw5sf\nOKb0freaz0JWdp+jz8sEddIu/PwEzqayMv5Rx2+EvyPhUqW3iKjMhMpA7vK8\nZDZMuwW6li0H7Efdy6bd2c35RfD3gSpDNjOPKVz0ZRzzB+xpNt5LtrkEZEtn\nrNWKS0yZohJSrGJ3n4RzUfO3xpWh3LfDnuUI9zDuCD5iGE5GxnuDtenf8Zgs\n99Xlpw7o5ryu7OrUg862MzQagivu/QPJyjcX+mlbZGtP6eaugWDYMw2M+Lcj\n9gYVPI2IFD0nm/mjAqJ17kzJ8pw4v9kObbPzT+0TslhQh8OQ0Lqh3eCN/wkh\nWA87\r\n=ZEh3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfIpkCsZxc5eQwAD3j3ZRG0EFyO2H0a4LC0bHKer9tigIgQvPMwDTMRb8X7qD0bEXhb7TiyCBrC7CV03f0E347Sc0="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e9f07ef.0_1563814546458_0.9372859916670522"},"_hasShrinkwrap":false},"0.0.0-canary.fc2bf62.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fc2bf62.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.fc2bf62.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.fc2bf62.0","fusion-plugin-react-redux":"0.0.0-canary.fc2bf62.0","fusion-plugin-universal-events":"0.0.0-canary.fc2bf62.0","fusion-test-utils":"0.0.0-canary.fc2bf62.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.fc2bf62.0","fusion-plugin-universal-events":"0.0.0-canary.fc2bf62.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fc2bf62.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fc2bf62.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-NJL6vU5FB6zXXJUlbZx2r684uH6UqWxIMAMmV7VAIjsGnSfZE18+VexD+24wBYGSYnRplcx47BDB8edcQDBb1w==","shasum":"7667bd2e06dc2bd23e8a3d63d0bb3f2fd1260aa8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fc2bf62.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNhfTCRA9TVsSAnZWagAAhVgP/2HE97zexTDHxfzgfioa\neUIzF9gV6OlSa6VEmE0dUY1+yOaEoa0dmU0ehajD+WCF4pjxdIzJoyALe2TC\nzgG4TYfbd31acQAuFFxfNnpUOoBqPNyCClaqp96wDcF23pu5TmW5+WWBgGMc\nKKNYUc2BcAdc9RvuVY6BP0gxiokkBqPg+/wOBKaIfKQCr5Ois+vovCse4hSB\nNR30Y4LoDANF5XRkJqU4rszy/mmE6kKB8JLCU7cGgVqi+oR42o/1ozTfT9LR\nBNNAtpP+2x85tT6jNCx/W9qQ+NvoSPE6LOqsRLgqhNWBuzJ3wzROSdBs3tGz\nbTPJQicIuY6iX3WiI5FpxD7SJV3PyTWHHMsnd19g5P7qQXDvXbdkEXIYWAqt\n1ooC+WET+Np8q9+tDnaIzZgKeCbNrJ0rqEW6EWNGcnTFLLuIrojYZV74RPwa\nhfynfQGRnNbWdfCzxm6xR+HfCKuHNRIThtySsqHyz3YWv2y2w5bNCvuBcPfL\nKbqUpJNW1eW6FvA8TVhHrY4i2J8CDMtkrntBmhEcSM4+1gkCjxiA20qbIV8D\nMdnSh/wXFSUfGWFW8cht3ShnO+OGA2mGZU9A4aA+MwUMmR+xekhhKFhkxAFD\nR8hhDrdCzvUz3+7tcZu8g8Iwzy31jUxmNdnJV1ExxayQkTLdz2brZ52PUZ92\n26gY\r\n=B40Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICmaal3ZlWqP3iyVbfBzTrKwVRRt8p2h9ebccgabnEUfAiBIG6Sj4bD+W2LlIxhHiuI2w/zFIxjbnoACJi+/5y72ww=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fc2bf62.0_1563826131107_0.6177710079052521"},"_hasShrinkwrap":false},"0.0.0-canary.a8de467.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a8de467.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.a8de467.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.a8de467.0","fusion-plugin-react-redux":"0.0.0-canary.a8de467.0","fusion-plugin-universal-events":"0.0.0-canary.a8de467.0","fusion-test-utils":"0.0.0-canary.a8de467.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a8de467.0","fusion-plugin-universal-events":"0.0.0-canary.a8de467.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a8de467.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a8de467.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-DMr9Vs5bBva4ghtc3rexmkAkZqucJOoBUFI2xIWPwNAXz56YP8UvBfu7XDMjptwzo4qX/A1JDgo+kNmn1V9vVw==","shasum":"cb77ace4cc7973bd061d1c6e0b8e09c1f95052d1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a8de467.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNjSKCRA9TVsSAnZWagAAccAP/30p1Qb5cxPz5Vzt2FH3\nt3gkckIKyas9v6N0Ym/BcSc0XZbVTOdqkCgCgrQWTS8YBHqVqq+6Po4r3njd\nJSXnlw/rX4NJN0nkIdZl2jy7B3Cim0UOetlo5eg+c5oPWPNG29YBkN1atw6z\nWYVzosdaoyTg35ONSSjDXbsMVRLBaLC1KR4rgN1doYy+zvPqLtf2sj6JfV/D\nOwewGXJh4dUIFU+ZPB8RDUN2jFN5eL6+oyIwcQWXSoxWuvBBd+CKvOGG3KhK\nIT0rJyiV2kvzDgkH1x97V1RBxGasYIHCOn8zyBsDnV1ZmPM+o0sCcSFnOiao\n+VLpyKEfhe0w/PGTCJG/wTzzmMSWcVL+wwrhNsNGVysVt3XNrQzdl0cvQDys\n1fNZzvANJSDJChzFBCdgmQyr/+zZwYAz7zT2BJyzZCPsm/KzBlmkDhVq+OZF\n3CyCuc6LZf2CvSbRU87I8m3ZGf2C/u4XfyZxPqDeAJ5UKV2c1d727TcvFB8p\n8hcPO+YlhpKcszi4xwW77V82wROZiS5etMla4FLA9ZoJuorc5gaUXgWHPFjg\nItW+xDQ/XEEKKVIpFoTannci3QeoFXMAA+0+wpkiUDt36BjM66EO1bYqpJvF\nmSw9cDzzsrAlCLm1aPbesAwFu8Vhssfm/XqEGLiwcNdMUbBJsSSSAZHQBBZ8\nrvZH\r\n=q2Gt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4UWgDMSZgumLJAcIbXshGykBbLVVbpvH4CyTztpmt1wIhAJiRknnLd2aEUB8OwN068hVOL9hNHfIffarp/XzbUJmC"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a8de467.0_1563833481607_0.5071875566530775"},"_hasShrinkwrap":false},"0.0.0-canary.a8de467.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a8de467.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.a8de467.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.a8de467.1","fusion-plugin-react-redux":"0.0.0-canary.a8de467.1","fusion-plugin-universal-events":"0.0.0-canary.a8de467.1","fusion-test-utils":"0.0.0-canary.a8de467.1","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a8de467.1","fusion-plugin-universal-events":"0.0.0-canary.a8de467.1"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a8de467.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a8de467.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-z+JqHHMdgo+o+D7aZdIK9+xcSXP0DT7SjF0kolWI5JyDZtEajFVaSmw8O6o74emnAv36Bmuf4hf8DkvDA5GbBQ==","shasum":"3f1d1bca4754b48bcdd9964a0b8a8c2c96cc2586","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a8de467.1.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNjXwCRA9TVsSAnZWagAACAcQAJsUP1xe127LIwTgLGsT\nO7acxpKhE4bdqR69knYRgQd8sJQi9y8INCRaScVSAJW9O3+f9sPj/gEvcCwU\nR5mpoAv+bDta94qMOahxYC0NnAaLI/vrDWLi9dHsQMPgXc+Ad1fqWXVOSB++\nRa1BuRx8mUn3MTRFqQC+pOWAX7ZV2XKhrd9mNhyn7ADHkOWDkuSVRvDz402T\ncqsgfEczYMcM5u66YG5HtVy41mjyF5QpOW1wChASioczN7Xge+edOPRu2Dbg\nBlbpnKOX6mP/v9zRWo+FWt8ac2OVPfbROpAOl40FrspvLxhwH66UVstKk6G1\ncLuwq828oMnY5Vg5C5o1HG638dEQ/+T8d8CUOvpYJxINtm+xvsebV0+t0XRb\nXtPzjNAUfIcvEM4/6Ytif68sfBhmhUhG5IkDpwEaS9TgZ7m42xu5ww+Nw4Ty\n49Y2895+98xJZwNfhU+E9LwbycvUfU9QEsblma5+X6BUaGk4JIq1VyC517zR\n13pNefB9EPoYTI44vQ4MKBcnk+j3VTQULIWYHi2NGCQ5ebDs3MIbH+cYLvQT\nuN/NUNjUhjgObsVwVLWvwcnvFumdONRwjRNC0AhfKIy982NBByYsveEB2/3Y\nC5S/4hl48eHccTKU0q2tuGLFMTS2cCJeurxAQe/vd6VUzn6Aw5JTNizVXJAR\nipCw\r\n=pozm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQ4be1pG5so/sqY39zw8NFMx8OqCe3zGui+W7w8NP4XAIgL9SvmHi4F5Ys8TEB9JUwRZ8U/Hb6OwSO1AOdFdDnBXE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a8de467.1_1563833839808_0.6461575389631031"},"_hasShrinkwrap":false},"0.0.0-canary.02195f4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.02195f4.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.02195f4.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.02195f4.0","fusion-plugin-react-redux":"0.0.0-canary.02195f4.0","fusion-plugin-universal-events":"0.0.0-canary.02195f4.0","fusion-test-utils":"0.0.0-canary.02195f4.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.02195f4.0","fusion-plugin-universal-events":"0.0.0-canary.02195f4.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.02195f4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.02195f4.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-qCMMqnInMJ0rWwkAALDxo6KlDZL8OYOc1wZQZ24ceEh6zzidS8izHkWoT9NIU0feHfbnU5qThAr39bHMsH3uZg==","shasum":"d2d366a14662fa6c72db603d125f410501fa2eb5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.02195f4.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNnwSCRA9TVsSAnZWagAAvHEP/2qoTJwVheYWn7JM0OVd\nx82i0i6Vn7dKwROZhB78VNTiF0rUuS20RDnrJ9pihcGjbxKkefx6y+8fBT0j\n8g232SAkH4POHLtvvPG+zS4mawriUZS8IfujIQvDDmEoquAn6bBa8ua1xZxR\n/mZeT/V7MTDTPAp2z38sktKTieRq22DQQBwFVWP2cpwv7P8kCc9LH3RFic32\nc1ZJaPSLY8i6phef3VkImH1ziAXdaTZSZfaNdTorUNf/sxHaGpM9o0UMTDzl\nAWaofNGce9ObB2WMCn+TLHJs93TJPcyYFU+qj7f2e7h60qa8uAS58HJrpCNu\nF76jVizCGz+HYRKzikUB2oXkN3WJrMHJcdWyHevUoza6DSJFH1asBpo2TUee\naHBinaroZqWRWU64TnUanJydPMi9rJiYU7gLKxTXz/2B1ZZmf5MA7RPhbiUO\nUj59DTjCUQAFgEaeBl21rxQXN0tQIcPgxVivYj2Ty+Zoyt8AuXWaYMVWJw7u\nE9WS8iSOiLNZZ4UmuVhd9llxzep9l6EuMeOEvWlxgIObnthTLCYuXmSwmlA2\nOixGozQ9Em7WxdNHmShV3A5RR5ElaURiVMSU8DM1e1YuZlyDLUMaSrX0TxAX\nMtkNBhnfQ7YBw2m1bSl8e22kLzwcM/tgcp8CgTY5HdTp9ceucXU8v2xwDxow\nQVZX\r\n=BYZ+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDLLRhFS3DkHPtsnIeY43QMOKaPW+XE2dbjde7UgXKKyAiB7msrv4SD/afjnfvHLabyTq6k/VzEDjsO4Ihk3V/0lNA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.02195f4.0_1563851793849_0.36083215015518366"},"_hasShrinkwrap":false},"0.0.0-canary.da2cfec.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.da2cfec.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.da2cfec.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.da2cfec.0","fusion-plugin-react-redux":"0.0.0-canary.da2cfec.0","fusion-plugin-universal-events":"0.0.0-canary.da2cfec.0","fusion-test-utils":"0.0.0-canary.da2cfec.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.da2cfec.0","fusion-plugin-universal-events":"0.0.0-canary.da2cfec.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.da2cfec.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.da2cfec.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-8C1E/77fOhEM/KDE/2VktwpuMa85Yh3H4GjQu96wVKAI1ckfPG5D7X8Q3cV4nEprizBSAEAt9mx0Q1mBpB4eSQ==","shasum":"abfff6b814e4b8936ce2b045b0a47b541e7c5830","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.da2cfec.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdNzbzCRA9TVsSAnZWagAA/8sP/2vknDRYmS9XSxC/f1TV\nrcynRBJfnXOzFdGi5EiqdUkmy6T1k2OJ72aEJKy5pY17E2vYjFDMQdR1weba\nVZPAlU9zdfGag7s3CgV9UqCPV9sPwi5OLQu0LYHdxE5HBNVWrrxHMeNWpN8a\ns01sZ+0pODc1MdUClUc41tHQ87zQCeN0iN48fuuGPkg3u3bN699f5y4ttCH/\n4meHDXOEMaCZ/UoftSViVOxJt8ABBd/GeR5vGCyS0vBgprBScvfl7JIpLLpo\nTWNl5KQNeObSP7DAy37TlAboFHTxFOB9NQQZ0gsvZ9lSmRZ2a927cbaqkB33\nD8FbM0cDHWlmIEjY6Bd2XHuIkWevuBt2BwCoDlCz6Dx8XjYZ26h3FoO2vDLW\ngQDzvAtq04rUV1CSts+I4Duzl9slJczs/TxMZuBqiPRg0W3MJ9Vui6/n/AzE\nXGJltD4n5tq1w9NOu+tSgTzON2wFiIcSQ2GLqz1I5kdoDuqQ/i1XvhdOCcOF\n1YY800sET7G2h2uhSWGsUNYq5GPM1nUpYBHLgRyCAtfE8R945NpeLsokG3w1\n3L/M7MicmTBQ0tepE3JINu42PHHUyEsI0HJaimS84NDRrKr2YY6gULl4IXtr\nD2usi8nXAE7VnFVTPLQy5D5FxElaYSivLbolUxLI0/5UMLKohsbyrj8ohH07\nus/j\r\n=gtk0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlX8N736VkgjGTx4KRbx167i8URUuueHebC2U9DngMdgIhAIT3cGERPtxtSsitoITUIo2fCq7Ep3SPFirnq6TLyaLx"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.da2cfec.0_1563899635315_0.6296764856310904"},"_hasShrinkwrap":false},"0.0.0-canary.14b4f0e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.14b4f0e.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.14b4f0e.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.14b4f0e.0","fusion-plugin-react-redux":"0.0.0-canary.14b4f0e.0","fusion-plugin-universal-events":"0.0.0-canary.14b4f0e.0","fusion-test-utils":"0.0.0-canary.14b4f0e.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.14b4f0e.0","fusion-plugin-universal-events":"0.0.0-canary.14b4f0e.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.14b4f0e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.14b4f0e.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-q4ElObNzL3juUYK6yud+78uVctODkNcqPHxgjCR5fwR1mWGx3H5fmxZGVQd/cIjpfVYpwVfn7hfjAzMvotzJAA==","shasum":"964347ad771fd041b546772e4031371fb4e7e459","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.14b4f0e.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdN0XkCRA9TVsSAnZWagAASiwQAIK8B8GB9k6iXHiqO+X0\n1XUVZbD9paEEu1qPE1vqXQcQ0DoOT8+qiLfRChCjq8tKlC+YP3nWwkYf0hut\nxjACw5zCPBuw8eB93Oyk+Rqm2eclJJvQfOgWgDIEbBdG739c7dQcVoESMXqd\nCvagzS7XtNHYaZGSip1XdPhj139JOTgHEFjT+juxYcjkKngc3I42bdvRp93K\nxBGiYeV28IrSXBo6YBja7Y6fGJN+JxqelSVn5tMBPafwo54HeYj2nsb9Fk/5\nFxrMazqiHzeuaCHZAAu4eX+LytDkIdlBPyKGmV3BIoi7YV/atMrWFaWv02r+\nYMnACjWmg4ZugpCEudSu/wb+VIzLEzZ8HUxEx2OO4ArUJ/VlpFMIij3xgMSp\ni0iWp7uSEocEC3+uqut35KP4WW6IofiRwgQR/m+ZcTuWBKagQMQQZ0mh4kuk\nVt5ynte7X0eQJTtbXX6ioBEdH9tWHscbXVoKPUsWlbf3Y65OGAmrieIUq5x9\nogHlfUODIDhyIp7noxuhRM50Os3MyTVn9yvZSIyKCu8bU1PllfG15VbHZh2Y\nqIYrifOi/WHBaKm0vdavO7rf9FFssQs3hGd5xVsATfg1jLcldtrEbLPFpoyH\nESoWuE6/oVnmFHaD3W0r52DXhZAvvIQ7IOL6BLNv1oVXZftdl0xxRRfdRlzt\no0xe\r\n=VZfo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCELlnJ05k0BPerVryPnyNGXkpaKZuIGvlJoUW1SBLTxQIgVDFhlqQOVppdE9Dk5QRxUI0gTaFK6PhumbhBYSbhacE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.14b4f0e.0_1563903459676_0.8550249860437271"},"_hasShrinkwrap":false},"0.0.0-canary.0953f07.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0953f07.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.0953f07.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.0953f07.0","fusion-plugin-react-redux":"0.0.0-canary.0953f07.0","fusion-plugin-universal-events":"0.0.0-canary.0953f07.0","fusion-test-utils":"0.0.0-canary.0953f07.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.0953f07.0","fusion-plugin-universal-events":"0.0.0-canary.0953f07.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0953f07.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0953f07.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-KXSSfqsN04LmvY1c2MvNwFmdDTk+++wIOMJHBMpqLUSxnQKHZYt1vWS8jGMbXOmm1GXXGFmcpJEnLk2MZw+tHQ==","shasum":"77a0b20ad567f8d53d204af5c390a0a91467578b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0953f07.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdN4DuCRA9TVsSAnZWagAAXSkP/RMxUiVbhrznXTWIh7WL\nCjY4idJNHBtLB5aA+FX5QSHIsPbLmI9wHtg96NWcw9ORI2x4ardIEj3v6ao4\n4+TlnN75pEeANGDEuhqm5sMC9PNkERN4dJfXY/DMUsXWGwf6GGq3WBmhk/PB\nLJ5CE5SPZdqJ2AnNCdwoEerGexilKv2Fj6+khdYYMkH3PxMNkrK3VR3BhLao\n+ZbO5hnGycLrRJmSJFP3oW37zrQLFPjXTEgNedjxSD0x4pbuTS05SXtvRZs7\nI9ABE7wQ4LegRfAql1rRIzU8oNlacifD+Ld+vnXlrderTcWr1vF8jbmfDapn\n9MkiriOjkWY77OtLbpE6vY0QPGf2OwVwyl4hHG1HC4WyEAzK1/24Za940h/O\nC4LE7o8EKwhOCm9g0ge5Fcd2vL+WQzQabiMjuvC4O3q9kmZhq+8y0XQ5E6Uv\nFz/1DPY2ZciOiUK7P3tRlcsLwHYYzhuA3lIx9wscq4sg1gDB9RV3D8qPj8Zd\n0woFbpzjPIp1qXgLEAY5UJwmvdvyK/iGJs6Y+zmh2hpRkKtoXLYfGa4gfu/S\nbqxQOCY7ewTanzHJtQKgqxVYLvVTOs/hI40IYcfc4RweFsRLnnnFyUN0SCVe\njfWT895v8pGEtQqJ2qjFXqBoXP7dHGtP+3/fQnbrO3DLpiJAJRtdw8EPTTsy\nA3FL\r\n=pRWR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAcK1Oa+0iCq7q9XSZJqRJMoK1pcpWvcDsht7Cm9zObAiAISuhGjxIem/xb2VBLJOltIK3zdKl/7LrkEesA8/na6g=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0953f07.0_1563918573662_0.2997288446075592"},"_hasShrinkwrap":false},"0.0.0-canary.471a10b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.471a10b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.471a10b.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.471a10b.0","fusion-plugin-react-redux":"0.0.0-canary.471a10b.0","fusion-plugin-universal-events":"0.0.0-canary.471a10b.0","fusion-test-utils":"0.0.0-canary.471a10b.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.471a10b.0","fusion-plugin-universal-events":"0.0.0-canary.471a10b.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.471a10b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.471a10b.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-TUK2vR2mi5hoLbuRoF4qeHgpQ/Yi2MsZSnBzUEBy3tn0i8BcRuZnFcotQv0Clf5wrybgjQJ6gXV9j7Pivtja2w==","shasum":"b47fb882697b221053da54c2fcb98418ad13c20e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.471a10b.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOJFsCRA9TVsSAnZWagAAaMcP/0oa6oirOMxY07o71tkj\nJde+o0XrBhSCP0WoFoqzdqZltmGh2V2cnGlwCCye7nW4+XSSBTbhSWCfDNEB\nXgkWNkNNIhGMGdNIZpFFriuD4MuvPRNDb3ydxRQPZVmraaJze2Hn1IkpoOa8\nFsb5fXD/UqEopaU89q+w3if6b45KlSkuxWSmUZXGzTj0Il5/mLqxMQGoEPDo\nxgO4Awty5VHhBiJ75R84xAuBxwQrdEC/ylVh7x78pKLc2C61ceQmNLl3+tDl\nUq0UnissjO2z3jgmVDrX+rDKLNABuYcseUs93k4BhfIz8T+BUXhOSbe2Vw/w\nGoFBzKiWjsLL4/GqY64JiQPSixmnRRDPjmdU2uTLK2oYWzhUauA/tMJCftyl\nkYOmm5ESXFOmJz2Tz4AywLZ0q+327P4KgfmKkN3mqG4uzYut9vdF6V3lfPJ0\ncU43AKvJ8qVw4H5ZxWNybXToj3XaduOoDzPjLupvx5v9pBDK66RhtO13AqMO\ndBsytEUoGWQNkwKvncrO9ClO47NAQ9g0mGTUUOrPXmoS1VqXjXznkAzPuZgX\nCbdZ42+xZ2DZDyQcYLCMJCi2BUrWPbZc5rzJ0sPstD9ey4oKy5bQsH/qFHZo\nn6BRTHRjOiOOlXjzkT08h7KVpGg4SJnTbQDeEmpLaZLPiCiXHqcjuv6eLE4F\n74S+\r\n=tXIy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDY8ksS5zpTsnu9nlh/g4th+/SeunMp8jauLNwCzTJAIAIgRX2RPSB7aXRosxwyGFLTlwe5vX1gE91Sqhgl6btD5Nk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.471a10b.0_1563988331522_0.2872660054093017"},"_hasShrinkwrap":false},"0.0.0-canary.9dc742c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9dc742c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.9dc742c.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.9dc742c.0","fusion-plugin-react-redux":"0.0.0-canary.9dc742c.0","fusion-plugin-universal-events":"0.0.0-canary.9dc742c.0","fusion-test-utils":"0.0.0-canary.9dc742c.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9dc742c.0","fusion-plugin-universal-events":"0.0.0-canary.9dc742c.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dc742c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9dc742c.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-YaD88HOAIcu+mQz8DeQi+QFLaAf0NaVDAMrPOxSS4RgvpYlKIEAloXRiKIsGO4qsrPpbaZVa6Vvd0zJk0/iULA==","shasum":"8b5790d4384df9dd554771134cad647c250a234b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dc742c.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOJF7CRA9TVsSAnZWagAAfdIQAIT5lnI7bSh9eL5pIvjQ\neF3MVrQYrHq1WIjFJlnqMgt6PVUkNgUbQyVOAdFMygFnvJiCuSxyKNBXLj02\neZFOEI2L3ceZBAxI4ecwoqFGFrqhT0LzSPEtwkGxNnPdo7VeAL9OBhbzJZBf\nbq7rKFFE1deS6Z7Nr0W1RPymyd+HVG8DCAmDNf8Dw74NjHeTzjBIHOAwQNdR\nEWCWR1lcd4AxPaQI7Vfsh2B03ejfwsRc5SbQewcozhEPEea8b/vp5GEJAm+z\nXZ0G1rjTRI1fLs6l0FhxAAeBW/ryv2jBupGjwthqfyM1sCoAThB6RwIgr9V9\nzrJ0kcwpK3LIdNP6eW6iDqhzqR78Q8goCLQhbMK+PgTXgmz1OQGlstuXRcwq\nGN4pDEhh/OEZtHMyfvnIDblGy46KMTdjXfbwjt9TTtsm7JRI8lR6gQxf4RKi\ntMoR4kaPR9R/BP+/6vkAY73tn8MSqVZEKXFJGS6QvxjFV+Zit5YdMU1zf17C\nv28Lwvr2uXP2mZatpL91G1H6SwYHFaSFQZF/PJvZhdJXBZjrh6ou34qBDX2m\nUCbUlFkgFXu/Nnmvj5F/XNMLF6zBEy2g9SIRWWr+M6m4qL+0gnNWqJfF/7pO\nIPP9ezwuhA0/12BhotigxAchZ8c2EOJlHWQ7ixq43tvAg0+Wvhcc+1aK0F+E\nGp1w\r\n=tGNA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDjyo9pQfuZpiHS3fm7L9XCWFxwKxcPd2O7b4bNKcfiyAiEA7S8VUzfecfbbTWzIpMtT3AwMWh7Mp7lxhR6QctCCo4o="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9dc742c.0_1563988345895_0.2575221220464958"},"_hasShrinkwrap":false},"0.0.0-canary.fbc7ca5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fbc7ca5.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.fbc7ca5.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.fbc7ca5.0","fusion-plugin-react-redux":"0.0.0-canary.fbc7ca5.0","fusion-plugin-universal-events":"0.0.0-canary.fbc7ca5.0","fusion-test-utils":"0.0.0-canary.fbc7ca5.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.fbc7ca5.0","fusion-plugin-universal-events":"0.0.0-canary.fbc7ca5.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fbc7ca5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fbc7ca5.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-EM3TFGFLGS2MIXBfA376zgXTwW/GBruYkRUctjCw5TvtIMMMvMMdx1N0UjgKndtT2SGv2d8SNw/BWwghuFZvdw==","shasum":"0e17cc7041dc6c4338c48523eb652d6f69a8cd53","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fbc7ca5.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdONGlCRA9TVsSAnZWagAAMxcP/RhcXMuZh9T7PVunEatE\nuwN3BJHZ0obLJWxchczYd5p72hexa1sfjSlk+h23C+NLyy9KjpyXBXSzXTy0\n6OMbcfh/XMxi4s1A9O9B/GOoYCcKUQ2K8o5QgRWsVkKo2tEtvwRvAZZ14LGE\nfA5gMwmoIgtYRpfNjsW09/mh7lAhKz2+TtQCWxN1fUJ7RLhdpY/DVoONm8tX\ntcIsWKThN7htgwPbBzbxL6rYVxo892dn2OX3VxP327lxLSXFnCY+4urcjsiS\nmfvSzFx8DRhmyDAF+ls6frrP+A2fYuMQAALDi9jik+mrVuDWlK/v+Vg4sMXy\nMJKQngI0r06rxOxrd4UthlSKMyHdqKEXyt9aMw2iBv5EaEo/6EK2LLmU5KBa\nmPAoUSKSy9B0S0I/MSpuMGVOGcAHNGoBxCwJsvNmTrMXQbGe4qL04uWPL7vC\n14QTvH20kF/KTKBeeLcELv59e2m7hxWz+t+KVjEBsMFEUdY4DNonfHJvNjJs\nYR7Bk3222MMow5WuyCiswBK7P5SD/3QNhMVvNEg5AQ9DbeMWi27NYIpvPrNx\nugsnyTY5IX3HeMzzjmn7L/LqkT+m64oJgxyj3spexrICSLj++NlMXe1DxcMu\nAtaPs1y045h/LzqutqABdVssVpt3h3CkJzeVMpEFpozydd4E4mM5RFCaaOlJ\nPj12\r\n=887v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBSw5LLk2CVA2wjRvXVDJ5p5x8zUZIsNYRt+oh1oF9WRAiBwnjpff28f44cBN0I7vHCZTSQfdkUl6KazFqwk8CvVtg=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fbc7ca5.0_1564004772935_0.2485600717455605"},"_hasShrinkwrap":false},"0.0.0-canary.08790d0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.08790d0.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.08790d0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.08790d0.0","fusion-plugin-react-redux":"0.0.0-canary.08790d0.0","fusion-plugin-universal-events":"0.0.0-canary.08790d0.0","fusion-test-utils":"0.0.0-canary.08790d0.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.08790d0.0","fusion-plugin-universal-events":"0.0.0-canary.08790d0.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.08790d0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.08790d0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-jfKKi+L9coOg2eLoSotHP1CcdJGoXt3npuKJ01ey//e36yqrdNmRmMQp0E4z83dcBoXbF9qNGhhlXeEgy8rNgQ==","shasum":"70651519bcbf7b103c4d100e5e2c7daa616cb381","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.08790d0.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOOIBCRA9TVsSAnZWagAAMsEP/iZo+mj36p1a1GqO3QAa\nBMw3iS9dIc2uJxHCDhsHxi+3n5/wuP147PKjyKnhwOAovicRv8VJI5B1DeW9\ntBPRekJDD//JWjFAFOk6SyzVqia3j8Y2kufvnyl60tbHurRGwB+inggWJ8z2\nI6dxPZBVUK7t+s3qQLG/fMlMkzZzXpwf+Lx/c+4CWHww++pYrQi1CYJ40ctT\nL1x1xqOufJFVrrKV25LbYdUM+h8h25TK/ZMVEFiPmKJogNS+x07aB72Vf7zD\nAyI5OAwD3gQSw/RM3W9qfbr5+HX3S7t5jl+BiQMCFnjGMYsCbMvjYHHU88hu\ncrbBx1DDVyPDuVwKvQaWOaewc9h4AhMOvSSQ5NOUb6v1gjey6Oke4YNx6nAu\njUSSlQIL0VdaQEACiq5fQe7twelg+eGXZZw/nrD/J6fMLCMOt6WrXldS8srz\nRubFIpnSkbeefIBrX05AEkqgKoHOtbvIZxHNwoL8zeQEoN4drWmMe2Nsh8E5\ninLykvdQYZBXTgvX2L8lq7wGTysV8vlxT8hMnCuUocNhXqQAx0I/U0JSWX6h\nar34LLL7p2E7u0xWyMZfX7XP4FUyVYPQ3ypNlqQTkXtv85GXp5OmbvrxJHwx\nDCoLp1e7Q2pB49danWmcTkIle4hF7UpHSxn/nDDyPMnZhIA5W3WXs57GB7Sc\nl+X6\r\n=7jLX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAjOpc8U2pGxfzl55h8Wmsg7irpfQGq1+OsAqDPVzSshAiEA+6Se1Ndi7XImVFjgyNS4eFgJNnVr0ybOvXVvy506qEQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.08790d0.0_1564008961164_0.13849006721806179"},"_hasShrinkwrap":false},"0.0.0-canary.17cfc1d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.17cfc1d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.17cfc1d.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.17cfc1d.0","fusion-plugin-react-redux":"0.0.0-canary.17cfc1d.0","fusion-plugin-universal-events":"0.0.0-canary.17cfc1d.0","fusion-test-utils":"0.0.0-canary.17cfc1d.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.17cfc1d.0","fusion-plugin-universal-events":"0.0.0-canary.17cfc1d.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.17cfc1d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.17cfc1d.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-f5O/pODUftlUgW7BLgbJjY6qRcXDjPhnneaWVRsmSJ+v0nFCGIEO9sJ77/I5hR/6l+iTZYjDErGMAopoImgYbg==","shasum":"7b717e2e07a61b2097c0161ad26a3684607e7d34","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.17cfc1d.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOOJCCRA9TVsSAnZWagAAzgkP/3r80Z6Y3nhpW3VSTUFc\nEx2OSA0lnJajk0wOYlHTYGPASMD2MrahStv6Oow6Rsi+ogLTdRQDridohLus\nLNFde/sbOIpzVkLcJO80Z7+xuj8PHtSnSC2m/PXDxy0EN5+CtsB5jX98nwMz\nXhtg2sysxEM77SJzDqOjzp6Y55mw87W+CcVhP6hhY5di08lFKdfrlb0/iXMJ\nX2bw9khcjRUryxtP9gCzioh/cljZ0/cQlCI5VShuIGBdE3APQsZaJVTIojGd\nBDEt+9eQiqKLqrclwxHWWO0jB7TyFGfGeoVGHloHQbljATyc06f01WP0vKX3\nZ9enqF0fXLMua6NhGVbr0OFIMWCTiyY2/V0FKvyHAa4wMPu1YNtkNIhup3SG\nc+Uwv3+k1R9pqqls3sxIeaHvhGVsZCg3F4WsovjYvPGHII6aQ59vgHK2zsru\nBOFzpLDkW9LxWHUfN8ZoacvRRjh44Hkk4XLwGChLcLHqIDzjVSNMjbSOZtqx\ncpfIwRuEw/9o7J6Np+CAw1fZBavj3U+450Bia7mjgXL4WX0pFvSNdls+qMIQ\n8vR2v2+57Wq+hBYs47Z9N/WhgJzJHbQSuzPcV8BFlb14DqDoRW6MCz0ed/Qn\niXjD/j8CgK6WQUoT2AOhR6w4yC8IApsRDifbrKTmVLgZ6CvhXPoGmnoy6Fiv\n/Mbg\r\n=UvrY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBYkBJ1pIO/Gv9ZmCroUz85UYTDl2qHyKhEixuTpJglsAiEA17QbkTPHFjQZYiBE9GGSjgOD74sZ62+2m3Q+v3mZCDU="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.17cfc1d.0_1564009025681_0.9212101955398824"},"_hasShrinkwrap":false},"0.0.0-canary.d0e4cd8.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d0e4cd8.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.d0e4cd8.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.d0e4cd8.0","fusion-plugin-react-redux":"0.0.0-canary.d0e4cd8.0","fusion-plugin-universal-events":"0.0.0-canary.d0e4cd8.0","fusion-test-utils":"0.0.0-canary.d0e4cd8.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d0e4cd8.0","fusion-plugin-universal-events":"0.0.0-canary.d0e4cd8.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d0e4cd8.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d0e4cd8.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-gDJ3wA4SW+QsEByzuLh2phF9S8qbshJTSgCDM7CLIY4Ihdvy4lokt/pObnBNA677pvH2rQ8zd4bGUDwhm5Q6Fg==","shasum":"936cdfeba62f740ddc1cc13b51562277d9f11212","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d0e4cd8.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOOJUCRA9TVsSAnZWagAApoYP/2a9Fyvm9Z54wKeylwhT\njLl+tECySsXYug6PvFZgEcNCTMvRQEnu+hdBnO2cR/oUy4gzrniHLxOUCs3N\nvRa1TJ5UvGEnLnpY8MZDhQXW9taurZdxxE2+V7grBZIYk5EeaI188imEYSJ+\nwZdo7IDkbgP0txmAT56JhbUyu3FqMeMd48+NKHrmgvYBjjUJ+a9MmveKh8Mr\njf3p5IpHqLyuVSF6ScyNTd7EnUPr0uQ5V+KQxkSZCZ7MnY9tBOQFjI1kLJI5\nNU6hXeYvWs1Gku5XxGGB72+LKad1nSyMu14uHS/stX1dDeg/irspMi1mUdC4\nj/gxoq3Jt7xZ53NOgSIC3uVzicmZ9LyfzeM/0shUMraMF9tvHmE2i29kJyf1\nL7jzWZYgDfYRr3h8+B2T8ZdfXWs1hARxlsYrGANO1Vwy4aHLAtHPp0DyvIvX\n33psP/a4gKZ/9ZNpcGNUYhwFMIhhKiY8HnxBbDhuETctc2m9ooC4y+nGZDGZ\n4c4BYLEiEQOo1aL0yALu8bMTBv/zhHEvNcWxIvmX6FU1tYVFQo/IkhswRDve\nSmj7muqEYxGuPw5rx+/psmaQS2NW6pn/69QEGYp77nJVmnJs5yoMCiiN6XX/\nGwtqhsjMctGer2uiMq42LChm2SQ5jTm5OvV544Bp2WC1edR3vLX133MnnXBt\nbou7\r\n=QGNR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDbPyujxNaYbnWH+37vzjOW29rZEfidikOBRs5E5s4erAiAc/OgNh7vimEi7pkwnUTD0P33HGN5OYPHvWtaNhnkpFg=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d0e4cd8.0_1564009043493_0.6818744680949493"},"_hasShrinkwrap":false},"0.0.0-canary.6499178.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.6499178.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.6499178.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.6499178.0","fusion-plugin-react-redux":"0.0.0-canary.6499178.0","fusion-plugin-universal-events":"0.0.0-canary.6499178.0","fusion-test-utils":"0.0.0-canary.6499178.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.6499178.0","fusion-plugin-universal-events":"0.0.0-canary.6499178.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.6499178.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.6499178.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-QktO1nn/djwJCkuHSMaDtJJ0NwCOCCWsiges0By8Xrs2lmcqTX7aijHVlkMlDZ49OcLjf/F0nWaKzK6xVMtZ8g==","shasum":"40da269c315d60698fd91e824c1f90e13e396e8c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.6499178.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOP/hCRA9TVsSAnZWagAA9e0QAJyXCp4xgUKSH/tFkOsR\nUnnVwY8RNAvIIbfcXvI1AOwGhiU/VGb2MwB9AYcj5yl2voY/IuzOyEYCGNNq\nT1Rjmp5gcAefdBd1dmXduvMlERPD6wgq78eBNdeLkuwRCUjBhmz1zTkbOefL\nkDvptDUVCTFerRF9pGa6Cw+Jtd5drqE1t0k+tx7S99ViyifxuruH71XDgq8w\n7xvdjzPdZDXEnJtMws0o4pEFxwnZnqQ8x2rcqucjWxUsiok2/kXB8skir74c\nbStYeLw1Y7kN3U7Qv4wMAO0fk+kkUaRLIX7x9wpI+ooAHtKpdhn4Y9Afwk/4\nPl00jGm7FYkBOCAOLnbmGX7rPeg0dDRouaqr6iSW/C66XICRf4IPsPeVZmZ8\n2iOZpsT6uTvmdlXAVPXQW1xCw1jKn2SviQdgSoJ+bNJGkMFuRA2eKOyUgNss\nsm6uHiZARl2iqTcXca8hlnSYSIBtDZddf9/QOSb1ErgB66JkUSHuWgKFIbdh\nPuYs9iOSYP8ekq7bAc4+22X+MU0OKFnz+QCZg/yVhxIWhmypN5nlbKILVaJ1\ndEsvo4GGlG49URQjJgkSSaKm24vlDe+0RAIPqvLCbFMlWdPTkfi/Mam1eX3O\nIjYVJZBfnV/jyoOa2SvIWIBZPncWF5kQmD3dw2iiObz3F0of4ilGO43NFsJ7\nzWCj\r\n=UjRo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCabr/tfG8NKbXCTf2j18Tilyv0CIj87V39SjyQBPVbHAIhAOlDyEI0S8H9kAc/GysmUtDsY5TN/vLh72c74GDT77fQ"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.6499178.0_1564016608776_0.740434103244545"},"_hasShrinkwrap":false},"0.0.0-canary.47d3251.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.47d3251.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.47d3251.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.47d3251.0","fusion-plugin-react-redux":"0.0.0-canary.47d3251.0","fusion-plugin-universal-events":"0.0.0-canary.47d3251.0","fusion-test-utils":"0.0.0-canary.47d3251.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.47d3251.0","fusion-plugin-universal-events":"0.0.0-canary.47d3251.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.47d3251.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.47d3251.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-8VGdVuxpbCKrSrHQlWCStq2Jos+koOdUxzwa+giQuk8aBe7evcVS85jtAvU2KYgP29TK1Bh3K367h92pz9km7w==","shasum":"4079da57ea3c729fe8a1808e64259c2e512bd7af","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.47d3251.0.tgz","fileCount":17,"unpackedSize":41922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOUcqCRA9TVsSAnZWagAAUW8P/3cfaW8pejKZO9O8Kw7j\nchOwSHL4Mh7V6DA/m55LtC8Hphib9Fs3A9jvN9YeRzgL198B9Ib2oD3GfmOh\nftBKfBw6xIp1aNto8jC37A2i1H+qG2YFA30dYHgb9m9rnz2f7SUMRVXKvoBj\nwuB85IYByOb0bliWIuhx7Etzs8HKDfRg4I9t25YkINyXfcMoCm0HJM7778fd\nR2i5Q3xeBL1aZlyPPiwrlpQujZ+FDBXtTE3y/4xWQc14GWOP6B/yOXN8JtHb\np+x1VxQPBXzLIC5+7K6BNYtL+lWCJpE5jaI7L29fdvbk6Td4lmEDw2xn8ZNU\nL6EBbotOnkluZavN8HcvblyPlK8ZgrhB9CNtlSmXQFHcD+g9hHhTY6/nby68\n5dgPiUTmZw4vLK4iVj1upu3pRR02pqpOrvxmYdXnMP3Fo2KElt9RQ8tm4yzk\n52HgdFXfKKnhZKGy9p5umLPK/QJyqK8VlCVot1cvER8DB2RBRYcXBys7aekL\n4xeFmPqh2yMQqhHMdph1IwqSpBPFb0SjEKkkQvjj4tBnTey5gTHO096K4YdF\nUhK95AvbxHu99bzPG1Ku3Zdrm2DNRxd3JJDIVTy1JAmF1FigUTHC15/Qyk/l\nEAF0XQVTtaPBNbpz8RfM/tjXbq2uOSMaMggvWobzWwXVHllpyEFGr+jp3+rE\nPzh4\r\n=rCbn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFkh3nVBwVVDd59nloOd9mVbMjAlJc+eZ1LKtSMrtH1mAiBqcVXRKkHr6Qi6xXVuq8vnkKKzGRth/46I3SqwjcIPyQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.47d3251.0_1564034857595_0.19981063625643358"},"_hasShrinkwrap":false},"0.0.0-canary.1b63aac.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1b63aac.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.1b63aac.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.1b63aac.0","fusion-plugin-react-redux":"0.0.0-canary.1b63aac.0","fusion-plugin-universal-events":"0.0.0-canary.1b63aac.0","fusion-test-utils":"0.0.0-canary.1b63aac.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.1b63aac.0","fusion-plugin-universal-events":"0.0.0-canary.1b63aac.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1b63aac.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1b63aac.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-5A8m3fZ7km5LQwmibnHW+fo9c8kDi3YWBlCTc701B8RjvC8AWXcvPziKDoQEZKcBQIWTsP9y8mul9kguYSA9fQ==","shasum":"6b94d8783850c74b2f860f5d15a98b76c6e8684c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1b63aac.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOhHmCRA9TVsSAnZWagAAWucP+gIEsopakO6Tt/YfCH07\nQ3OHEJkW1Y1z2VVvB0YNRuSRKhla3uH+n4Er8FivAwiOrGrvhTwPi0XNKr31\nLCM3xggND6CYVJ34EKGnuRch2LHvz5fbpQN4Nbi2yaqdERqqEm0QYK6rT8QI\n121utWyI2JLonuLvoS18HxFNqCuwCU7XisvqqyTGEX2iC63S9qKGHTTrQr16\nceQ51fSuDBDvWAnecUtDLYUK9cwzSQ76p+pjrcvx51b6rnj9+uuSiRUbfkwY\nDJkGwLFzIQ2HCczj3HLxdpX0pdiyK3k5THb84kZ8nY5qb702ADxA7AJrbyNK\nVbWl2cVLzC6KeTdirkxjmrZDs9jfUsIGnlWxJEdWX87BJdIDixHiSxjjA5If\nr7H42vGZLyFCr9Ex08KyPOb4GV0roN9ULL1mYEahvKnBRLFHkz9qjPtB5HXr\nDTOyeYuoI9BxEzh5eUpk2Qj288OMbeeb9SkWq4rMor381qUWM6zvIvc9kJDe\ns1q1Oo6fDt/15nT+zS2a3z7XpJjEwzW0d5bhg1XoGYBXqQp3GP05syxfFDCB\nkIc+ts2PV+S25jSC2qrOhsPwU+MnG2uL/bTyq6NakHtEzJQQ+7yimalat4rt\nyzZKFoBbct9Pr8K1w9mpUOSku6dqA23IsXIFbKR1JsPJQfEelavyc8R8lyzi\nIbcl\r\n=U2Jv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGO4h8DpfhsjZTIahmG3FRlw04voRT7dL5GAZztxNEGgAiEA/XgR0OT8tJuwYB5jVQn/qF3BvJ3ruoWWO9AZmC8K0Hg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1b63aac.0_1564086758286_0.873800799799366"},"_hasShrinkwrap":false},"0.0.0-canary.675492e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.675492e.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.675492e.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.675492e.0","fusion-plugin-react-redux":"0.0.0-canary.675492e.0","fusion-plugin-universal-events":"0.0.0-canary.675492e.0","fusion-test-utils":"0.0.0-canary.675492e.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.675492e.0","fusion-plugin-universal-events":"0.0.0-canary.675492e.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.675492e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.675492e.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-D4op8aKjwetMLCtD62OMlCyXfoUa6FOSO7lxV/hyCT7njQT0jPJxJcZLa4NWrD6seHN+5Hg5dZ0/1UAH5IXxJA==","shasum":"66ea61b80a8ca099820517bafadd3730a8780265","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.675492e.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOjCFCRA9TVsSAnZWagAAxaUP/iCjDMzrr+QR14Uqt5zK\nF+oyTI+ebAwdTVD+Tv+vfw2hAb+Mg0W9EjPGCgeC/rApA5IOvB5sfS3txaLf\nKHCQZPLysZRi9FWN/0nxaWyZgolN5L3xxsAmaj+U23MRbrmYU/8cJWoOuO/4\nGFHoA8gOQCVRf0nvjAMa1cQIkItizx2/hU00DeQdyF307/kpTVuUjD3cZcEA\nCT3E9GaUh+itu6WWxJ6yPwnDACFDPTysjb4oezm4OZACG9mduqLxepiVxTVn\nsMZVp9JgLESV7wvU7SDyAukG4z04+y9/jiEsJSKO9WxbfWl8dKr5RSyNdCqx\nQscLMDR0pw9UAVfKKMZjbOUz+cxHFWkDNV7xmS143eQSnIyxezyigKffSQgg\nFk/GrW0MbFiH6VrsWEdLcoWeUi40fYGG1o9kz61pswIB2C6Oi7mqUvHRZmCQ\n/vvCEjZmNYH0bfeUMu8GE8Iiy472PEhBK4yyRkLDHDhaHyoVxLDzORqq3Rcy\niBQOtq8Q9VkUGt3KKEyP/j9zNZKtw2IWWWpCb6NJv0QeZy5GMoSPYPufYkM3\nxtwEu+W33Q2x71F4wtCuYRsnbLsMqetirMAo+Hx3ENypBbI+BvVViP3MpaZc\nHbghBFq9dxoGepF1t+rS7HYO+URVyv/xv3NiCbkPkCKF6X52RUgwu/CBRcoh\n6faW\r\n=Hswt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTzCd8W2GiR2zxNZdpLFdaYQyWCLokJFMYMZeovJ3zrgIgX2kGIw8EK8FkvVYs1jwM26mhEmQ/rzPlQUIcu2veP+s="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.675492e.0_1564094597417_0.03395313661350707"},"_hasShrinkwrap":false},"0.0.0-canary.a8af54e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a8af54e.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.a8af54e.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.a8af54e.0","fusion-plugin-react-redux":"0.0.0-canary.a8af54e.0","fusion-plugin-universal-events":"0.0.0-canary.a8af54e.0","fusion-test-utils":"0.0.0-canary.a8af54e.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a8af54e.0","fusion-plugin-universal-events":"0.0.0-canary.a8af54e.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a8af54e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a8af54e.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Jy+uyYVEb6Qmmam3yclPbyiUb29Gso3XZqW3LvVB+yr7c2vqxxhUiJ0g7c0U2brQYmbeL9wqUZeaaM/L9h9omg==","shasum":"97f1dac6b38b6bcf8f82674409538a6ae2ad33a2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a8af54e.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdOm6LCRA9TVsSAnZWagAA4xsP/jcNc+ATigz+opeZBjIg\nv74SGi8t3YWvJo1bGKvxuFBo42PyrKmJskLa95BZTt8Qw4FVo/CJHaEumHCp\nwpL+0oDvBncdMQs/PDViorweleC3ei3CXbV7eaEGYIZDGbrkuXE01MyNd1my\nrenaen18nxEP7r8r/X5itB1tL23rXbjy4qQWYdTA61q531wS63UkjvDamCpo\nwzbdpsHfBB8+of5rE6IgdbzFwUrUnFNTk9JY1w+wjpqfco3SA+4NvJxNtp7V\n+JdNDfzxtghldNv11DNfNQzhypVi8YQvUeKuYkJiIzVSlysKNbWhr4cZWmSy\nGXrWgUBUhHglImBG5Yl0/Il4SUYL7r3Fi9WXV7F3cum9g76D7QWWk/Jzp8C7\nbGRdjYTRwcU/RwPLaTqTNFtHGeHFu3ofLLkLsbeYzJNUUMFv2S11IHKZTsg5\nbY2B1rPqw6aNWoPik+1j659+5YPkS6U3N8/QWUNxsz38nQ+ygb35bmwBMXWH\nXO54deDE1oWqvwk1ldBLd5nxYzye3qQtEdEIsIto++pax2MBcqs0Lg5sTUVA\npjDgCM2mLlVheq1IbLrWb0HHUL0hQqi5eZG4TaDwt8AN4FQ/DgmaM/Wjf0fB\nehg2UyCMsgOCrPTbTsVrFLVVf4zAInX6tJYhuw1G/GwpI9ZzS/5v1n0kf7yA\n0qFq\r\n=Dr6l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCu3QmNgn6xgZhrLFbNREt8jzrsY7YaJPTjtA2sReYn9QIhALiYHusIHaLTpfFOr2Kzz9yjJ3kF7b+3Akw8pMdaxf3j"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a8af54e.0_1564110474849_0.9727241475654462"},"_hasShrinkwrap":false},"0.0.0-canary.4a47f03.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4a47f03.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.4a47f03.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.4a47f03.0","fusion-plugin-react-redux":"0.0.0-canary.4a47f03.0","fusion-plugin-universal-events":"0.0.0-canary.4a47f03.0","fusion-test-utils":"0.0.0-canary.4a47f03.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.4a47f03.0","fusion-plugin-universal-events":"0.0.0-canary.4a47f03.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4a47f03.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4a47f03.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-XeG2dUee4OA11Yo7eHwd4MiNTnuolByMmSNz3TAqOiVPvq7wgT9a+vmDXY9/UJo2Ye2L8yVVXOdJSkt0LxWzbA==","shasum":"3d89002514acb501b1de848a37e66ac5901f1867","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4a47f03.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdO0l0CRA9TVsSAnZWagAAReMP/jhhPE+HHFaZDBeifI9P\n7a/60cvmpTjqBR3OEz3BLnx8yhc4eovIXVlqDvGvJVlRvfkVpIOMI9sOrMrT\nIDbOM2VPMSlT4FryruPPOwcAMYB8Oc4vvO2JzmNxv67rx7wrJOl3W3m90Olb\ncXFBlc4nHOhsq+/ag4j1ZTPyAxnJqSyrM9neIpU4+AiFZry33kTa6UIWwB5o\neBwu+D7LJdskvT9+QsfNtfZpAq0+0EKcnhyP8RdU/kxnSqwc5svduHlB5ScW\nu0hNRLzF9R5yZKA/IAFBaMgK4T85Bph2YyGjMlEsE6dpjMu10B6EDHNurLeO\nqvzDfhZeiNGHTC7EFL0t18Mp6iuD1Y6TXfFKF7ohzc7xK0d0Aa0gGg/9VboL\nUmOVq2V8yc7lpp2nESUGueKAFICjhQ5+OaZhZa5FmLGzKTbOehniE0PNTlMU\nB2cqmB5xMO/IfKSL/C+uU2XK75LMtnds16rsczEVbQB8/ZhoCGSSYwxgLy5I\naGExNOD60wACCrmbdTJUiegyVXXArwsm6Q7nYjttx9/g0R0J5iv/QI0FfwTi\naIkgdko+0/JASrLi4eqx5mx4RjpTdWipBd0xDZkcSHsGrDHrKJsO3d2FEh+t\nWgUrdHWNzu2Qmw/iW8g03iCCEY0h4u7odwWIJAQes5vVOMr3pr3AknWeero8\nTSf4\r\n=5XIc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE13OsN3kg0aLQhDqIH0swUBNFyK8LaGi02svFkr7e7kAiEAmhn1sPh/JYzRllszkxtunGjEIIk60sU3dYG+UOs3NOk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4a47f03.0_1564166515555_0.29742254551316427"},"_hasShrinkwrap":false},"0.0.0-canary.88403d8.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.88403d8.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.88403d8.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.88403d8.0","fusion-plugin-react-redux":"0.0.0-canary.88403d8.0","fusion-plugin-universal-events":"0.0.0-canary.88403d8.0","fusion-test-utils":"0.0.0-canary.88403d8.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.88403d8.0","fusion-plugin-universal-events":"0.0.0-canary.88403d8.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.88403d8.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.88403d8.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-PEkwpgEwhdmctE8P/AkhHG8f0150lhEHwMNLZ+ITmShGKsaZDc+DhlmZP6kuBU78gV6O/Fc/+aIZtkgFSJpvzA==","shasum":"f164348e22dd85bc917f166582b49d100f633d4f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.88403d8.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQNkYCRA9TVsSAnZWagAAobIP/0NL4TKogdX+FqKxJq5O\nhNMjCdwbzwNlI4DeZc9YClYQN6ml2Ud5+q40NBWdHwnDf07XkA8K3t2oyMK/\n9ztUEmRu6oLRvHsnMcDSV2Nj3eteZkwLZpZpsf6bpRNCMDnDoLGPphlZW81n\n390+/myfx+/4rLzoNj1AavBpmH4wdybs7NViT0Bsc6NzJCP9CELmO5v4wazh\nYcHqShNu4cJWBv7JHi8wNfCwqjdAK8i1g5jz76DHAiJN+xCdyCnhE1fyH9CC\nMyWCrGQFB3qL1xnH0oz5lFnzjwIlQJglV2MX9HPdRARpVmN4tTbn3noV2Vfu\nSk9V8CoOI7P3ik8xD6lSGdKtPi9AOpjjrMLOMi1RIDzMQ4cnJwVtAV+YHhc6\njxRUbQaT/wwScM3cs2WFhN2+O5SitKnJDcawjCy5H5yCvFUz64wmdXWPhooD\nBDox1WLRbAnj3yM7KdRvWmy48XMEd976T1VtCUM/qoLOC0uM0UdvAYKWaOdp\nOhh1/6ZFsoUDWpC3S/ZeWYsAregpnRQZMxcaEYjLGD+r/+RyKC5h52PjlDQw\n5dl2cKEtT95Qfr/+R1ttICap83IwwQuwLZuaHjvxQtTq84dwYHw++XLMJ2fF\nROxVIYpctg1DcaLQHA4C3yl3Hs+nOXomji9A+safV9h2K2aFFnURh2W/b6MK\nBiL3\r\n=HGjo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC96k4OYCZKDwrWMCwosf8jQ/RAfZAhnlP/lBHtG/zjjgIgXHmsp6gHEkfC33804VpdWGLDsp1ElNpYsc5Gi7/1KrY="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.88403d8.0_1564530967304_0.10374259895478755"},"_hasShrinkwrap":false},"0.0.0-canary.96b08c1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.96b08c1.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.96b08c1.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.96b08c1.0","fusion-plugin-react-redux":"0.0.0-canary.96b08c1.0","fusion-plugin-universal-events":"0.0.0-canary.96b08c1.0","fusion-test-utils":"0.0.0-canary.96b08c1.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.96b08c1.0","fusion-plugin-universal-events":"0.0.0-canary.96b08c1.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.96b08c1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.96b08c1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9LOuqmp1n34mjCcyP1uH5XD9FFelnLzNIGFW3aRHgm+FYao4RPKwsZeQ5N8itkpLEj9ivmSPH3Jf8pHZkFnqxw==","shasum":"9144507f6783a2ba975214ef004175d5612faa27","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.96b08c1.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQfwFCRA9TVsSAnZWagAAldcP/1Y1cbmtj37hflTSSMr9\nHUQFYVlzJVuaT9TRjFeU8glDmKaNco5QwVtWOuhv2+maVh+CZM5EGgXj0F2l\nyZrM7seGpsPlmsueGBIHertKlNYROtfkhGedDZ9g5PTfOGC2vUEMHHF6zvH9\nez8JHQV+ZgyE5t3qxSC8iz4IUpNVXflYtwL3zmfCOVrUXaaJJvmFrn+y7Azu\n5SgfTdslI6oHfmgRXeEbo5MgPphLAd4raNW5dJYi1QungOUmJNMzMi/0B1pt\nYYeB6tcRGkNEdLKPDK+VFQFq34m0FzwDliICmrVLgwA+21dIRy3kM239d0AW\nXPYaICItn0+cF/IZea7JOtnAOcD+T7OiczmXA22W3fPVQRt88GKxxvyYD7k/\nz+E7MQLrfwWyjWJD8mNdGyRQNK+dF1e0TVGAlnDn54n3DlE8JxqXHMRfssX7\nCFW20j8MJWVV2LrMtpwgHCYO6vp3K7f13tHOvTf0O5JHtoQWEnFHarcroq1I\nBpnCFdHDv+Tx8KTyB+C5zHkWmorRODGJPtZKsQSbKZf8FnfGPQgtRvidaPjj\n9JwkF0jznxWZml0Qs6EGBhkmsRTjglMYZN0ODci6AqxVHMCLiXZLC/jsHTWD\nwauU2OJtAU+0q4NhgBGjUXPw7vTr4DPc83pLsS4hR+eBN8Dm8J9vAUQ0Qu2A\nLR0j\r\n=yfS6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCArGJb/uXRHL9+KHq2Qtu3V7u0MyqdZUOj8KlYeP7DMAIhANU5/JqjQ+EhutQ+rBD4+OELw2F0l3fbHn+8DkDnotUB"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.96b08c1.0_1564605444719_0.5774401837317524"},"_hasShrinkwrap":false},"0.0.0-canary.631e52a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.631e52a.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.631e52a.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.631e52a.0","fusion-plugin-react-redux":"0.0.0-canary.631e52a.0","fusion-plugin-universal-events":"0.0.0-canary.631e52a.0","fusion-test-utils":"0.0.0-canary.631e52a.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.631e52a.0","fusion-plugin-universal-events":"0.0.0-canary.631e52a.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.631e52a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.631e52a.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9PwmAeqkanhdfOWgGp5EPYkUvRURshTTOM6MXYmFlTQulyyoc88DEdFjz2lDMNYv9Nmx3YqBaHXEKazZKFc83Q==","shasum":"811716d4b6a9a9c4a5defced534cec0c16bcb894","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.631e52a.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQw8gCRA9TVsSAnZWagAAAh0P+QHr89vWHRWH3Ip6z+YS\na6IbRzGyhkmG9UCV4GLwrFpcPJo1Xs1hVevlUt39Mq4jErXjsZeMDyG47SID\n0LtpZy9C6dN3RPWqn41Tbdps8Og75VNrr8DuArfWKklADwVuNq7I1o0IoJex\n8m/oPDZxnsMbIQjB7iBoGbb/zK/nOzwKHTnCBFfJG9O4aaEoFEWsC2uBRaqD\nXbo+nA4SAF6RZIRzREzlOY/Q272J2ALWXrJrJnvkY54//88P1refR9V6n6bn\nEJPtcFmQDKXbp7q5U0HhJCqhIGodQHRTIABm6ScWu0QMYK4X/2/VorxDhEoP\nOsmhM+oRQ9Ct7C64NBCxCC2a2xlvrBrfhj1HwZYNeoY3VusLxiu+HtcHzNEs\n3lopWyQL9ZtkMzY0GHjaBeOC1z+Ff/2lbC560OYMykGma/Xl4F6B3BXcd+Av\niDqdLkhWQS9PaU4xa4mqvOUOFLfLHtZU3Fh1CpZOWDVIrarObdId8BSIQpRX\nBLdYgIjWUOseUgT2dw0mMRDofJFTFWIzgDkwQVWeTfUCRKpYjLmkkdsv0HRT\nHDHR6HU0/IYGdTLeyupxQsGMqjkguR8f/bDYvCpRhdJPKjBKTZVluIu8wHy0\nhO+rtCx4HMEAadpQKTSpyxaqfPCoa3vzQg4cv3FFKrZXGJpBZSkrAYbqKASz\n3CU/\r\n=/DgY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbck7TwbIFEoCf95mma0Z2d6q/cUF2nZsv7grp1pJZ0wIgYBV0OVSrc42Aeo8MjVw9l1JjlLZuuy5yA4kEunPZyps="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.631e52a.0_1564675871378_0.6265985279363373"},"_hasShrinkwrap":false},"3.0.5":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.5","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"2.0.3","fusion-plugin-react-redux":"2.0.3","fusion-plugin-universal-events":"2.0.4","fusion-test-utils":"2.0.3","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.3","fusion-plugin-universal-events":"2.0.4"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-3.0.5.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.5","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-oxU+vpDQNc6hY6Bi2qX3On2hGSQcnTdDFJLkml9orBpzk8N4vxCusqYKA+cmLVlWJUoP47IqP8TkA3Zpi0Q7Aw==","shasum":"8b8dec23566589979c4fdeaf7f60f900ba41da7c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.5.tgz","fileCount":17,"unpackedSize":41612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQymuCRA9TVsSAnZWagAAigUP+wRrPGeEGQl5BZT+wgQ7\n44J9Wo0/yWxk+B4p7ZbftjPTsWjACrToL42Zjl6hv4vkZiUrviDkFO+bPFDi\nzDkgTZjXdGhhtNY0z/M9wKmmWIfTKRQSrTB5hxoXmchU8IJ/JkeVGtopAr3B\nGPKa0qGoaNCFqvcPUELQuuIBrjJoLxyLXMe7jlYUTrraCZAYn7Q7dE/VwDuk\nKks3XONH/XF+FeUreOd/9VeKAYDh7wajDPog3D0CLX2a3V+vXyBiMLS3MTTR\nYR7TDm73oC2BzsKpKCR0uJdDKzn3Mmb30j26AeTlS70anDx0HF4ItA28PY2E\nuh8eFtUVnd4eVTyY/DM0NetoVNDFlllMKVle0VtaRenS5pRLhdi4JFlzmbz6\ne3SCuMPMbZ/a0tNN6S339DQciQY79VwpBWXNlQLhaSDyHQgKPZB+Mmbgrqky\n5ydFqXGf+F8/obaJ9jhByA9xTpHU/LBWBOr0BNOj4nDSScUpQjnBNOGvdfeK\n6DwG7hTxPBvnNZQxs1TZfi3Rlxwg7rRE7e6fhRQjaHU0+AQTHtgR0s2IFygK\nMhPnWsYZlFOe1XtMNyfXLmOQl2NgxxDcgBVPBwFoOIUYu7hbm3tEDeFy0po6\naPKk60OmmYUzmAQRrI3U40WwAvNcXSdIvafesRpKjRB2sVcXXfhpYYjFv2jr\ncTfC\r\n=E3x0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClqfXu65phQmTwrFdNDjgWIGTAox1FCp8uyN+JkvLldwIhAICymeQS5oXBobjWL8xwBZS9h+zgAOpTJqfw/8Khzp/d"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.5_1564682670305_0.02248511625567251"},"_hasShrinkwrap":false},"0.0.0-canary.bdd94ac.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.bdd94ac.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.bdd94ac.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.bdd94ac.0","fusion-plugin-react-redux":"0.0.0-canary.bdd94ac.0","fusion-plugin-universal-events":"0.0.0-canary.bdd94ac.0","fusion-test-utils":"0.0.0-canary.bdd94ac.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.bdd94ac.0","fusion-plugin-universal-events":"0.0.0-canary.bdd94ac.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.bdd94ac.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.bdd94ac.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-per6IIYtJlP5lJ1PcQMxTfBs00oe2kP7kpD+w0kg6DfNEvNc5s+P8EOYXb9jTl2k6JRyO8DjRRqJ++80y7awsA==","shasum":"c2682ee7af459482bf1df2ce84033b67b129245e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.bdd94ac.0.tgz","fileCount":17,"unpackedSize":41748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdQzDOCRA9TVsSAnZWagAAZs4QAImSXvB5Fsgk6zY84Fre\nU3RYUmM66i4K6bc4VQ6vzIimXD+1so/49y3OFEBk24hEZu/QI6BIPAShQ3Xx\n6vOoLYS5LGm6QkIAmvnzwhyRo5OE9WVH99G/vQSNv3Y/KMgsJuAg5ngEg8SD\nf9Iln/nkThRoGxHrnFn8ykE3GC5T40sdgBLpQmm0UMzSjX6zly+eBpfTQttD\n0BofWkjiSZw3AUhpPcvF8f7jEc23sMR0zGF12ExDFb2Z3goNxwXvxIt/Q1wJ\nFGFv8CUjJtr0CHK0ZA0Aa4hHa7UJtegSJfuH9NbZbQKPWiyrnV4BtkydYQL4\nWSmIedUHCjFAM5IhZXIJrrON2c5lWBcuh9PupgA7YPWCOXMSjPPaLFef+tg+\n7WnVFwPazhh3irMaEBzKROQmzPH8w39xyu0swVOWK5ngUz/md5oV547DAZRQ\nw1MAGa9Ar+wT+1XuGDc+7o/fWVGxSJhAyQXFCt6baBlfEkko6yrJO9L0tBXU\n3rBs1/yppwP2NV0T5ioEaYMOY+qs7wxHqeb3e95nnwiseUt/IvPtGbRAC+Qk\n3tkTtHc1PPoHbrCznLClnZWyen5ZNP22NMxTdQL13svng3nlX5923HrSa2JB\nqZHMvYPSxsu+EempKRpl+T0I8LtUBl6vVb3lL22xsdoP4hpPbyC6OIlHWgjL\nOlS8\r\n=ewag\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB6QZH/RlXTIH3mh7sR9OXVe7wS4nJIOG0AZ34aEl/r4AiAR8PDe7dzchzhB9JnujnJlF0WjQpeUBaGruLQhun/ZCg=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.bdd94ac.0_1564684493446_0.29548177851978386"},"_hasShrinkwrap":false},"0.0.0-canary.ca9c1e7.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ca9c1e7.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.ca9c1e7.0","fusion-plugin-react-redux":"0.0.0-canary.ca9c1e7.0","fusion-plugin-universal-events":"0.0.0-canary.ca9c1e7.0","fusion-test-utils":"0.0.0-canary.ca9c1e7.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.ca9c1e7.0","fusion-plugin-universal-events":"0.0.0-canary.ca9c1e7.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ca9c1e7.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ca9c1e7.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-DweBUJrxiQHW/Fqlidb6r33fWCRS6Dbc/vENo/rSmlcbgU+9qPmeFxzYIe42O8dVLBKeAx0mPZqqMBxyxaeDpQ==","shasum":"ec925a225909fa3bbf16905d99fa5b257275aac3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ca9c1e7.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdRIotCRA9TVsSAnZWagAAcYoQAKUPj5Npj95flM6dR7zO\nc/agxaVM5Wvi01pzOtg7jP7QfzBIagl4s49PZd7wTauu21d483qg/mgfo1NY\n8DNgbPglR4QeQRbGompHvKOlCMZmE6/m9Ks47sI13H7ImVjnscHMuiPY2F+N\neLDx9ejPXXKFyEKGkJX6CkfwnTpANeNsNxb6Hxn2o6ozcIk9SdNYWtGDwxjF\nQkwZ8VlLRLh1XTq4AGpyiGHWPvvxVK+IgRT61LW7YQeSrKejYMpBOVXWvaQr\n8ADXm1SI7/yipbKmvysKIZSMKT2wJp/hKuntPD6NtN269D6bwegFBlBayJSl\n3+QUNnUhxK3jRbz/Ezao2D1+D/2KtNnp58rFMHj3ERwiU9vXNufMzOINar2N\n1w29RFwJhHg4Y3pRD7lyM9l08CKCH83J8m4W/GiDJOd3jfX54laNk7Coicee\n2E/431rLJpAYDEC/l3QKABklA/mhojf6EbzETF3BEvdAvyjgM7Ysg6Tts0p7\nRSI1NBWYWFRaEDO4n0lAWjSviCAc2gSAJxpzOyDY/mBJptmvoRuIi07BU3U6\nhMJsTvh8sAb9hYDHyZAxZIgmWyKxRr/zn1LK0nEcI27jLg7V6AsrF81t9OqF\noQuihMotoCBrHK+LYARqsjCC9frUcsvqAmRo8vnzDKfCbJYT3RBJuMNFzwM4\ngw6j\r\n=7hPa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkJKio3zrXuOvPTd0yybA4LKkQz+wZvoG1WIWu2Sx6LwIgJ79KI9m6U/4D2jvsqrJesQlfzDTTpv42/d3um/gnUxQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ca9c1e7.0_1564772909138_0.8127187403747302"},"_hasShrinkwrap":false},"0.0.0-canary.36c6897.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.36c6897.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.36c6897.0","fusion-plugin-react-redux":"0.0.0-canary.36c6897.0","fusion-plugin-universal-events":"0.0.0-canary.36c6897.0","fusion-test-utils":"0.0.0-canary.36c6897.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.36c6897.0","fusion-plugin-universal-events":"0.0.0-canary.36c6897.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.36c6897.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.36c6897.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-AJq3oUtDpWtYK3C2irxGnn/wekyFWMJjyUNY9Y9MpLnm3n1OeOJqIX4fV35YVhpDNQaRZllPoA3Hr2pXtSaRmQ==","shasum":"2dee19b7820f63ec30aa1c49bd0cf2ffbfcb9002","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.36c6897.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSIz4CRA9TVsSAnZWagAAzzQP/Ah2UeUSN4mLHGT7yZ6z\ncXyzsdBTaWhWwEcn7am9oRG6WHb88t+rXUEQuAf8tJpDd39KjHIAdpy+W7M5\nicrIrfpJEDnOTkGIFKT7fgJ/y+6gXDgVpWkJORTjvJbt5JPTW+UgSYE8lYG0\nbQ6L0O7n8eHQjnsqxfF+eVIz3425hcM8rZDOgTaMA4qU4/qLPQWswSZFqTD/\nmwQmhYWd8az4Q85AHDtYgqx26Nk314M1+xVMI+CiCXV1Wbd/ackhliipfx0x\nhVSPhnsqOCQLJB/IpK6dVYjeWInTk5IqJWP5wY6hez49VZSbVIlHzCLBypla\nAUBIag4sbfJP7uIpPAr/YiGrurWUPos1NBs60HKPx5mIuZXmKI5ca5yX8tyq\noY72/zBxYtc4fqZB+tr4B/c47QABw5l9eXnGO85Ri0forSlcl2UnNPIvuFt9\n4ObbN1a+mythxmIDap9We9NnUOQ0CdF/mPTGK8PpFp9UiDevXetqCTgvfuAu\ndABq+x3Dv/+28ZbxP8br+pozFTK8GrqfVoi8jj9xOWxVN1tt50j6kVC9AGyC\nbSnLv4GEgXUnJmeqxAbAx+P348M+VsT49oVxSXFDIhLZrPpYuOmasm7sghE+\nvoAewopZ0WPP6dKF6eGkXufhZ+Us9CktXS0vAE10L07GgdP11avHUwpN7H+J\n6Osw\r\n=fhK0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCA4rT/u8CFc6DyP8gCQV4AxXqgk86vcZ8LIqswNc2oPQIgTx5pQyCWByL1/C4f4EgVZDFirTq2fJV4/xqLl05vPwI="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.36c6897.0_1565035767760_0.9559773457009555"},"_hasShrinkwrap":false},"0.0.0-canary.87693bb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.87693bb.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.87693bb.0","fusion-plugin-react-redux":"0.0.0-canary.87693bb.0","fusion-plugin-universal-events":"0.0.0-canary.87693bb.0","fusion-test-utils":"0.0.0-canary.87693bb.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.87693bb.0","fusion-plugin-universal-events":"0.0.0-canary.87693bb.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.87693bb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.87693bb.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-lyeQQb6GEdkSAmO09oquEZPC/lBNaIFKMzFH/GBXBZidyDYn1emhqKK1xlX7pyPBv01vwhzRMRLiORbNY5P7BA==","shasum":"7ef842df5b2bd23bc9067b008efa7d5949d0b45c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.87693bb.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSb/YCRA9TVsSAnZWagAAYdEP+wYoN25gb8fIfnx8JHMb\niz79Omd31jljod8v0MDkCoWg8k/KYyro3IH8YO/0hIF+47jPD0rBpGw8w1n9\nwwuWrr8asLYo//MD2b6TQiSMdnNJVgOLhimczPX4UMUjGVTwouplXgP74/4E\nmyUqqqPktsbBbkUCdgOBlZtutO9GVX4dI2lTdHG72cWTpCiQfTn+OAvIQ/1W\nbjGXDkF2+7+ULSIxQyMikHLpVC+vo01eQrX8YIw27AFitM+h2qKerxIhYrCE\nheIB5TFh66uA4eSqFDpF9h+RzHwhQW4Mjw8ARP+mGt3diTaDB+qzxVZpLTQq\nLMYXfrpVm35QgcIoTdwdhtRL4DZ8GnhqLQENU9dzFWTU7XmUnxbqADxmbMxd\nl0aQEtX7/rrCqeUcNq9ydYbtthUCBMXHCvusiOzI2bsHySag41MlrvKFy37n\n+zC/rA40s/4xROyTvOLgwOo33zNMPkIyG5wh8jPifMFy292PRUwEg5WVDJ1W\nIUlpCffDI7DsgGr8BMDACkzjHdjikO2zJAIuhgwOg1R6Uhe+Tjoonq9T2pQD\n1OOikNMe/ctK1OnED8m00cz2ri6cfssg2KiNSmcLH7jqYoH9MJs2gRtBUGqw\nIRYRYCCQN0P6nJBNetiHfzLe/BeI5Vj1cIuZToyZrGYJyayrQaGYMOJyeScj\nhvCH\r\n=1hdr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE2x957J6NIXdylgcD29W8lyIR1fh0wkfoN8+RftUwOiAiBI+cxxtYGGiriw7kcQa1ngpUy0eTQVVQHU6hqmopSVFQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.87693bb.0_1565114327524_0.5846686034769346"},"_hasShrinkwrap":false},"0.0.0-canary.87693bb.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.87693bb.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.87693bb.1","fusion-plugin-react-redux":"0.0.0-canary.87693bb.1","fusion-plugin-universal-events":"0.0.0-canary.87693bb.1","fusion-test-utils":"0.0.0-canary.87693bb.1","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.87693bb.1","fusion-plugin-universal-events":"0.0.0-canary.87693bb.1"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.87693bb.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.87693bb.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Vq2g+7fVvpj6RjVu+g4w8pZFJcLU8bLTtTFKUHxCBZf7CJwBQvfDFLXpvtgO9jOTl5NmFAX9UGGc/OtrgUarig==","shasum":"374615e6e1dfe207ad4566bf677bbc5c1e8401e1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.87693bb.1.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSb//CRA9TVsSAnZWagAAcR4P/3G15F0qkSPL3nznJEwF\nQpg8WsL7ch0RYBV056NqyLw3DacUZxqoOE1xUhrw9kjqUgyYBdD7oFAZErUP\n9UV+N5LkovyR84dq+REdEnOfPVrtFCLV6euUcU2UyWksxlmYStRd6i3sSSkp\nMvnl+7UcBb25jpjGh8ntBFpaN4Q0QnlX0cdzYppiGnJDzDCTRtZP0XDNFfbO\ne7N7cMQkCuq2pQW0raSLVKYcYwsmg5poC1bUe5ftTQ+KV50z4ZkHZI6sYxb6\nsc/hAHql5OSezhIc5bexBfnxL8tWw+E33E/IQFi2ybNL6fAf93l/JaSX3hiU\nK9GtLklA+shw16ONkcyhgdsLRZYrJRU/W67oJM0K1/zyCPbbGKD244XptJQe\nbovbkvJdRDjx0UIplJPY1Cd4PM/kSq4jraq+l5KtTmMHcnFX7Bn5lHmGjbtJ\nf962VQ0qwj7CUxUIcnHPNuMrq4jBJV6o+y3iUFsMZizSRj55zqHNuagKbswM\nxhQtynKXRmNG8IB92p2OgCdQ6SSd3GhIHAcPgQtmMsSgnT01QEXu0dGAVqTu\nZ3s6cS2T8Z5d8TOxZ98CSj4BUMtk2eSFs3sCSoqsHId9QfWi2vaJY7IfRWeD\neCZ3NtepqoGX0TbMQc1t69VMaRBbug6cRESOTagJ7G6AoVU6027z7GfERFeQ\nbn6l\r\n=psdF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICMDNNdRgsSDejYNAlsiABkns8mD+ye3rPzoIlWm6ThPAiAm3/x/x5rFRnHVTkrAhQdY7YY0tbhXSTI54aaU5Nk2fg=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.87693bb.1_1565114367331_0.40597322158268323"},"_hasShrinkwrap":false},"0.0.0-canary.73b3b7a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.73b3b7a.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.73b3b7a.0","fusion-plugin-react-redux":"0.0.0-canary.73b3b7a.0","fusion-plugin-universal-events":"0.0.0-canary.73b3b7a.0","fusion-test-utils":"0.0.0-canary.73b3b7a.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.73b3b7a.0","fusion-plugin-universal-events":"0.0.0-canary.73b3b7a.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.73b3b7a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.73b3b7a.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-jHspHSLuE8e1Rz5N/sQCFo3cPFQKPKbjD7+RrXt2W3dUQuQ/bhQExGGfv9mJRQSbVbmM43L/R3J7umhl5NNlhQ==","shasum":"4befba6f0bca8c43c4fd9bf9642ba4771517fcae","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.73b3b7a.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSewNCRA9TVsSAnZWagAAaKMP/jXBRadK5v3eHsG++xk0\nctoSNnogb71XMhPFwwKFuc14Ej3K1H7nn5QX7FbXyAyJUIptf9neXBZ5saiC\n6YtEfnnIasuHpBXRpTmouivUK5RDCxvHAAVarwCn7Dey+i4X81RXCVvznz8Z\nacmx4cx6xgHGlURUg22hBjNJqsuy0VkZ3lx1NN6B5mMa2iDqySUuuR99WbSv\npkzFrN829IYbjUx4Ub9DA/bjiBG8DajYuIvqIjI6o8kCn4gi6pVwMBPE8d6/\nT6glkLVhIGZDHmhZONsh0nbIb2J91MZ8bwjZBK3+OUdWeSFof2TL5gDrPFQY\nGmRxk2xhq7fbfRiCfcx5bdkdXehwXR8gJXlY+JzBQO9oUDm+16gRV4NUC56f\nwIn83lo/QUYOOZxov6d+FVuSOHI2hnHjvc9XIcxnjiC/IhJcH8bivfnnnCnJ\nH9tPxXSFEAVpeZciaENjkoqW+9EtsMJ/HbLrXFJq6AtTVBW8i5oP8WI6skFm\ntOwGXqUDbmIjzqFfsAODZrvOEtEQyoaICgV/mZCoSysa6wK2ocQykkwfMGWI\n3WlpSQxvwa/UECS8a1tK48VJ4MZvNFJTciGpnsu9zaIT/AHW2K0JQTLMIhRJ\nIQC/uNvbj0al1TMSZsWZO/SrJ1g+WrCNBZMhUf8CqcSOZaYyRbQCcRat8wbR\nddl8\r\n=TMrQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD339GXa4L9ZAmN+JLU7V9Bl05lIf7gP/lAQlKIpsgATgIgJ6IAw+actvRzCFD0mtCto2tWTF7c/JTwY+yM6GgoX6Q="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.73b3b7a.0_1565125643997_0.47837741765958675"},"_hasShrinkwrap":false},"0.0.0-canary.3a6c203.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3a6c203.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.3a6c203.0","fusion-plugin-react-redux":"0.0.0-canary.3a6c203.0","fusion-plugin-universal-events":"0.0.0-canary.3a6c203.0","fusion-test-utils":"0.0.0-canary.3a6c203.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3a6c203.0","fusion-plugin-universal-events":"0.0.0-canary.3a6c203.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3a6c203.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3a6c203.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Y7FY7cSX9aEAE2UP7agzO+voWPkS38V5Dv0SKfyyOCh1adYILHLt3NAfvokQmW9Xx0Fo33acGULRowrPezbTOw==","shasum":"8de4b20d069ec6aaa4bcc9093dc8631587ded541","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3a6c203.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSf1NCRA9TVsSAnZWagAAeE0P/1TIPP0Nwcb4Gn/Tz3bO\nD5DQxQ38+slsXbEW+RXYPQKQT4RGjM8acsNXqmU/4b9igaI1eAm5Jtsyp733\nc1ax75zbauEJD6K2+unzkZLM8iNi52W0wMgdOENK20RjVZZOqAgCEvL7VQyA\nHs3thF7pCU3Ozy8Aj+I/3Dlq8nAQtUGgXdmO/BuITlqvPqCUovqzXQSIo4pm\nSWaU0fetrhQ4KgOaFJYRJVWqKpHzUwLpSGyYmPm5OdohVGde7i3ktpbLP5j8\n7Vo1w6SwXyx/tpWAap7VP+l2ks5W3JWtV+l18Upn7SzgieDfajSMhHoMAtTh\nx4cF1d6iCu0FC2T3ndpF1ym7jmtD7FCCiq9p7T8QnrpZ7eKQhXZFM4tLwFai\nWMipNnJXpg5GoOKI5bDSd8KpbsZzp3nphQzyA2zQPgKiDZCRbZccTMtdkR26\nAasqMepcrxs36e6KcLhfGBNodTuc6XNw10fPBFhy/napVjJJuUY6fzf9B75F\nZrLbJ6sgVFsRsxNKJwH+lBB2H4Os8kXFkq4O3qNqvr2fz+p2PFsrkEGxkm5i\nmvqtqpHc9u6sMBjTS4m8sbOd9gClkIHdGErtkQOe2g/ZFQRe6ZtDmM0nriFv\n6U0xnCk0j7R/psBKpaUDvgahXeuB5EN0Ywsg1jd9R3Jeh4iF9LAlH9GOXkdB\nJVxw\r\n=/1IY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/5NuuikNAn3UXw6lBDAF9CnxqI3I3eo8UoZ+Q6kq+oAIgJ8TGiAu2BRuGQesuAisDT7zbXIR224jnqDShSpvYKtc="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3a6c203.0_1565130060633_0.6914329751529438"},"_hasShrinkwrap":false},"0.0.0-canary.b30cfc9.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b30cfc9.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.b30cfc9.0","fusion-plugin-react-redux":"0.0.0-canary.b30cfc9.0","fusion-plugin-universal-events":"0.0.0-canary.b30cfc9.0","fusion-test-utils":"0.0.0-canary.b30cfc9.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b30cfc9.0","fusion-plugin-universal-events":"0.0.0-canary.b30cfc9.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b30cfc9.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b30cfc9.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-74qf0udDtA0O+xiTs5SLnFO1/h7SsoEPeuK5dOqOHxA5NZtwih5r2F4ad1L5AFZXdWwp8M1Myk2IoXiDsJtsOg==","shasum":"876fe6474761c100eb5beaae6d81b409d0708017","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b30cfc9.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSgkYCRA9TVsSAnZWagAATZoP/RhqhEADpCENRDUaScQN\niZCR6U3IoXdOJcErnNiDMAW8MnT8Uiwpgf7SjGjv650jrcTuEjnM8RaVRLi8\nm0keUmdRy+Ffp0TgBiDFEatp4zetuFGTywZ/C/ukTluRP2wk01as28nikIEr\nUbuh+X3N99SeFs9AG1C2KACur4EZsVxK6XTmITjBFOwajqMF392RFVxm9x3W\nPQcYaOyId7rBOjQC6w0mj6dISZNbaR/e9DjthRwlNdxDPwlWO7H9Y+p8uH6G\noI9kF+jgx5ajCsgEtUepGqtgh6qu36JhsuNcZWeb93gZv29U4pYquE+LFslL\ntMlSnrM6fWFcT/xc+Wab2y/X7lwCx0NzNVm3/TlhXbq7LoyZaNqr8wvegkyy\nQtd/73gwpLOIkUWI9eQpLuVQ8zWk0X6UqcJI9CUS3M8SCrzjb3bDd673LcJA\nIVWSTKzd89ZhXNVb9K5sc5k7JgpffwXLNcV5DOTeKLIljUtJQAvV1AJiy7aM\n1yoZ9LYvRSYx1VFFHnwiKEzUGNZZUSo85SCpdIenfBikrPhMAWkIEaTct4F2\nWpe53hJXCRupyYZucNxgFkFxbofesuprlvR07oY7RVxck8g0TNnYPoz788z1\nCdEuE6B6NTC5pbLoxGGRHAkyTGZuvp41JiaI+IXbEvJrduikKZRTTxsBBfpk\ngk2I\r\n=tvWs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYT5nC01kX0dctBeY3cIj02v3EHEAilQf7r3Ynv8AS3wIhAILLQAHA9h4skcUmogxDENM/1x1ssL+EihfSmtrfcTqb"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b30cfc9.0_1565133079994_0.5857110358030062"},"_hasShrinkwrap":false},"0.0.0-canary.d1e11d1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d1e11d1.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.d1e11d1.0","fusion-plugin-react-redux":"0.0.0-canary.d1e11d1.0","fusion-plugin-universal-events":"0.0.0-canary.d1e11d1.0","fusion-test-utils":"0.0.0-canary.d1e11d1.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d1e11d1.0","fusion-plugin-universal-events":"0.0.0-canary.d1e11d1.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d1e11d1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d1e11d1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-bW+xyWg3qF2RqZCbSqG9XIX/suyCb0JfTSvhz1nLOqDcxSk9DRd9CH8lNjWpLgGRp/3uqVynVf54dqCw5O7zlw==","shasum":"bba1dc21a42e39648d19b4ffa5de894b3dabf133","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d1e11d1.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSg50CRA9TVsSAnZWagAAbX8P/3qa2RM5XefrsXdzr1PU\nviwc63o4IR7jpXnvtxnKvhMpM70B2HRZCEa+7rQQZaGz3lsKOxtkYT1n8/n7\nTiSQ481cHKO/cD5GbBpNXeiSuVFwV/5ex+xOxoBx4ujoB6Z5dceLDxyoGQW5\nwwd3v2F9AfseiJddIKxpDmSX6tRrwEKO6nYfMTGiqwEA0ug5H0q9gkhslwxU\nBOC7ITK/lql3P+n2r5HxZ3gl2c291U1dVqXKcB0g6O4b1kb9j7xlqINn7MDq\ndEqepD1bxDG3V/+zkE8Wa225pXYqMKuDbiTkFMTtAksHYnJNr+cb+WEj7Cuh\nbfFejvUJ4bmBRGZ3YhBPThAA7gU2jXMc6LnbZIOc3vbI+IJKxZl4MRN/VcVY\nmKqxh7nY11+Y1fe9bcXIv3mQSmbXBuXYPTMKew3l+AeLGUuchY/IvN28S+Ky\nhKbr0LLytwdf2N7Q9Aa7LpW49x06epHA7CNTwKgV+XNQLGMNwTTu2EaDaV/V\niNeYAu7hK75RIqG9lejcf1/UTfW6XrFqbx8WO1e6nr4KurgoEkjSbMvYs6li\ne56HgZfvmRan+F16OtgP86kVjGcChCa1NKzu28pi+WfPFc92zU5cvX5LmnLm\n3MmWTRdY7EGfFGxc8nx332thRd6l2dpODR8zUuJ02Rz1wTeC5TN/MkONUxTo\nTnXW\r\n=LcQu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuD+SZc8jvSnOwZ1SfXAlhWjLzE8+6a2vYJEaqyOkVEQIgXc7dpRnvjgEHW4rdMOmEV6BK9PRbHJNvnUUk6K1M2+g="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d1e11d1.0_1565134451464_0.2486763300854551"},"_hasShrinkwrap":false},"0.0.0-canary.d1e11d1.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d1e11d1.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.d1e11d1.1","fusion-plugin-react-redux":"0.0.0-canary.d1e11d1.1","fusion-plugin-universal-events":"0.0.0-canary.d1e11d1.1","fusion-test-utils":"0.0.0-canary.d1e11d1.1","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d1e11d1.1","fusion-plugin-universal-events":"0.0.0-canary.d1e11d1.1"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d1e11d1.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d1e11d1.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-QKM1Ykdr7r7nPXClXpAhfd7IGYBD5oZ8O7+A0HRWZreC05PWEB7pAjglE96LtAT6ZIdylPPXReGBPOpxAHGxtA==","shasum":"b0d32a7d68e243280d3996e830cf1fa848f18e5b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d1e11d1.1.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSg+pCRA9TVsSAnZWagAAzPYQAJZ3pdCXw13yBVqHA84n\nNAFjCVnTOCX9RkqVvnZwRsp8A2mWqrXSU7dzdfYKdESYxrYBHDAZUwzEQhPm\nxGKkI/kKS3OuFzQYEvhcoOTudZAZ3n6WT7b3nOpBo+PxymaUiajEH6c7CJxC\n+fPRnVAX/c5vH1TUjzG6rhS/HlCxjIyajDE3dFQD5rjfFeZstgspBQBLKEG/\n0eTtf9Ufcd0ilc7qZYe+/GpbU5Yt5lKo81sVxsPKiQIdWw9kfRAQt908oSIi\nkdtc2jLPfyczmWZITiHXese0KIfB+mYOvIiDBECoYOd4nZvVyYk3CFy8Ff+N\njWyMDBlhHve89jhavKoGEBX2Cf3XIu+CaEyYVMnmQd5gRb/TUZD0NqeqpJnB\ns5LX0rMIeOsGgryLSP3V0oerdkGuP291u1SkchYafEQdc0ZUjbVt641yeMvM\n4eQvlfpEEVHskWPBDMfcYvOU8tOucKTGrZKaXG4b68OD4j0xxmzJodDsUI/a\nLLTZXVAVuzb80qUf3rQetwdj0onCWAzVib7Ll6QqmZ1UW8aMmqit0KJBIIrq\nO6hWiOX2A0GPgOlCZW91MIv4j9AO664BYb3gJQWmjnk8ibzmx11/na8BNAFE\nJgSuMSJXBO0LUHuX7z2j/WUdIpacoW0FcYPx2fSe0+eA9fNyhw+GMYbAk6/x\nYIea\r\n=XMAV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRT6/R2XaDiJtZsZD8BjWZvUd1KGQfGG1GTYk9370YVAIhAOfbZsw/OjdDPEhOMPThEV1DxoO1ki5bgfn6MVtSrlNF"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d1e11d1.1_1565134760879_0.7118925929642352"},"_hasShrinkwrap":false},"0.0.0-canary.465e7e1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.465e7e1.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.465e7e1.0","fusion-plugin-react-redux":"0.0.0-canary.465e7e1.0","fusion-plugin-universal-events":"0.0.0-canary.465e7e1.0","fusion-test-utils":"0.0.0-canary.465e7e1.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.465e7e1.0","fusion-plugin-universal-events":"0.0.0-canary.465e7e1.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.465e7e1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.465e7e1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-HJR/VCl2+6DymrRhv/JMkq5pEJFTIavUrMAJfNwLgcdJwgv9ECpTCegZ/CoZqSt93f+d6Di8PHr7BWJ+0CItbA==","shasum":"19bb4f87084bcd931467828d584aef5bfdefa01f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.465e7e1.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdShbeCRA9TVsSAnZWagAAnwkQAJWlCe2SllJRrUHfYcmB\nUdWAiBdVyWXCEjJYysY44uNK0/lbxydajsuly3CbeDEUMtqsW241nOuKDtPU\n8DL+5qFUHCs/GPnkD+vDeUsFfo4sqRhINxDnlPdo/qEnkH6glAnBiTsMDDEV\nOZRz9x0e+UdG/BmC/W3pt7NpsWUb2tQFVA7Xgo1P9z17r8IAzleDmKoyhC5V\nHtInn+FXISmaYNhc9tfd+F99wKN8YfVyiSlPVIA1lglTtpoluZiFXIm2wdcv\n1ITP4SKBY0Yj6eYlRoQLTvYNWS4OF829LX0rIJMHxm/UK1TCiyK3t3LY/nio\ncLb0uamOTAR6Fi7fVIHuSoa8YMFHHpsm4k2PYG0MW4Yf86Wqm40QVS1juKTp\nwQn9NnEF2mXnoYYggbfn14CxEPdFnBN3aYDbgtRL0SoOG5IRj+eZnYGQ5X4K\nG7s4hxsLGuDsU9mNKuPuNweATLbzeVaXVhsXzLIdzfNTpQh5uRz/rjrNfFuX\n+A1T5OnXpKvnjEjcKY6uGRxFf4KTEd/jPOPukwyoDWiSuXxpqfw/jE3CF4TD\npEwox73O0qq67J0tNz822qTBMZepQJu1gnEHPMv6eVb4OdOVQHpf9Egukc5s\nxaAN4/ALEUi2RfC+LzdqoO3BqWzPuKp08y6FEdvmXDQpBbEI0+9kTAoKVxCx\nyHTe\r\n=8b66\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdYxTkPyt1sf3RXRdQ19TDp3OzrdSXIgUPiaMeJhU3LQIhAP74R/BV2HNsbd1u6wUdIgu00DVUoNSIKAGNGfSqJ7Qn"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.465e7e1.0_1565136605992_0.019428527278900765"},"_hasShrinkwrap":false},"0.0.0-canary.465e7e1.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.465e7e1.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.465e7e1.1","fusion-plugin-react-redux":"0.0.0-canary.465e7e1.1","fusion-plugin-universal-events":"0.0.0-canary.465e7e1.1","fusion-test-utils":"0.0.0-canary.465e7e1.1","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.465e7e1.1","fusion-plugin-universal-events":"0.0.0-canary.465e7e1.1"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.465e7e1.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.465e7e1.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ywZkfcR7K20Teamp1E/uowFQujg3GO5SagpWLKKSDPQ2y7LSiQwRsJ097j9MJNzBg4L0kyvqa4Uvvs6HsLlS/g==","shasum":"d3361282e426b2f39243737eaa57427e30298615","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.465e7e1.1.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdShfUCRA9TVsSAnZWagAA/x8P/1Hgl51j2TP09pBnorCX\nAZpCf9kcyUelTVnC3cSNyeiuC3h1e3Kw59f4g9HPHvwsrqXc9mhTdThyakWu\nsxabxfP/aVrgkl4x1EhsrL5du4xpWDcx5mLJHleweRU6DzNpQuXlzkv8a4sr\nu6pDp3SEZ8QsAfAos/qgSFs1ilLCYo67/G53K560vYokprapou8sPnwHxfML\nA1AC6RkjM17pehhBhCwqzkn6Z9JQeR2fjT4M0o4+GpZhqrvSjWgYGmqikXvk\n2jpkvhk9PubDepJSeACmQHbYRfbGVR+mWhqmSmGQOCv2W+k/x4QQSjraYS/W\nuUa41YCY1ZlkU4/DAmcRq0c6e4CAR8UadZkxiQu81vbJaKmTMEJcpX2Icx7g\nPA2wKR3FwhjM3skB3ZE48/s9iPiE5G23PFvPl0yEdFTI6IS3siINIrSnQg+n\nr2txWaU1TV2Nnme+Clf+q4UD2T9gowau/pl7PNB9ZR8mg9zCc9rdNk5TpfjC\nlNPfMyuTAQXbkIkavYcIOswNv1j0OsSxkZ3HEvdLWlvVMb3cnZgeiGYDZeMW\nEKkX5EXJl4u55hLk56/USVcSOG79Nz5vnYCPZdDMxgXf/vSt7orhTTzsDuaE\nFIrW0zNRXvApdxAO/P5bfRS+cj3PPqi6CmRQYCdAjBRkKy/4NTL/HVOLnOas\nTZT+\r\n=Q6aL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDrPKnZV1G2MPGH09LqdAFrL4UE0p3jNM/IIW/79Up3qAiEA1OZqsLWkQHjOJ2rMNVmIyJS0ZzN5Zgo40h64kepDgtM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.465e7e1.1_1565136851858_0.6176471726183104"},"_hasShrinkwrap":false},"0.0.0-canary.465e7e1.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.465e7e1.2","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.465e7e1.2","fusion-plugin-react-redux":"0.0.0-canary.465e7e1.2","fusion-plugin-universal-events":"0.0.0-canary.465e7e1.2","fusion-test-utils":"0.0.0-canary.465e7e1.2","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.465e7e1.2","fusion-plugin-universal-events":"0.0.0-canary.465e7e1.2"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.465e7e1.2.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.465e7e1.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-X8fTurxTAA++fp8hgFd6Q8sF0HsGsxaGhSV8w5lMYpURvMPGrrcXffijW9I/FdoTUG/me7SrnQIJyBE3BOUUFw==","shasum":"034cc7ecc99aa1a1676f4cf569d1e06596fbb04f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.465e7e1.2.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdShgNCRA9TVsSAnZWagAAEcgP/A1gyYwtKc9bMfHe1QTZ\nHECJ6X89hb6a7shuUqyl0zhUQmDNQ9t0Lpjq3KRAeUFyA6onyMBSBcIVfUj5\n+PXRXWn++2Q1sBSicZ1tonzgUVLmxBuTB5VRjWeD8FjJgwxmIK0CnJBhyPqk\n/TqPq2z1qo+8ZStFgNC5p7Sinc9CZvkg5Gjt1woDbvQfKpvlR734Imi2NMEM\nYDrTLO5QblK1jc6S4wCGIDG8QPtcDHA/q/AZt9HTJnj+HPl68T/9skQEPaNz\nAaMF1/VrjAokS+JbScTRq6Q9y4Rvg69gWtky+00cqTWCi8/mL1PrgvD3CKIs\nPf/icpWzYu2yejRlb0Wfmu74GapEG1ToPYVs74xMpgiQk3gpS8XiJLAnnqCm\nZxUpnKdKiqdYKl3NoFSfE3/Qx0AFQk6M9DjeWddo79W03Wyw9GYfSY5W5Ljd\ndD+cGg+RAzb55jKhWCB8+EO5t8Mnian7ETI+ZrrdoRqBA8Llr1Z9Z4PxY8sD\ndWvb0zFobDwl3appy8116KZuPUdSeK4SixpVbM9siTtd1YuebJGCUMv+ZC37\ngxyik8ICS17c/Z7fTVe1SS+6Y1X+UrA2D6jJoswHnbOxxltdPm1sqG8855IB\nQPlHfXKFC46xm7hr2NQq5MxPRYG5Wuv6Y0zgbCKE9V7IRCgCOwZ3QwSV9rKJ\n+lFn\r\n=w6ng\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHhFk2hi9WHQTcaySPA8z1gUij0YRvUi62+NXpEs1FmgAiA1Ehm8oh55fekpF+9SyY6vVygki88npfGXEq1sW8vzgA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.465e7e1.2_1565136909024_0.8959830465644694"},"_hasShrinkwrap":false},"0.0.0-canary.bd48967.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.bd48967.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.bd48967.0","fusion-plugin-react-redux":"0.0.0-canary.bd48967.0","fusion-plugin-universal-events":"0.0.0-canary.bd48967.0","fusion-test-utils":"0.0.0-canary.bd48967.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.bd48967.0","fusion-plugin-universal-events":"0.0.0-canary.bd48967.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.bd48967.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.bd48967.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-dYx0QBpWOWKfooxi7G//9q+YCxq5CzG/6UBg37RRnrHO8MZDtjs9SfK8YgZWGJ9RMJ6/lx36oCvdEmqkhO/1WA==","shasum":"3a4397414d4b01251caf5bd008cf24f4bde0ab2a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.bd48967.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdS16bCRA9TVsSAnZWagAAxb0QAIvJ0qkDDGxxTo41EwcT\njXYE4IQoerc+DZa2QDL6pHt5YJSP6q+n00LVFyb2sfGu2dBsCPXQ1AHFj/WO\neY+S0veSHKPRMy9Cy6IWhJJ24o//7/BV1gZaN8f0DVUxB2qEBxAIcj7naagU\nnbMYXXCr79sJjgRjHI0Jh/tWrqeA359giGrF5/YKhWwHZyu/k9iPvgwVBy4Q\nE73BZKstQZid98o3IFhjOY4HkIkP0ZgoQlv4fuBq5GN//VvVFlTML0ztYBqY\nkgaXizvy/gcG4brQyBOtFQxXqePZsJMYfi7I+yqUXzzLU9W+e30D7ih5H+4N\n4pMnFZVlBDf/r1rKLLvv1RGFpfyZBYJYcJHYGCSIB76EbXNq83QUbJlHSB/R\nim52OgKvmuTZYOTdzX5h7G6dSA5qGfe3yFE7MuDhlLiqiwvrFnPwzf3NGEJl\nGFfFPFvIShQijBBgAoBxF6EjpF62yyvA+wNUD7EXIdqDxzhCKBCc+oG12/oG\n0YNcOmmBU6OuP+2V45USWg7ySAhBgEBFE8/gpVcNaxETIxk2KvfYBsQDiRE8\n1gTUx43BQ7NkGitdGRtnvrUTMPnHAvJ0BR6k4OcCdBj89u1jxNS0uLPU9i79\nFc99Z5YnNb5Ucdz0KXQhWjdv+xjX681gmgYZUPQsLdOi3oqt14O0G8sLpcFC\nkun7\r\n=FFKI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5NQLPUsJjXm74Y0T7QB8dO+CZBN4Sy/0OzODMYZbCOAIhAKJtGA7SsTm5uONBNf1QLAzU0fiG3Bs76dm3fBH9oiWr"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.bd48967.0_1565220506918_0.47592648541638316"},"_hasShrinkwrap":false},"0.0.0-canary.aa5bec0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.aa5bec0.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.aa5bec0.0","fusion-plugin-react-redux":"0.0.0-canary.aa5bec0.0","fusion-plugin-universal-events":"0.0.0-canary.aa5bec0.0","fusion-test-utils":"0.0.0-canary.aa5bec0.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.aa5bec0.0","fusion-plugin-universal-events":"0.0.0-canary.aa5bec0.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.aa5bec0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.aa5bec0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-cH8aj2I1t4GaqMYoYOjx+klY0Ic/95HTzHG48GtXQlHMGG5eH6SedbCkqp0+S+05gRaCAs+X/9n4NC3gFg05zQ==","shasum":"4bb563e1095369e9689143902b26f607fb17bd96","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.aa5bec0.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdS4AVCRA9TVsSAnZWagAAU1MP/iSYVxT65G+OYrHJwv8Q\nktLaNVuRIJ/KieNT0KBt+vPJcErPFYVc4qP4Wnj2//Z87bUxUN22XZwyBkXs\nwFmKwC8g5imULmtNyr7yHKtjS+/PSL/voqZEebMLiH39ObCJf6vC8zY7Byjv\nDZkRiY0xhkxqhnSG+HDbEVpF78Md9dDLMTRPbXdPAi7mG8ePWyiiCLKHv7iT\nacXI1ndID2Q5h5UiKoUfQBinq7vRBslwIBAJMo5tel1UD19t0AYC3uxyAk7O\nvdyEcJxfA0d0CpYkbhBpcL8s5DPg2iQ39BcGFwSwv3Q/BZJUx92+SIBtpmjN\nhQrNTCObT7ZVeMx15HWcPxUyt+NG8rKfkB4VFOq32O4/R4v8wK+Ob7LSrcHN\nRbKuJw7xiBn5xvRziOf+Yq0mw6HyRKV810IcTLr7k+kAqqq6uekjMDhxzjoh\n/VAEERUnCWyq6b/bso5cj8LRk7DeTEFv8MxK1Rl8HjaDkvI8ooX5JvdAlD1W\nruG1o6pWa8oO1gv4lw6eflsL5pYUtJuhItwqUWIdY9dD7W19hKyySxoIiylJ\nK2oAKHGWh5O27dxYdnSy62KA4Eq6i0fzP72QYkKFB9HXEiC4ohEK7IvpLtA6\nRqSC1KUb+p9cN0ykLOJFTaro47NOkgdkcjcJdFYGw6NhWBgvWs0YfQCocIaF\nQlic\r\n=jHu4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAPQ0wBSXvoOcaZwgtNXHfxRzrdsZ+/evW9WYv2W6zGXAiEA0FmZ3ioY8j6ojnAq13CCYlVeHNRFrGzFFe9nOgMhOdU="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.aa5bec0.0_1565229077210_0.36342536548011206"},"_hasShrinkwrap":false},"0.0.0-canary.4c8e718.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4c8e718.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.4c8e718.0","fusion-plugin-react-redux":"0.0.0-canary.4c8e718.0","fusion-plugin-universal-events":"0.0.0-canary.4c8e718.0","fusion-test-utils":"0.0.0-canary.4c8e718.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.4c8e718.0","fusion-plugin-universal-events":"0.0.0-canary.4c8e718.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4c8e718.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4c8e718.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-x69cIMEjzlx0pfFeJF/QuQP8Q/kCparWCrY7ZojHiaayYMyvFfQwDoKPKxcZ63wYtDeEI55xNxO4N6jKGrWsxg==","shasum":"12bc8243086a0ebd984737058b9b07af95e8968b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4c8e718.0.tgz","fileCount":17,"unpackedSize":41731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdTcnwCRA9TVsSAnZWagAA4HMP/jSmCgDiHgWNKgdiFgZ/\n373HsmdZKbUUrkrH50VbJw2aR79/8HvpFMaWMsBGA8SwoyjdLixQxm76+WIS\nw7PzHpwDtJixGZ9+R1Nz4i5VeEn8fRg7cD9dvfRfg4IV07akiLfvtZFDs8+K\nb7BLUFzJdV2AgWubK3J94b9epixQdwjmsFJQYZDEwhZ7i9Ys5+FZwiJp0AYX\nVlMd6R/0zIM9Pp9WUntRBHrWdexfiarXAy0cKcz4GQUtz1rialw4FpNN5C6s\nlBJwLsJQegeYEsHhQwGCfyR6CHuNy/2nY0qu7HIh3PR4uhEX6kJClcYICgMK\nST29r81uTSxld6VBMQFR6uIiaZV+0bIOBYHr1nF/d+3YDRqGg6nSIyEtOhtW\nSCAwCX0XELhPFsNGu3kmNzjb/23rVj+i05fnsV6nJngHQAKN65IiHXo/wjxQ\n2E+rUazzC8pLvwTci4O28VToEWoCiIHqsgTTqR9DXIlZm7qwGNx69EbAnqcT\nJH7DljhyurUpCigtQ4v89MaC6fbqohoE5sT4Ufw+egivvzmqmw+ZEsHnZAI4\nT6ndRjLw/WD4AE2tJJLCNGev4CummKZb79D2N4SlR4dxn69DUXXqiwlzKdxE\nD1Gc3qckJKVydmyRhqLAsTre/eMqxSVHz21V3jJhIsk4o2oL5NaWG9w6aUKD\nUXH3\r\n=+NDo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4+UhuACxyIkHMQUxd+HYXa5G1FxAHG/v1tfTs6Z1s3wIgYJoC4Po68baIUpA14NAkYmVLdinEsTltJov3uoXnJU4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4c8e718.0_1565379055356_0.9548787021063749"},"_hasShrinkwrap":false},"0.0.0-canary.e3270dd.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e3270dd.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.e3270dd.0","fusion-plugin-react-redux":"0.0.0-canary.e3270dd.0","fusion-plugin-universal-events":"0.0.0-canary.e3270dd.0","fusion-test-utils":"0.0.0-canary.e3270dd.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.e3270dd.0","fusion-plugin-universal-events":"0.0.0-canary.e3270dd.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e3270dd.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e3270dd.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-heqCNUmuwwTEXWuL08YoFH7WG5v6cZe+nRpz3rP1eqdbfiQ7SYdkNBhDHZpwD5X7qnMKIfjNwQisEqosgzMq1Q==","shasum":"cc745f60692b96bbb50d3ecc0c057acad62b21ed","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e3270dd.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdUaRXCRA9TVsSAnZWagAAk/cP/iYOmAPcF6HyYrYN7wuK\n4To+LHyutlz/8rs3CKNPkUiGiMSyWengHkyCIXBucNPNJY2dxhnuUr8POmOf\nadzTZZtDVn50J1MhhZRFB8TvgH7EWGWoGxHC9ENtY8g1U+i+0i6pOHNBFQmn\nK92gOtRlOeVXcjguBuUXYYnnCk7FEiIlMviZvptY8APQf51802pAOVUuqc12\nRlaLQ8SmMhA4iTm2cRYcJ2HX7RiTHbUuK/t+9R62xSuxjmLvf21xQ9DweHP7\nrYg5k6ybDMs5JohGcX6vh7uYBCIVLNTJAnyGvRV7vNlV9lB4h1ey7PnYbQMQ\n4/eBsfwVHmiBXP3ED3TSjEiDl3RQyCiNKOwVk8bE751ADpgcZFe5b+kzwOYH\n19pZnOhB9n+Rdjg9VHnuSI8TjvG394su0/MoqI6t80iDzkvLPfe08TWz4/Jv\n60bD7LOMVQQfX0db3cpnfIMoBTZi+QJSOLYfD+t5UKFE82Cyiwsua3Os42ri\nj8DDAOZsqwN0Qw+5AlKcevb3C5NJ8XPoB0O6f5IJxV173ppGe5CtzNidf/Ws\nwaAz7mKNQpwHwKlTKPBppkm6tgKALBeASxMhgXZ1iDGtqJMCj1+6BKrYzRiW\npTWaPlfqamMnZT8bZNPT24OmbumqXg88ZCEFNrWkHpm8yXmoaHpfQmisuXMG\nhiyj\r\n=eJ/m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHSJs/kVWe74tjPttRcq+N/j0Yx3EqZku90FwhDJA0NrAiAXB3TTE7/HYXUZl7ht9iaKhIdq/0k2Rw2iHW0y6XFp+g=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e3270dd.0_1565631574174_0.7493304063476862"},"_hasShrinkwrap":false},"0.0.0-canary.73f956e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.73f956e.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.73f956e.0","fusion-plugin-react-redux":"0.0.0-canary.73f956e.0","fusion-plugin-universal-events":"0.0.0-canary.73f956e.0","fusion-test-utils":"0.0.0-canary.73f956e.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.73f956e.0","fusion-plugin-universal-events":"0.0.0-canary.73f956e.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.73f956e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.73f956e.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-yXYuisEJKXm7tcOr+BWJdCmord2BgSzNljx/4vLmLtZHQ+65JaWUotz/Qiw8r1jgdizaTT40MoqzIbp2GGda8w==","shasum":"daff6acc7001bee37007495fa824a96be8784a67","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.73f956e.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdUwu9CRA9TVsSAnZWagAAzGkP/0xt1cwg2wijBPnqoJWF\nVGKkA2CQA+ymLLul5KuWouAeDNLbcbyZXw0h3KpVlUGO7P9pwFTRUZAuaVWy\nMBirLjWg8JukxYMSBO+AnC+QU7vz+zSoF+4Tay4+UyNDfdEh8qR+YNpW9lkx\n1rLLPeNcJ4UAViCKnNhipQShEuHjp4zH7NNEtHEXZqLLsFTYDKfZ7MPysij9\nQKBKQWdyzG94GvGNv3opvfLTMX4/PNssYc2Db7VbRT1ifaKisjLYZzKPCPGf\nNRDnAjm8woHLmS37okzuDL/bqazWbV5JsMbIzCVHrTP9tbXY8iK5HCzoQuAa\nkJjL2SS6P7nJqnPyAbsNRY5bd9xiLx85wEhRcN16r/i5z5917zmE9oHglnM8\nDDXOUbhHlRsy98i1cFS9Ps1ocqjvNcR42kbE2YxB6Qog6TwdnYkXzPjXSxG6\noJC/eCsibKjEyiwGdr4yT9cMiGmKEdFtGljjXCRuoXQqPROzfI+vhrmOqRUP\n+UNASwpllpwM/f1F0DgdlIukvmQxCEDDylm60iiBlpD9EEu/AwXzkvg6kBUP\nVJ1by5MQF5rmMuT2Tk9ftJsxGzP+VrNLHG3M70m1DW2UEDJhrbwaFEOliRPC\nPpVBNnyUl7viLYzDof6vuVQPTjyyzIZHwhevzwTc1PXVRS1r5XLse8XuIBG7\nb1ZX\r\n=LR/h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFIMoUA8eNBcx/oeOg5rISnClNkjaKUI5q7pwMgrMfRJAiAI+5ybr28gTSat7gUbG3Qit7MWdU4laX9PDyVi0QocLA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.73f956e.0_1565723581150_0.9609384083014858"},"_hasShrinkwrap":false},"0.0.0-canary.1e7190d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1e7190d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.1e7190d.0","fusion-plugin-react-redux":"0.0.0-canary.1e7190d.0","fusion-plugin-universal-events":"0.0.0-canary.1e7190d.0","fusion-test-utils":"0.0.0-canary.1e7190d.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.1e7190d.0","fusion-plugin-universal-events":"0.0.0-canary.1e7190d.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1e7190d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1e7190d.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-dGROATlMx86oMjQ4UeueDKk5Ps83wvSCU++6u6keoEpp+hDelrTYqP68mytakB/9Qje0GBt+r1VZv+XOj8Y7lg==","shasum":"06ab59ae1daf1c581dce014d08a7f53b6d034e1a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1e7190d.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVJcFCRA9TVsSAnZWagAAVFkQAKEwaCE9fiDlozQo5rFw\nm5dlrUCnsCwX1x3KAbVb9IgMyNo/z+XyRjvGjZx/BMSGIlmRwXOca+bIWwo5\n9IS2TyeYh4YiJmsYak2Jy0U1Pv5xwW8AnwUH1GrsUvvODE9ImHbOAfkciE1Y\njeTPNiXvtQkaXVVJWFGY1Bf73Kb2ArM37VFpf55eff7D5x+x+vb6Nl/y3SoT\nwQPrZUKYPf1TUHCp2196LpWz+l0jH72ciVA3Zej0F/iFzOJccX6WvNZAupX3\nyidL1V+gji6MqVrqr3sBTC+ImRpPOpI+4zJAY7Lqt4re8inVcYFOakziR5kQ\nKyJqlDrOtiwb6XRQaOPub1fNA/diKH9O86NZPSXEAxgJEWm585OnDxrgNzTi\nvCu7IsN+aqpd3ZGw3C82LlmZRNlF+y+ok0lNnz7yq8PU4Je+sD0rSRqb7lEd\nL05J5JGAjO1x2BtwiY8kdHUMqhEd0ePGR4pAxBQoAByhnaiVcfRAsjKeyZOt\nHI4fgOGomdJlcinEQ2yguRVqEzlaqvDgZpGYz8jJC8zi3mGkLe10kuyDumON\nemZjM/1twFb1okkmpnESkRu90Lm5o1MPcOGfpjSKo8ELXNDg+7aWpV/g37LN\nRbnfRyZ+CznZ0G2goEDlntt54mhzWWLYcQGGX/HAWJHfU8ZU37qmAAKenlUM\n3NCo\r\n=R41X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwhFs9Yksu9xoFefj+y8RFb34svnrhm2u2hCF2QA1GZQIgeU0W5IT3HzH5ydmmWk4H8SN8nicPqqP9brEckdk4gnQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1e7190d.0_1565824773118_0.8898665282228366"},"_hasShrinkwrap":false},"0.0.0-canary.b102bb9.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b102bb9.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.b102bb9.0","fusion-plugin-react-redux":"0.0.0-canary.b102bb9.0","fusion-plugin-universal-events":"0.0.0-canary.b102bb9.0","fusion-test-utils":"0.0.0-canary.b102bb9.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b102bb9.0","fusion-plugin-universal-events":"0.0.0-canary.b102bb9.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b102bb9.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b102bb9.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-b1JXqqIWAxQ4bbKOQsELupq+4I/QLBTJcCbpewQJjd1PhHMdj1byyYeTCtiCupwM/EmXDh+G9v9AxyQL6g6mMg==","shasum":"36174123a485de6c167e950cbd754555289373f8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b102bb9.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVb7lCRA9TVsSAnZWagAAb/YP/04CzXhyKyItV7FFaVsO\nXGyYDPUa65rH9I/puOcysH97CmXG2lnhz95XKMLex6Pbr2e7GF+ynvQk/Zsc\nbCQqXN5SN4kc0tYpgz4iegC3zgpL2pCKPgxiz36b8kftAtz83ieQjqNb8baz\n9pkayCPo67xFFBzPSyXx6luPxsxdZ7unpPS17E/kkKxkidDMrGJPwbobV3We\nBrfLFpXqJPyxVB00dWyiQohPLmMaHU2b/NaizfUMpLdcPjSpVg1m+CxKvoGM\nHK1eOHk0f26hOFsKBJB5V6jrmLw2lnQNrvRtfWYlykuQyz92UfxyYtEUuBZY\nVofA7hGvFLbzJnIL96iLD7wYXIFfjuiRdvsYPNY24PypWAte14IJmMSP78nZ\nbClDq77mAOrFUOMK4+9+Ay6YlDl1dZx+kZs7QtcsIX3UHmtFNeKBP3Y9WGIZ\nJ09BXIWwXfpnSjoABnoJj0CJeEvXVVAXQZjWfC0Q960NWPvgV+FGFZe5Q0kn\n/eyMCgIUVBFaPbjckD+moFVF+deN5HlWvUQ7nd2MFVwt81SMy7z6rH9cv9jE\nHA4spMMGtOqJ3xUuJ0fwu/YY2FcdEB8QQBTChTtKioyN7OCUzxcB38XvVLDe\nZsahYhHaKT/+h5lx8R7R2BfHfairDGTAF3u6VcltaoeSktBft+Mf25H3whPy\nja6A\r\n=hPPv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBTzRTANlsq4pfTH9/ceiq9/bd3pWMtLvN4VIC4ieLE1AiAW4vlm06eAXDyAXE4Z7iFz8543vHXKwUDNWw6VOL/RJw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b102bb9.0_1565900516635_0.3959167412660638"},"_hasShrinkwrap":false},"0.0.0-canary.ffb0ab3.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ffb0ab3.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.ffb0ab3.0","fusion-plugin-react-redux":"0.0.0-canary.ffb0ab3.0","fusion-plugin-universal-events":"0.0.0-canary.ffb0ab3.0","fusion-test-utils":"0.0.0-canary.ffb0ab3.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.ffb0ab3.0","fusion-plugin-universal-events":"0.0.0-canary.ffb0ab3.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ffb0ab3.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ffb0ab3.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-gVE42ycUhbjQghEEa5qxWfVqCdX3MjRFnK3lqZik0g8axu8zxZ2qAVy8QzpP5y1Cqb7pFbMjWMG3FobigOI/0A==","shasum":"2536b9c0b7e50974aa88483f508f59c9c581497f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ffb0ab3.0.tgz","fileCount":17,"unpackedSize":41905,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdWs3eCRA9TVsSAnZWagAA9scP/0cY/BdYeGIgYTJM0h+4\nweoylXbe35KAqnzKS7lshaByXam3k2ARhWQDwwRHW4sym/hVqo45OGgZ+MBp\nGeGizK0kjJcnV3bqzMxRCgbdpPmVDyT7iDDcYEN+/yCc2xGffBaq8cBZIS9e\noLkMlwyOkdERGkUA8msAuuayULf5r8yPDAElLek9cPwVFz40WnEJh2OK3BK3\n1B+wFx2z5St+OgnxDkEGbuw0RSosvkfRbxp+P++A2gpDqwhVD5OBud+dw1OV\nr3l2Q/XSHuj0yMmtzU2FyfWiDtqTfwzjRejBhVw3C7fvlejU+e1NFlKYZmYu\ncnpl423L+2G6+5gq45ngwREN6oLNEJL37zL7NIrFFOCb/aW7MjV1pCrsRtv6\nAfAYD/D8kmDVOOGuKJfLIpMNAz0HLEW9Go8Um+apn8tWZHOOEL6FdEQThA41\nkA/fNMDUXnjAEdgWTx5pmlXgiEa0gU2WaawQ4tCfixcbbg6G6PCIhbnMAWbC\nwMJqMk1n689E/UYS56Yj7qDyNw4NDbiM5j3PltOAKPoxAlpTColrcwTTfAMG\n3e789JTmsf5t3yTtMtXjoW1ZUOLVUXeN1Vu2SwOfiGpo9pY1yBo4L8GNts2D\nv8RmpZtK5Gj/g2yhSQU3xI9ZxK3TgobWCgPMHFWqjDe1lQ1oS8bTqvwegH4a\nUe10\r\n=PIz1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8pK5YqYSagoC4e7fFZrCjTSti+CbZ6fjUTlgsyPHHdQIgH/1Iqj4V2so2xMXYcq7CtfmL4UdQockE1ja44Qw6LvM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ffb0ab3.0_1566232030117_0.345117863366204"},"_hasShrinkwrap":false},"3.0.6":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.6","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"2.0.4","fusion-plugin-react-redux":"2.0.4","fusion-plugin-universal-events":"2.0.5","fusion-test-utils":"2.0.4","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint . --ignore-path .gitignore","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.4","fusion-plugin-universal-events":"2.0.5"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-3.0.6.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.6","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-7X+L7pFVvYIrl1R5+zYKsij5zimCIXWkHslmMSN0pG2xrh5UVW3GUB4SjJE/9EWQozXoYRBK/DrqFMF8jMcBQQ==","shasum":"ebfb1a91f4f98da5ea8aa2040a4841a1ff3a7d72","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.6.tgz","fileCount":17,"unpackedSize":41786,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdWxN5CRA9TVsSAnZWagAAz0AP/0sUGYl95TkQjoGz/8Ua\nRE9e+EFeOKABCqOKHajLkls7x5yHwkpwv2SfdWUEsqfl82ye8bvFydMjG5g8\n48owvWHzU0k6agOjYbMIxx3fSt+lmlh4VyR8ejBqlrJEyhLipq4THDKmxa/C\nrE1O5cKGKQ5/ZxQvg/0BytqOIHsRmYSI1UvbjkRtRKRsgAWLiUVFBkXhCfml\nZ70ai+dG1ZtXf565nKtfrx8Nevmmbe7cjPCm8eCPJjaDd4r7yvrwopOJJSC4\n6YvqdSkiO9zhIiIu7eWQCokRBaD7Ikfeo3+ZKQ7KmI/haG7+q0muvSxKm2Tz\nxEuWEbIr/kmugzgHBtVYzqF3C3PNI+74+Lgjsp8oU4fxSxZD2cKiI4ibMmIE\nda+8x+u/UTpvp4ARfy67c/Vazou+FQ/Twe5IqudGYojFl66AnQx0hf4hKoCr\nic2qxodlwll4L04KS2UI37oNmlBfVDt6GxNRyeJ/ciciXGjuesOfzqsfzLtf\nkVapK4GgLep2BKxaNZvYFkxNh/vxsRHYLC7A1aHHEJApa1kHstEnfD5hA9oS\nquOBZEFJ12TL4KJa0o2QrbW1rBNm1c+0Xbhn21EJjeXWrKM2j7EFSni9YmP9\nGFJvkcqaccri9E2AbZB8X35jxjKWIxMu+agztcLYT801wqrkQG4RBZTgLPJ9\nyMWb\r\n=j5Wa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGoXoC6PcGemRCu6IsLojUEfylQZonHqGC86AWTU4ll5AiBNUz476NLqZJoBYNHByck1nJNIVmAbOEqfOrSWPYwvSg=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.6_1566249849453_0.4532003638625566"},"_hasShrinkwrap":false},"0.0.0-canary.e2fcadb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e2fcadb.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.e2fcadb.0","fusion-plugin-react-redux":"0.0.0-canary.e2fcadb.0","fusion-plugin-universal-events":"0.0.0-canary.e2fcadb.0","fusion-test-utils":"0.0.0-canary.e2fcadb.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.e2fcadb.0","fusion-plugin-universal-events":"0.0.0-canary.e2fcadb.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e2fcadb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e2fcadb.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-omLeoAxGtbP980v/hAfadwrjKw6cDCovYAp7fuw9XRTzMf4Qnal328zFLhe09L2MiLWNT16f4wrk2Kf6Tb2J5Q==","shasum":"bbde13afb3d681a109a16a9fd227c45eb90f92df","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e2fcadb.0.tgz","fileCount":17,"unpackedSize":41871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdXwfrCRA9TVsSAnZWagAABAUP/RoMTolJIUaYG4vQb4Ds\niwkZXpAyDX5LYJe7Mc1pdHo3v1mlCONyljA3KvAl+6zMCHLTkCe+tRe44vkZ\nyYhxtxzQxJiEFqBnzNzkIXAsZDuJxamhK68xe3DOHz1soB3UoA+VRvVtDQxp\n3nwdndTP+VfPL/W9mo5eBzPtafjFCyrMif0HtbV2lzr2a2jbg67pVu12X/Al\nyxOtxT4YnWa0/TBY/ZkVI+4DspzFwPEN8Nsm9g0SABdk2nRJRL0AyvXzldmf\nTMoXGgKT5DloHg4WLbRkbH3zHYAU4uMcM8/dLIrKNtzUUdKjDKNwdDGM27qQ\nvIxuDkNAop/7ZSY1T9OjFbaiM0mlIa8w+1SuJ0B8wAKslyzwhILEJxsBCxjj\nj1X8bdNdPtIsw2jIdBkxiwzoZM4PMS6UIthNc6qW1oKJxK9Ucn/ulHrX2KaH\nZ7QiNtu1SIcVfuFD1rLEBqjriuGQkD6tFOZ+Z6+boSTeHS/BWwf9AZ8PiKvS\n+JLn/SuIxx3iJmcDhQkBhl0IHaiYUOGmRJ+DFaGDc1XWS35S6A+SgT1RpfAx\nRzCWMLLOBXXlba7NjhjrV8nPMP2pTSv79QSV4DmdnCjfxKJveS0IBw6TWvfr\nxkcduH7fyaTKmqPB/UH7OkM1F5sM0RGplOvwHm6pjjue0Q1WJzz1fWwwJ51W\nef6I\r\n=VwL/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0n8LqKKfCwSsMF/JFbbIueDcm7qi7Fj3FlUXtZzgK4AiEAsmCuXCTwD4VPEelEOey/jWJFC5RjNrTcDRSVadLb4UA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e2fcadb.0_1566509034500_0.6318835257384561"},"_hasShrinkwrap":false},"0.0.0-canary.d767d28.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d767d28.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.d767d28.0","fusion-plugin-react-redux":"0.0.0-canary.d767d28.0","fusion-plugin-universal-events":"0.0.0-canary.d767d28.0","fusion-test-utils":"0.0.0-canary.d767d28.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d767d28.0","fusion-plugin-universal-events":"0.0.0-canary.d767d28.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d767d28.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d767d28.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-f4+sYyw5BYZgfj4+NLlH30jm2jWEJiAj22Ts7x8ruZRJCtB/g5nCvpXZRDHnRc3ab4Zw8v+Zc/OHgvBjNhdV8w==","shasum":"d7bcc20922f5c045af5ac8c868dd6f2c3132a2e8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d767d28.0.tgz","fileCount":17,"unpackedSize":41871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYC3SCRA9TVsSAnZWagAASqkQAIsFfb/z2748qJWB4qqe\n9D6su5FVzS4sYuhuySzprnAnLwrXuU2pj6PotVVe9eOV4bAHO9IIetQPqcCc\niM/Qj0+KO9uvJcBxr9BcNxoOaneLuWWo8P+IjClAHE4nDOMde0MfznGvhSWv\n4fOdrWRBHhdWeamBQrLqzodT1+ac2iHzfwrR1Mz7BEUJ7VC140DXjyPD8kFW\nVy1f8NXPjp6EushHlKNEtcbGGkq2VhdKF7fL+TJFc8e9EdC9eVkc5IgNvZWr\nhzB25aq+RAgninftJ2QCQ0yxZEDs61v1myYyCQpr0V6YFttoahnsC1hnncmL\npElaj3oB83snwqkLOKGn3Q2KD0gvr9zjSvEEWVwyERoOJCV5P4xeCnGfUhwv\nIh+mRoViIralmk0psr6A4S69scb2veGh3dieGmLT9Mea781nt562yy5QahEd\n0DQRBYsT4s4j/jsMHg2NZZj9kmvm4FUpVd46crjhyrR9dRFfMhS0e7wtvYbT\nqulhP/WghfyBWt6qBFpcbxR12/+hSM7VCbMI1MUGXEWKjLjdXzNCBrpU8hMJ\nZOnFND6myM7U8sHtfhgy4UhrG8vmHTN+hrthxKKontX1qKR5XNfLfwbfVNhp\nD+9vp7ZhaUA11C8nfLc98B6HhlIoUyx0VMrytE0eW07Sjr5PVP0Mj1g+6d/K\nqbBt\r\n=njQZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMl3tzs1brVDTluMEeuoY2YWDQfg3sGZNlnnOVK2/PSwIgK4+QNi4qdgPrwQgtAIvkb6c0/OyURGvMzq8TkRFPnuU="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d767d28.0_1566584273786_0.005668841986936846"},"_hasShrinkwrap":false},"0.0.0-canary.c189a42.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c189a42.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.c189a42.0","fusion-plugin-react-redux":"0.0.0-canary.c189a42.0","fusion-plugin-universal-events":"0.0.0-canary.c189a42.0","fusion-test-utils":"0.0.0-canary.c189a42.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.c189a42.0","fusion-plugin-universal-events":"0.0.0-canary.c189a42.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c189a42.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c189a42.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-lJuHpb9raoYof3XauwoTS6m84fhPpLVto4MA7GGHvIK2/hu1eN7aUHdS8/26aZ4Eh739LTC7/ogYzmY/yn2nOA==","shasum":"27814bf778a12bbf92dd560e8ce92a06a44fce69","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c189a42.0.tgz","fileCount":17,"unpackedSize":41871,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYExqCRA9TVsSAnZWagAAuPMP/1/+RXx4E+Sgtd8kciHJ\nHZoSHPGw1wXpXCDYuR99ui8Hm4VK8HpAAbXjBP9dPq8H76xaFps+C0fCK+OR\n2UmbtZD+Q8w15JvDCnc7ULICs/doeOJySBRiZYYxpYz2ajqUQYlGSXYWXG4u\nQTDWF7FG0MCV1qMDf7gYGLFCylJD+ips8NBfOvw91IVWbazFNwTD7tjmEwvL\nwpzIQNXCFeUaN+QGxyuIBYd5A+yJN/rUwEOfKHDRYdS4WHPRWvuY2nOV4qin\nlsX6PPNei0+PCtmIaaMiCKwtA/E8dGjeeTa7OJZRDef1AwCnXL/OIaG/BYhl\n1mXZJfqSTJ2AFDFRJPEytbd8qWP8qW+MdMT2/DFeJKvRGGvU0QZoGkGIHLvX\nM9wo4FWGnpci+B9J126wl8ah0pEUX7aiehwbr9xUKO/qkA9wfkC+q8TtdEmG\nz0Ktn493U4X3XIllMmdAnRT138YfcuNk43XUNcFunGwBnrdXVFYltrnwPT2+\nbDiEOgby+ffbiDv1LKLN+Q7npiSllUb0cVmHrzQn97GIggyhQLd7neOa1kW9\n4Y/Js9SdlbNq4mjbDb7wwjnqBAkzBPqBjl5HVwXY3pj5cGEMQswjKVNtTLKM\njXE0jNElVXnaEOTBx0fj5/c0crVPP53ztGoKdKjBVyMUoQg0ByWOVdWdaae6\nErw1\r\n=NKk4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDXUjgN4C827gy3NI7eVukUsZ22ZYGE5S7DKcki8nEqAIgEeggwgvUjy0etBiDWsds0PjpE5NqOYSsU7oRFI42GUo="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c189a42.0_1566592105908_0.04089886023725997"},"_hasShrinkwrap":false},"0.0.0-canary.aa40d96.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.aa40d96.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.aa40d96.0","fusion-plugin-react-redux":"0.0.0-canary.aa40d96.0","fusion-plugin-universal-events":"0.0.0-canary.aa40d96.0","fusion-test-utils":"0.0.0-canary.aa40d96.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.aa40d96.0","fusion-plugin-universal-events":"0.0.0-canary.aa40d96.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.aa40d96.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.aa40d96.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-QNlepzo1kLogeGHvXrOd29Q6LlEPhcHBrljgL0fwYWAs7PLKpS1AyzslXwcPxktsJEByfO2+hKF0BKWKVSnQVA==","shasum":"14a77f69e23e775d165b418ad172cf3734e6a5c0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.aa40d96.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZIpZCRA9TVsSAnZWagAAG5sP/0wvK3m7mqAKd+9+EeA/\njdLkAlSPXSzy3gPW9aVqQCP3tgqK2ka4p4ipouQ568glxwt4y6clSaAR5sQR\na55xg5GuQBToMaDPWu4WAzIkU75YV/2F4cSm7ICRD8cAC3ZI2VYt1P7EfifS\npdoqvM+DUK1A+v5QL+ZfIJzEXGb1KMH9c4YRFyMt7nOkMMJ3kKgrTPftcBjU\nB3FkRZGSXgXccaW5ykHw450bp2+yHSdIH2vCDqd8lPs3VpHdNaKIphxPd9Aw\ntH6W04VFSMSeeaVyI6dwXe8wxM+wCrNIGtruhYoWj1K0KRqVo5lTTwY5QKe9\nUMzG4lrI9WKUkFT+U6XJLA6Mgk39xC+3lICO+NJlEIsevqLqyqQqV/GbiHlV\nPLOD7VAiMcH3mKLrWxEWC4mF5epg8bZyHlkMzJHCcaBcvCot83Uxkqj9qvsl\np8d9LWcp28yZXfIatZHp/6UpaAfG2NrXW1Qqr1e8phouuoKtkq6lqoy5d8Uh\nLjLRvpcAb1PGa2i7SKCugee8VZIC8NU3KB6SEnREOYS5De6sDUbwhiKKd6VB\nNtSD13cqPcGjp1jAQG7RuFRw65XCI1tJDFxXathFL186OeWfUm2DFRKrIygD\nh7Q63ssSIEU5FC0RNybRy4Y0suKtQ9nFZ8ismY6O1dtaLBPcmXKMmn+96Sn7\nE+R8\r\n=572I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJrWoL7v89eEC7sKpvYmRa1S+pqmj5m6PljKuDVYHShAIgEgEM6tTZ1RqUJZsHRopymr+AIlJIAHwqCjUQZWmkF1U="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.aa40d96.0_1566870104796_0.0276800730922937"},"_hasShrinkwrap":false},"0.0.0-canary.a9d6e7c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a9d6e7c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.a9d6e7c.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.a9d6e7c.0","fusion-plugin-react-redux":"0.0.0-canary.a9d6e7c.0","fusion-plugin-universal-events":"0.0.0-canary.a9d6e7c.0","fusion-test-utils":"0.0.0-canary.a9d6e7c.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a9d6e7c.0","fusion-plugin-universal-events":"0.0.0-canary.a9d6e7c.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a9d6e7c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a9d6e7c.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-MOYNNFPVbNFVQF8/+Cm1yM+bp+bwmVT55H7IP2N6e6T9nnC2s0uQFaMoo4cvNbrX3A63BUqsYc9z8iiEH46MeQ==","shasum":"05dbf24251adea8abce5f133daeedfac74f9dbe2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a9d6e7c.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZWHCCRA9TVsSAnZWagAA3foP/2GKr7lxEn/pYzG4uODW\nKmw9NOSoUyVHQxbwQbbejgYVleuX3Ib+1PBMbNaKJ0wZcd3bzeHJ49HCPYSh\n8ODvmBjkI7xPg5a9qqa/4IaNQrZmRtAQhfhr1z5vyPLtGHhtC4tV25ur60gW\nUg1P3vup0Ww8aU+DcOWgv/KIddW4ArpRQrEKQnrcr3LAIqkOfLBOnIUTAjpk\nF+sj3EyrTvvHt1dryufyFxuZ+gfdAY8xP+ePq+DG00qUhZnuqhweSRVlbWyH\nCtAscKDq7UBPUy6P8IblwMcvgYbtPfWtFDETxL1inpfxw+L6tXPtmvw1UWfp\nzVN+hqY/CRu2FUSIQW8LeimC+isNG60WM7VnDH6jcAcjghAUkjy+BOoxp/Gz\n/hHuoyJPZ3SgeznlvK7zMgQGirNmVI0KUSW+5UnoLOfYFnKKKyIRmhdA2Heq\nFDlTugItL/QqVIzZP1Xvm6POMKC31mOYF2hBYxcBlY+h4nuOFJrNsqeaBNon\nLSMJGX/jnom0+PPPVEVioUoQFN/hmOXrqrAmzK4pe+LoQrbWbuKFY9AdlPes\nQKvJAGRbpBFvp0QM88YpbLypPQ/4ztuZpg3xj36TtuAXRfVFLxrrdn+SIDZg\nwYRwEJjsMaVUQnGFbyTJ0XpCAcBm/cHTZNd3j+VFNV4efw3wSYUEm6x/wO4k\n+hyU\r\n=XFch\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEbeDv78hXXbQa/ATLF7PNtYLd9UW1bJcFU4L4NO7F4tAiEAtURUE7qhW5l9CCoT7RE0NGbCM/PiLwbsjl/pAEs0HVY="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a9d6e7c.0_1566925249369_0.9402742228330789"},"_hasShrinkwrap":false},"0.0.0-canary.f608c58.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f608c58.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.f608c58.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.f608c58.0","fusion-plugin-react-redux":"0.0.0-canary.f608c58.0","fusion-plugin-universal-events":"0.0.0-canary.f608c58.0","fusion-test-utils":"0.0.0-canary.f608c58.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.f608c58.0","fusion-plugin-universal-events":"0.0.0-canary.f608c58.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f608c58.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f608c58.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-4VCw77yhuG5/39hyh45OXOKO5rczMxuGidFRoqwULtNnD+49kHjjDbqJWL3qP+M5GhhfBfe4If0SdE59J/TbTw==","shasum":"48474993178bd293fb04d503f42e7d3708150134","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f608c58.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZZQ3CRA9TVsSAnZWagAAPUAP/jqn/6SLC3ccU70ikr2R\n3perWjhwBmiJt4ZwURHaboBcdJNk31EkqjmYxhwBE8NlInyFLSo3OEpqfWpr\nL++rARdRFGYakuYzhc1u0i4gTBjFO6nUjzsOYsjVjHreJncf2QTGWFafLNb8\nc0q4QairXkJ5x07XhXP5ZahK9oP5EtlUfgwWMVeIF089ktCvp79BzUx1iSFn\nSUAuSZI4uz/AarPy8wA6aCcRq9SXPbSTMd7WAH7jW+HWd/Sh97xGzE3D1XIO\nKfubYNhUuHpLvaDBJvw/BFQc0mnKnILYlTYfrKOPN79ouMzZs7cYDLluj776\nOUHV3xhCiELa/MYwu6G7hMfNMbgdpbDlP8sCFT+O70iytO+EHO0unTkfp+3/\ngqNyf8QTygY/AK7o6EPLRyLfRrxaSYI4nDhhKFN8sqCrcLJuF2U4zvDINDMF\njU6ibluF2DwdAKMsD3Ku9GV2bzzwwEtCKv1sld/TWygCY1IU3xzzb7p8Acjn\nLzeFsAWmMfn9s8wwQ5Nl9jrkV2PHVkW3teuvy3Ae3bYDiUot4jNyA2zESjqy\n31PnQbEEauaDrrPJOtn0dIy0CNfC9QtOVDM52z/lK5iM11wATlTDCTXRY/jJ\nSEbckrrs5Shn0mEwzrc9yMibCGeW6XuB6NmYObIj4UnzFaqYt/tPoZgAFoFy\nw7aG\r\n=mZnV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEZxqkIR1q3S1jLbTgY4mYX/l1yntZ1I/in81h6j/p8gIhAKSaFpaGOXM7NJ+Kd4mYx6X/qzfPvIc28GweAuh0zEOO"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f608c58.0_1566938167211_0.6308767557429409"},"_hasShrinkwrap":false},"0.0.0-canary.9d5ef83.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9d5ef83.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.9d5ef83.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.9d5ef83.0","fusion-plugin-react-redux":"0.0.0-canary.9d5ef83.0","fusion-plugin-universal-events":"0.0.0-canary.9d5ef83.0","fusion-test-utils":"0.0.0-canary.9d5ef83.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9d5ef83.0","fusion-plugin-universal-events":"0.0.0-canary.9d5ef83.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9d5ef83.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9d5ef83.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-FZU/2cOkP0S8dEZ0OpJ4PScexWW33nhCVI5kUjVbluXbKbm2QV2OZODuX5zh+gDT9VIhz/5446Y5jY2sehUN8g==","shasum":"3eb6fede63c0aca32562bcc643cf2991c5e2526f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9d5ef83.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaAugCRA9TVsSAnZWagAAyMwP/inpHjUeJfjxVvGelAUJ\nrgg7E7e7uBzy48hBodgAanbpqxDpof/GroOoAT5q5MUwlPgr/RugzpbvQ1wB\n7mmXAUtsccChF2u373YSNwLtmpWDDeaVqhESSv3Bw+RSraRzzDN8E995sj6f\nFc8TTYXUwT7sorlSGjbDTW4J+JoeJTJg1AnZ23J6Qqe251N2z2nSpBt1PlOz\n1cDW8i5PrTc0Apm6daQTiPrcDk51p+IcviElEhmLn3fyBauQk6owvwIwpZ5H\ndhAGn9/+kZBthjq/NKzrROfzkujMZNcXwY68CoTd9kEFnEPak6pZP3HlfrbW\nmlduozl4YmRKU8eX+Wx8PR2X7Q2t/XHtpjEliamDHa/abfA7jORx79kjU9UD\nmnNRFM7Tpi4wwxAbpbiQcVXN3o8Vpg5sl1Jd09rfb6XDc7AWDQpCOxIRw4CV\nQNbH84NNC0f2aGFnYmHqddO2XJrIj7blR3fzb1gEokEmfRPKNBQtOyDdlgMl\ngUVLv4IXKW/2W6D3+iIEoGLBPqqT2EJgwODXTKn+i0mYqSPb5Ck7C840n3sQ\n2s6XLRmZiKHG7+7//WDOcUV3uN1KKNK6GZX1N3gyaZJXm1P9dOffwFz4vkxO\no4R4XCQI0Xpc9L9vM1oeLt0U/4TqaOpUBCe7hiLNYegX+hofAyS6Y0lLf6HL\nbDwx\r\n=JX8n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCGZ9RjF9QeEgBGsaB8ZeCDx7yCy+QWnPPSK59QoE8GgIgeXZz6/mSZlM0KRP23NcT/YAyGTwPaC+MlTBBsphG77U="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9d5ef83.0_1567099807798_0.7197409745126677"},"_hasShrinkwrap":false},"0.0.0-canary.096185d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.096185d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.096185d.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.096185d.0","fusion-plugin-react-redux":"0.0.0-canary.096185d.0","fusion-plugin-universal-events":"0.0.0-canary.096185d.0","fusion-test-utils":"0.0.0-canary.096185d.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.096185d.0","fusion-plugin-universal-events":"0.0.0-canary.096185d.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.096185d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.096185d.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-uxETPH8/TIbCrSfXWB7jrxnEGVdyjETEywi0nojPa+qFZDoaK1HCbzlNhH6HzchUzA8Cw+R5+T2dvXt1s5zMTg==","shasum":"70143a09c4f6ac7956e1fde42ddb58dae1b1fa69","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.096185d.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaD8aCRA9TVsSAnZWagAAa3YP/16j0BIbRb8cCrjHfS9Y\nSP8wsjoR1JUti/4XpoVc1NVzs5eMelRefCnrVlLbYt1crSqH7+VqYfswE+sR\nN34kJmLUqHK6pEX+PxfdgNdlocgBfJmcJRQq7TPsJYAVN4aEd28qIx/nDo4F\nqcVs81FeXhy+BWP64iV/kVOCyfSxDRLwWRqUS0HhI0OLYEHfATP5t8s4o+yP\nMv88rIzG2QH8VNj5eE83vEn10wNS3HRHKmsoowkEc2IGG6TugMAskXh5N8Sa\nYRv4Cq13xUCkqYq/orGRaGQE7eZsq4NaXBpgVSpD/0JeYOaaeY7kTZGm+K6v\nVIPjRHwupS9jdADZOF8ey44ZE40pWSKwoKD/X24ndxtsKTyyQqZ6ZuwhkH7D\nThxOiw/A/yjPPbu2rmTXHicm28uoidEP64S60pYfTvwz34HUdiVNOtEfC3Vk\nZNrHG76qH81kZqq6xCg6zQ0HnjXuHNCNJIEsYjaeZJf51pgdZrI3Wgy3qern\ndYtnDEicSeLxQ4h/LCF612DwuBRnbQzz4X4ocmzilK6LMg8aI7mIoJgFj4RH\nEimmWpuOIBSGm0d+Hj4nSe/hjWhraLSR8Q+/W2ko52FilCzvJ0Cp7JO5lfyV\ncxVh/jWvhsEuu+hJbYanqU/FmY1LKNIfqnngaHYZj8igeHI6B9c7OwUF6sad\nrkml\r\n=umRd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2TGWUQW7dkdbrol0w6DH7BEYcteTOpeI4pbl7LRXV2AiEApXqOQKp9NBUM4UWMTx4XUz4tjXE27MI7i5wp9V7ciRY="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.096185d.0_1567112985930_0.3467357317797253"},"_hasShrinkwrap":false},"0.0.0-canary.d78b7bb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d78b7bb.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.d78b7bb.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.d78b7bb.0","fusion-plugin-react-redux":"0.0.0-canary.d78b7bb.0","fusion-plugin-universal-events":"0.0.0-canary.d78b7bb.0","fusion-test-utils":"0.0.0-canary.d78b7bb.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d78b7bb.0","fusion-plugin-universal-events":"0.0.0-canary.d78b7bb.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d78b7bb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d78b7bb.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9kjrZMoStR9kxgQmGMAX0ZTAI70ayzazP5LGR7KrCVehW7U4ho9gjBbRN2CCxkrEIVdhn8iK8JuRjubl/zRRAQ==","shasum":"3254f999e8dd70b6b324287e4219fefbe05e0ec4","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d78b7bb.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaEcJCRA9TVsSAnZWagAAoTgP/17dfxkGGYJmBKFhlLwU\noA1iHPDFPIOwrUpAwUtEFuKSKDqRXXQLZ9+Ejk431JC/oDC0IrGT4ZtwDFXl\nMaI+MT0CppYbquQk3QEc+AgHEA0h5dCuPUpQvQ17YjJFb0t2l/tXGpUHxut/\n5PS5BoEZiPMLPjDHwsg1AL8YOxsmdYxSDCyM38OxdDfR5HTj3G4MwSJ250NW\nIedfYCT7wvbapmonBnQxTrYBIcqcOcMoNU/8Tsl7F/gOlJpfCHUuCCicwGHB\nmqA4CBoF/5a4THjpq/COiYk3bAz3cCRNBfHSePWbKsW06CVH8c5uwaOi+lvy\nGMk8qZyWdp81Vfg8u09gIiaXKyqdy8UzP35GWOZIzGyMFRWJWKStsh0X5TvW\nfD6VpvF5fJaYnUgNVW06jxgSaRWzJFwpFyX2NSSKbGwfWEfyjiyRa0NfxokL\nY5fwqXyADvHWsadH0OCTNug4yMwAQx1TvoFI4gw8GZ04b6cSLYGrRC46ZoC/\ne0rK5ob8OKIfmjE00K7SQsE/zxCBu7X9dVJtDIJNdIZFlfD99G/d+roB0WPx\nvmiPaATistDi76ejbF2aCHghv9l+v8drBz7RBlFmJptUiYaxC5xpiSky4vCo\nTjkoOf6pzH20BEc4ppZUwGX42GYUcIID/GXmfi43pjcRewaW6zv3G8j2ckP/\nxuUR\r\n=AANL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKCpGogABXOIlYd6nxRvEnUjC2tWefoDFW4qSzdjiAcAiBa5FA5aQJp71VTIoKJAPgZ2I9pkTg+I++8o2R1cnwK1A=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d78b7bb.0_1567115017314_0.5537677587243712"},"_hasShrinkwrap":false},"0.0.0-canary.2a2b83b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2a2b83b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.2a2b83b.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.2a2b83b.0","fusion-plugin-react-redux":"0.0.0-canary.2a2b83b.0","fusion-plugin-universal-events":"0.0.0-canary.2a2b83b.0","fusion-test-utils":"0.0.0-canary.2a2b83b.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2a2b83b.0","fusion-plugin-universal-events":"0.0.0-canary.2a2b83b.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2a2b83b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2a2b83b.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-2ZXiDFuGvFciiYcegiCRSNJNSlHYn2/ThtccpN68lwLt4P2RcKcXQjKzOUGbihWpq78Yv5VVHkF1/V1yIepR4g==","shasum":"4a6fb02fcf1ff7ff198926c0cf43c2fdb73852f0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2a2b83b.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaX78CRA9TVsSAnZWagAAqAoQAJeG4keAClelsicN1Qk6\nagaElo94x1UF/E0w+79Cqn+pZFzKuzgSQkgsj3e2BVqv6hqqrkMsaNv1qFz6\n44cBMdkCNwXr7OBXChqV026ma3o0ZuKpuDNg/NUy3TI3HJqnoWaskGA2zpqe\nCpriBQSe+I0uzFjnb4i0QkbYbe2TtYnRRdtux4YZcA+zpKyXwg/LIhOBeE7H\n8PU6X1YquzAlS0DrQBvl4i+hjicnZFiNA2Jo1DZ7KMA3gyrf41dqVXkIRCqM\nwOVyinXvAMNndayWYI7Ts1R4rmNEWugLKFXM+Tovltgh22Di+F/Xlixt9DeJ\nQ8bXnlaCfnd5rJR8FtNuKkithVa3/bGtqG2vqYPs34+crCzxbyAVutZWrDb/\n2yfQ1/+I1ASSVDFRObIP1s8p8qBc0AxRW8nTzi6XkeNncAIXFuR7KKWqnekx\n6x/vH2p0+oDYtJrlW9mhGB/Ikc2XO/M7Q6CBP+hswKllBKy+QQBJ2ANOOKSe\nPdTtRBlFha7xXYE5MSnke6W9XcZ3Birh47b+qzDkuyCyzyivUDHru6L0eHlI\n1W9Rolg7pfVBnR3KM9WVsjMOz7VD/o80RMwmUOAJrTwUhPjhkTqqLj1XqhLb\nCGu8Jo/ZSDQYN/GYaNLoZzXxbPVVDhmLLsBBCEvwVX/FFtgNV/j7YRdCmTYx\ndXt7\r\n=1d/J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf5Gn6yvlfbRGwPqdhrFyMqvT2lgRm0Ic+w20qyu4VVQIhAMI0ohU9qiOxbqKC4DxlRZjI8kneCfsJQL2yaAOsfmw2"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2a2b83b.0_1567194875514_0.19829238704926655"},"_hasShrinkwrap":false},"0.0.0-canary.a0f0132.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a0f0132.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.a0f0132.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.a0f0132.0","fusion-plugin-react-redux":"0.0.0-canary.a0f0132.0","fusion-plugin-universal-events":"0.0.0-canary.a0f0132.0","fusion-test-utils":"0.0.0-canary.a0f0132.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a0f0132.0","fusion-plugin-universal-events":"0.0.0-canary.a0f0132.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a0f0132.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a0f0132.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-oO35bgfcege/miLbCu+aXjwp1Eo1IAMX6ezFRzvLxlkFki03Q++48UHVWKsMvDocy210uOnm8KRrLqa2hgmspw==","shasum":"409073c0db79daa56400f24efa562b8bdd96007d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a0f0132.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcEBBCRA9TVsSAnZWagAAg/MQAKCD0cUtjI4xE1aWfkOX\nuKIX6LmKTnoulKl8a1qzCa6I8OBtFIjRB4q3tESwW3IcrY2BDBc5InDYB95L\n26oo64NgI7mGTpyfD8h+L9B99rm4y0H2ALqEzb/xM/24W2sp68qvdg7PeBM5\noSq0bCDUxp8q8XN9QeGPVgFMMKf74MYh9ZShe8o4hz1JszB/flaCkgQMISkg\nheX3AEKJi7a0RqyYgjutbAkuZMV2Id1SKoOa9u2Dp+bfjj2zPtDocFcDwp1b\n+OcwtJzfFV+C/XoI9+yQ21y7xiA2LxuqF/aiyebppAbMMM/9Zb0zLQOTyCqO\nz0s4g8t4BHy54QF3L+xiDrI3fyUbJL5AVmWVOpZ6Ys4Am9bxMmD20Rz2mE2g\nk9B7QOjJO8VPayDCjFKUtEx0ZCXq+vfqIeOIdbujMEv1jEde7eyTrX/sEtJB\nE6pQmmtp4vq+OfIUUVerSzOyAR+uSdGvuVzFkY0qGg9g6cQfX8UujgVTjGfs\nHzYdw0ZlP/BPREtORmRyi+YX4nY2VIUc7Xr71Hh1ft8oH/QbC4vhZhz4vnSg\nyFA8lOWI7EcDIW4S8bLLWeQepuW7Ez2OaTrRHzdZzlC1IfKEkWBl+wxiFMPG\ncJgXXKSivBUVWVW3chSQ6TjMn1chErkvERGDwepMnss3wLThGeMiCCU2utP9\nvPpo\r\n=QKzR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGDouDCgEOZzbT9siYiyR1GhJ1rA4ChC+g+FBDSqEPXQIgGcy1FvfVkfJIoDZxfDfMRh2ShmjC2slnRLVgO+Pi2y0="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a0f0132.0_1567637568771_0.9512474678891008"},"_hasShrinkwrap":false},"0.0.0-canary.109b061.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.109b061.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.109b061.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.109b061.0","fusion-plugin-react-redux":"0.0.0-canary.109b061.0","fusion-plugin-universal-events":"0.0.0-canary.109b061.0","fusion-test-utils":"0.0.0-canary.109b061.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.109b061.0","fusion-plugin-universal-events":"0.0.0-canary.109b061.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.109b061.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.109b061.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-UzVl+vDeV6bCFmEd+ZwX1G/KKBavzRu5pv3uO65DnpDUIrgBEityrHeCTHaCmrRNKEYqshRuzgp1EFjT/3AxEQ==","shasum":"d86380cf0e73f8035225f757e8494c5f66276c90","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.109b061.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcTloCRA9TVsSAnZWagAALeYP/ipLEjV4irby1tcEZLDv\nWyfFUdEsNLZSnf+j1e79i1xEWepU2shy6a1SxZRSP6YcMDdurfHACYCH+7rd\nXET7fNjceydUxSUaGlW5prifFXI/O64f6GuXX4hvA2+4RC7WMPiwlr9Ea93+\nqp81XCTNwqLeODFT3nn3LD6+0WZC2NvEjTlpLa/UjpxAOgEGv7DRGPdDMsuk\nQ2DUrdVvXzSIxUUL/aXPEMAKGT8ezEX/fNJQH/wkqdVXC/a1O93bljC/PAn8\nktxcr7ACT2G3R365Ho98s0nkcKTXdoxH7yqMRUMU8MoOZyZ4rOUUfcFglFmS\nYFsCBhqtX34Eq80jhgq5P8D0W9kq/SESUeGOrC/YKosMOsQpq869aBKP44rO\n4xbG3PPNboFyhohVfbK773x9TaqsSCpJvS6/MtA1pMZEhwzwB/3bXGYEuth0\nQ6t5WzlTeZ2HGbGJ4xdE63xKqmJdIantZTFcMn3D9uEzRiptgW7LxZ1+I1a/\nnYQqh+t60skigc+qZQepFXQWnuD5iZbVNruj1E4GkAXgS2Z1aiqR5t+iY5oq\nYjiL2DLaqJoE5WuPfudb0DWs3AeCCrh2CmBNxixCbOIHQcvbCMJ1NC+RkbVc\nIG1bAnzXuwJ9Chfu/caayo9khpuoa0lsyf/tipzRks0Z4OvRatkCKymHm1QX\n/LXO\r\n=EuIT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGE5DdLzRp1aF95WYxfPwegec+yX/zpy+wjJif4wQtZdAiBVW50zIhWO8Q4lLOxjh8HPEWyQMOIAqNsEs7RjC/cf1A=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.109b061.0_1567701352184_0.4122050882729451"},"_hasShrinkwrap":false},"0.0.0-canary.66d82db.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.66d82db.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.66d82db.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.66d82db.0","fusion-plugin-react-redux":"0.0.0-canary.66d82db.0","fusion-plugin-universal-events":"0.0.0-canary.66d82db.0","fusion-test-utils":"0.0.0-canary.66d82db.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.66d82db.0","fusion-plugin-universal-events":"0.0.0-canary.66d82db.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.66d82db.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.66d82db.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-66dt2kDkID4Q3bm7Sc+jryN5COVYghyg502aSE9RTDDa0XFssu0it85H/+yo88xmt6FA+igAVDl7JnNEzPwQ8w==","shasum":"93aa7fe318ab71e052335ac66c94086a7c1e73ca","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.66d82db.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcTmrCRA9TVsSAnZWagAA8gMP/il20N+A2sbAk35CdQ23\nKslq/pWSSweK7K+VTWEVdpTvkvVpf+Eyui2BimktJ7XM4oE6F1WDvhpfKwwZ\nippGILKNPaFAWPn3ONKvvSSq2Ng6X/kxV7YoccBACoJzdMrWO2QeCGHvd/0K\n2B7fswb+3HSBy2KIetNwe3Iw+1dtVMA4+Iob5w61RoTRI0c8/vtTOGGbI61M\nXUlhBn8mPO26RJte+lQ2yFIpXL+i1Idp/K2hcsd2pURVTNIDYUnfrQym/UTA\njakfP2mi2wtOxTTEuPwwTMIBfoFNSXUWiRAFxT04mxGwKj7F1oPsrWSxzh1b\nUhuhMwUWVVwWpcHCPPPX6WtD5occ9UBgWtp2FBG1ZvXI5SSgbm9G1IW1cFJv\nTTEevcj5l43JeofxdJWiUHmQ31DZFLzEw3H4nKzAxRPlRq+oIyx8TivCtQc8\n/qvYiFBEAftFDj6GiJhY9kmiEQsdyWZD1XQJatUbzs+UOVYvlPLKASSWvlYy\nUJF3XRVfuo0MJ7msukieu2JjuU2IEvBZoCheceSbKKAroNvYdlHl2dcpcT1m\nZURV3yQ116dPhFtrDq/xnm7+HVbpWqo6q2p9220o1Az8Ti1uhidG0tNn/p0D\noA2/qxxzI/zYX3aEykBuzG1BirZZLvPNa02cB4Hphfe+/SzgMehmlap61Ecg\n16cZ\r\n=A3TC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGDdS8lRp1ZhyVFGl86tVfyL7dE06obypq5P17quICXXAiBp/w1MkK/282fRmBy56rOoCwBxEsjBE9hQtea7lL9Hpg=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.66d82db.0_1567701419036_0.18010057001400015"},"_hasShrinkwrap":false},"3.0.7":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.7","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.3","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"2.0.5","fusion-plugin-react-redux":"2.0.5","fusion-plugin-universal-events":"2.0.6","fusion-test-utils":"2.0.5","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.5","fusion-plugin-universal-events":"2.0.6"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-3.0.7.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.7","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-FX3KA1VitTPhYlhgCjIWebqiQau4UwljlDrt1zTq5mqOsmWWqLiOW3eYKnYpwAKR83U6T6M3ApmCaNDS7qBvvA==","shasum":"9bd026e03f4c6924df43d1882fbd3cf034476417","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.7.tgz","fileCount":17,"unpackedSize":41982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcWymCRA9TVsSAnZWagAApwAP/0FgykBTn6W+Bhh2XB/h\nRrIvSxTzfAt9f2qPcmoXARpneceSPw+nSGP1NZTvF5huYodrla+KjDZugNzz\nA+x4IL6g+RdR23XIRhHJkWXxPlVbo3zMkMnxzQVUuO2ozuJiLfk3KHswRSFg\nMDM51JuvWW3nftiwQKMl+PzVUSLOnS4CoKMqZMQPMDYNGZ7TTBx1zJfvA8cj\nYWeb27DYnBcBgM4dFbEhoxKwDfW4My7xAHsyY1YstXf56OVZGWWkOPI4AIyu\nMolOXxws6b0XTzl59GGOHCe0XRx+z/AnYtVuWg8HFdVRUKDJQDxKB72fsfKf\no/r1rwlWMc3u+osnqtNd/YV4tmRmWyQfPKZUJJGsGZhsO7zBQ15lZREz5wl6\n7uAwgD4iJwuAp3ZT+fVFbPEhUOO0EzlTzfwK9JSULRxEN/a+Wdk6v0gte9tp\nkJEGbGu1gvRYbUNeMclyfjlOr4v5djM/UnQ7uA547amiTennm7nP8ICVJy3n\nBJpv+cHWOb9D7JmD5XMoVSmgRAcjFxpf8EisYXE6WuTkXYt9AyT/v2ANE5eN\nu7yTPwypiGz4WOUGXYE0K5mW3NTuiqaWzTFbhqdma4/2N06TlXtQIB4eF8nT\n1z6lJcqvtJwSAyorouhXkP7dEwPaI+trt9V4C5xq63tD48bitLR/a8B2KdET\njpk/\r\n=NNrF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICb+pPN/4mb9yqcaPpKF45xqi1usqDel7st5+1ZMoNDHAiEAnG8W9S2eqaXNCJHnckVLG8RdrWSLFuV9OsVvf6l6jqM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.7_1567714469870_0.3803131460906024"},"_hasShrinkwrap":false},"0.0.0-canary.413f404.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.413f404.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.3","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.413f404.0","fusion-plugin-react-redux":"0.0.0-canary.413f404.0","fusion-plugin-universal-events":"0.0.0-canary.413f404.0","fusion-test-utils":"0.0.0-canary.413f404.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.413f404.0","fusion-plugin-universal-events":"0.0.0-canary.413f404.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.413f404.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.413f404.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-PAW8EufuX83tDz+dbYNPYaO2wJwVf54CY0M9RWruV2GxiUBaXDV0+SMYitjTJHqm5r5oJmierrX/SBgAsuf1yQ==","shasum":"112711e539ba1347e895a6da38989c52e99b261e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.413f404.0.tgz","fileCount":10,"unpackedSize":25614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdf9YtCRA9TVsSAnZWagAAvToQAJe5w7oIbgi6/YBdp8XQ\nBOBbNshs34xun1eN3OGqL6EBZn2HeaAnH2AN6zGgas9CtUIoenY+/mXfDQxv\neBjFbNT4pbmUn+wRYr+lLaDZr81JXnXLx6Qhod/70C+YJqYgVdTGtIbTGBLD\n7lVy0Gc3loRF6vCM2UxQ9Hf0xwRF/5TH10yQQdlbpX7Eir/QIppfBdEwSUFf\nqHT0cGeciochALjF/nj/iBi/UzE8NHzpwCJQbhodMk6G//5eAylfZOEnEPlz\ne/gBKocGHxgy3FE5RJExnP3FNvcts6pYfFu5GqR5ROu1Z25Tj2UMy4FqpGcB\n/2ygnSR06NwsxmbRAdVpPebUiCJMgaijxpEoIsT8TXOEs71+nrLjazmaMtJs\n21kKHjaCmkrCE7ZjAEf+3QgjHcIO4N2pYju70g30U3lZcOhyDE8AeSDcH/yT\nzPg0lKxv3AsfsA45dfmGp/icPozgO4mcoUzcXuuC8UPcMUk5RqCrXzRE7NjT\nMRqqylpa1gG6fgxBie/im8LkONYQM732+x3kiXVJ+1o8g6yEIEfiCLzMfUej\nc4YE3LOVLnJsPuQ6lXEvkhBGOIGv7OVrsOuPfgRECW/BqW/S+mg/+KgjnTzz\nd9oOs1VFXfmPDnuZ4Hv0lGj5yd1s8i9eZNaFYJcsyOwjs+EId32Q2hn38ZS0\naXdO\r\n=JsCs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB6nDkfrR48JpxwTwMJmFPqA+U2OpTIrl+8tw03nf1T8AiEArATmnS5gzAm/A8Gqcxemb1HG7ee//5FV9XYQ8aSUFtw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.413f404.0_1568658989228_0.2862730139807361"},"_hasShrinkwrap":false},"0.0.0-canary.c0ad947.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c0ad947.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.3","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.c0ad947.0","fusion-plugin-react-redux":"0.0.0-canary.c0ad947.0","fusion-plugin-universal-events":"0.0.0-canary.c0ad947.0","fusion-test-utils":"0.0.0-canary.c0ad947.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.c0ad947.0","fusion-plugin-universal-events":"0.0.0-canary.c0ad947.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c0ad947.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c0ad947.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-7f88youE2sBuWx9dYAbMZpJvbvkWpcfuP7/54gsNjWMVcJV08BU418mm5dZ7yFP/sfaXjf5TRX+/iBMljzdEuQ==","shasum":"17b2267e4a7ee5a88ccb88051fac7b865b97b744","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c0ad947.0.tgz","fileCount":10,"unpackedSize":25614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdf/DcCRA9TVsSAnZWagAAPsUP/2WqMuFfM4i+LtTKJdD1\nwMsMO2O8sTXA8POw9sSeoyEkfKKxgbJNfgEgBjZYBuVzKn2BlcTvfmK/w20r\n5RXy4U0FrMuiSRkkSfcR9jO0voyYeh0M8BU5fgH9g/mfDW9A2tya2gHW4akM\n29zIgyjpyjA/J1xGVww/zCWM0OdoMznypimAq43OsWUTiLh1rQqw5XcY2eDz\n4RIO2iAhYGo9zSxHBfFkR4H2bFn2dUo2S2ReZ/s4Lq/hFh93Ynjmv41/dbwy\nqpsBiObgDyFkVFIKYEVvlgO/rLcV+zCDjLGlvhk6bL2jUzMrjrORdaQudgPS\n1G6ttUgG4DP0c7kFTtr8LcS4aPBA+OJHH+hAZyGELZlW1NZNLKAY82kfxr3d\nAQCUYtGZiADCb34CFP2dtUAhtEQCw45TvbhqG6aHQjcj/5YqBxjSJDo2ZYax\nsI5CcIksPzpXY1gtoUTs1TiN1NtLlxKXeq1gLHCGGFFWXYH+FxxZPw1+RwC7\nmR2yrhPmunz4gFntnsUWLap4H8raamdsEoG6OMemNmTAQfnuizC9h8nGVC4G\nqymVEqvJ9xiIdVLMo1EM/6K8G7fit4C5A6kjDxH7EXk+VXPzcTbXUVVcYCKb\nVrq2QT77i57vhIl7S4gxRV5E+BkrVQ+4kKQb0XvIFQavfTcAdQscxoeoW6Wt\nwtlJ\r\n=6PlH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGwmcbO24FYDdxNxvyUGZlmZW0tpFJhQI8SBuSV3hKqUAiEA61f4F2RXQtdm5SQh3/qPtNY/NyQgi9Z7FGvxAXHrXaI="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c0ad947.0_1568665819290_0.4475888449352412"},"_hasShrinkwrap":false},"0.0.0-canary.ad6c873.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ad6c873.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.3","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.ad6c873.0","fusion-plugin-react-redux":"0.0.0-canary.ad6c873.0","fusion-plugin-universal-events":"0.0.0-canary.ad6c873.0","fusion-test-utils":"0.0.0-canary.ad6c873.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.ad6c873.0","fusion-plugin-universal-events":"0.0.0-canary.ad6c873.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ad6c873.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ad6c873.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-FAyelr9FKAjt9skLeL3Z6NmAObhFdBhQ1NNBioPMaX+EBdY5/rTFVANZ+lNnoLs7bEbQZCdl8bSb9D3DuYs87g==","shasum":"91148d02fb3bf28b35cd007ec5c69e71f071df5c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ad6c873.0.tgz","fileCount":10,"unpackedSize":25614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdf/RtCRA9TVsSAnZWagAAJFoP/RUH//zU8oSXY6LpLEuA\ngjzMkEA++ODuKcjOpoM0Wy+5n97t2IA2mPlSDGo2Qzy4nDNfTwV8jSntnyXW\n9B026EpJ2DW27hpsMN2MXdmrkAH6HJuywqQE7bvGl19yEwoXRo2RoDNxzn1v\nySqIqMySDuUxi/F0g9P0VKcBGUL6DnIuMuFyFO7Z6MTe/1n3yK0Cr9mntzwc\n108vMJnU7sFqMxxtzQ+PRLbk+0lxDQdAGTWBzuYbUFzxwQ1ogc6OrWfPliOA\nsZ6UWAOlPrLotiN+4etQp0gpDF6iEEXYEo1m3MZRwxSPaQpBsc9/IF9OswbN\nDOYpryCuUlm7RTGTWe+9UDrAhUX61qR4XmIGC88zw1f3D8IaaZITys40FvHI\n244wNLJ/KxJjpN+AidfTmJOtRrbnDi2apPCBfwaw3iYzO0/oS7MAhMHzZ5e2\nUeUXGlNJNr8wI75NzrwoCQpqEB3Bxas5HhH6Q/oLw+nl98BopcRpB8bjE1rf\nUZLspeHEOI6x7gkTVHa0lW2iYLeaPJjhIo4ngH7g86ZiXHXLJS3n+rAzlLIV\nkSsnVDLVMfUjOZtKMiNCCFHnmMYCqkuCI0IvX13y+2gNdkplR7Rm+5Xw1Q4x\nkudHCITXs3HV7n4BBBCRG32HZ9rXJzhM6TBYMpk128VHgcGbd777332jGS5v\nkaji\r\n=WeqA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlzIkyAdAIfeeU+CMZS3WwJYS8Lkx8MMXX5xN1x1CUqwIgOaegQDPCrueeAiaTXZBB5iOaT8O3yMRfQg+a885diDM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ad6c873.0_1568666732503_0.8314542160488814"},"_hasShrinkwrap":false},"0.0.0-canary.08011c5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.08011c5.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.3","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.08011c5.0","fusion-plugin-react-redux":"0.0.0-canary.08011c5.0","fusion-plugin-universal-events":"0.0.0-canary.08011c5.0","fusion-test-utils":"0.0.0-canary.08011c5.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.08011c5.0","fusion-plugin-universal-events":"0.0.0-canary.08011c5.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.08011c5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.08011c5.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Zk5sU1puagTqSBlKfeH5edEuAYDK+JMuJM6//MwKFDVhStOP/WYqvpz78ejfBGDOtrFoMlO25bjNqyH42Rablg==","shasum":"1e3ac19f279bd4c0165ea256bf885f0c01b9b146","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.08011c5.0.tgz","fileCount":10,"unpackedSize":25614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdf/Z7CRA9TVsSAnZWagAA0CcP/iHFijIkAE5RBHQIafjF\nqIqyxk4IkD0+MZ5v1bJ3ShX3+6UX9aUpjga2CB5FFXv0P1VbHxKMfbFYVkNi\nL3cvRLSmiJPjSfur7bMg0FCZbWkCiMmCiiXpyht6PDp5skwHl15BAsgx/huC\nzgO2qH0uULVRjOIC4Kx9XH1Q2uv+nZ1FirDhTYD5JP+SfAuryBEDE6Di4CL3\nyDxFyorGK13D+19IIvooHSEcsCn90kJE/ld/ysiqEM5tb3S+oPkcrr02fUs9\nd3asvAIte9U+0PSqL0BdIZIj+4nAnWTx2gVWrzvS5CjpSpUvEtwUq6rxbp50\nfCgFOxF6Bbt/FCD2Jbr0niH71W7zo5PU3gFBApwQz10AGSqB0fgjW9+cEZU7\noSyE02PDPLGmtsZrfEauzYAWY61rFXLKY4eJxWU+QVFtO6nC7Tqi4pzQRuZy\nAfVWrcqNJUGGzIOJgXQzrGNE35oLwQHfknk6LbjVk7s5q9NTbEkIbSdKL8/W\nMoud1ph/Op4kQBJDojGTtCqDu2lgFRJRZhh7Rq6fC8Q4Q/aVncmKazEzBfSC\nuM3DrQI+rHzHO5G18ICaZ6GhQu0zKZsGCzA8tKktfnAMlUic1OLu61qKxnJK\najfXklLM2j8GLTWglw8iRFSaqyR3ueSHefe5w/2Nxvl5839M8+WZ4VotCVCQ\nmW72\r\n=Fp9T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHDdGC5DAWKWNAbXvnQkK8J9fRYo2+tyXT6N3gZDWhIxAiAGRvnIFTY+0hzJ5Rwh/aNAboB/oOtfoms1Bu5WaeckTA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.08011c5.0_1568667258493_0.5524355767121254"},"_hasShrinkwrap":false},"0.0.0-canary.a27ac53.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a27ac53.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.3","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.a27ac53.0","fusion-plugin-react-redux":"0.0.0-canary.a27ac53.0","fusion-plugin-universal-events":"0.0.0-canary.a27ac53.0","fusion-test-utils":"0.0.0-canary.a27ac53.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a27ac53.0","fusion-plugin-universal-events":"0.0.0-canary.a27ac53.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a27ac53.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a27ac53.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ZWq8iHGv5WrwuHgXhzWQcpp5pg6aPJSyk7oFqhJwoZvrEzAbW0+lLPBD7vm7XkZJBiZE3VGik6EWy3CFbEoyZQ==","shasum":"7292276a14ffb9ec817f0f1dade8785620ab1160","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a27ac53.0.tgz","fileCount":10,"unpackedSize":25614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgArjCRA9TVsSAnZWagAAFk4QAKQCBfHz2P412lAfKcdb\n5+DFocIDNGRhIxlKYT4JrkUvuSmMRgwjfKr+XiLP668FlUDAEjtE4e4mEox5\nAJLw4QH9SIxxpBRBH+XJ/2NIzdo3PFQ7CK6Axf/t23m6++/g2HoCajMr39Az\nZH3+rOct+QM7LF2VBPtEl7tzJ/nvkCqx+bPAXZn6/5M7sVCiL1ohvWDCCLBk\nqi0z/WSa4Yz8THVL+94xZ0BkoqJZpy788ixFM8EHavr5QKgUPJmO10d6x5YH\n5sa4comA6aVwvRSZC+0ZFp7T1/5/8HtvEfviR0iklWrSEUgvGSSFS+uxlJHm\nSh2ZP5dZlqA9BUDfYmCOMma6Bm/hiTdorA0feDblGr2U+GNj6k14NV1nn7vH\n8Wq08LNeeUy4k7R4RBFBSCyNnCbwV6gVoGEQwnUYYXgg00STb5j1YZ5gju8i\nnGOGoDiGHD+pW05d0qHYqWXWjNfwkGaHJ0rUqJNG1/6Tj9pBKys0tUsiuJHP\n10JFaSZI0jtBk1YRH5vI7KfKlcen2gMNWKDFHFUU4byWYRD1/Q0NL3X6X2Ab\n9GmT741jLiWBdtMFppaCThwxBiaZtBKNEVsj7AQzDkUdONBBdNgaRaVSYmca\nIj1i15+zS0hU/50gAGd20/NjlKbYe3GYnN1WRwk/VP4ZVcJH/sXlbxcGjGNf\nviiV\r\n=Lb1u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGsNKj/PEH9NQGjyg7SsZB1a22rn/EaY9f7lI7pmrK2MAiEAq5zHCaXsTMqNjvd7ZLtdhLp7dgzYYjChu3ngviDuuvA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a27ac53.0_1568672483155_0.3976257360545352"},"_hasShrinkwrap":false},"0.0.0-canary.ff793d9.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ff793d9.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.3","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.ff793d9.0","fusion-plugin-react-redux":"0.0.0-canary.ff793d9.0","fusion-plugin-universal-events":"0.0.0-canary.ff793d9.0","fusion-test-utils":"0.0.0-canary.ff793d9.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.ff793d9.0","fusion-plugin-universal-events":"0.0.0-canary.ff793d9.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ff793d9.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ff793d9.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-c2v3fGI1P96ZwHxRLHM9+Kt9IiuNYVw6pG65oSNdq4HbORJ7xW2zOAcZHV1e3av+ZVQcaMTe9Q6Pq6fGfBjPUg==","shasum":"0d59cd3a6b0470fdbc03aafd85f879655fa1d7f2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ff793d9.0.tgz","fileCount":10,"unpackedSize":25614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgCNdCRA9TVsSAnZWagAACssP/3q4TG8aAha7ZylP9pdt\n+gUzjN9l+vNh+gK8ZvGePPO9gcMmIYd3NXNknVPfOFROqHH55Osiz9ibUoeV\nvW543u4vdF30g+ifiJufUnPYzIw7fiOp4ykbyUWx/6PG957r/fx4B2Z0909O\nidUZ2Rxt7PeC95zZPK/qiUToSsfJDDhDzBrU652WgirJVIh/R7waRd1WxzzA\n01cy2Xx8jFM/soCNzW3mpPFV6xHtPPOEw4TEfYi8Fapp3iLUeCJXjoUB+ZqS\nczXVU0LAkSBOnX1Y68oCrAj4Y/R+BBTgfcLY+DGjfOfsjh8sG6MSCbtM3Kzd\nrOlldenCOQPk52sKb91QUEntflSpKspjps1gIAo7LlvkTrHifAywkJ+Xw35F\npzVHlOcbdAykedA5S7RGByWClAhGefef40424I0zfcOi8Zsq3aHO7MLr2O+S\nQBAY1EPQM5S7zqQ83ektZRIXOWK+F63gqlpBqf7EsqpHkdIw3uUK4/q3mW7V\nVqF7lehLT/gv8ASGpqr0t/vQFnN1otSTekx1SUGd8zn+W1Dau69M1GT4ETve\nmxKF0f/EQfiary7EF6A0O4xyC5uWnhTIMAtopBPERmMKOnuR9AtSbKAHU9iI\nPNDC/+BeobHSqZetcnFY6ON/2A9ysb22DC1/97tO9rZhyq64PzlQnH7X82mW\nrvQZ\r\n=487v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAk8GtK9EOonE5C45Rerq3Skr/HyuS0QrPI4tSXQTmbUAiEAx645X4pX5CZZGJLPg0sGeT6Wh49q70kKVdfF/uJD+Eg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ff793d9.0_1568678748402_0.28529002872376563"},"_hasShrinkwrap":false},"0.0.0-canary.2925a25.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2925a25.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.3","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.2925a25.0","fusion-plugin-react-redux":"0.0.0-canary.2925a25.0","fusion-plugin-universal-events":"0.0.0-canary.2925a25.0","fusion-test-utils":"0.0.0-canary.2925a25.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2925a25.0","fusion-plugin-universal-events":"0.0.0-canary.2925a25.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2925a25.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2925a25.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-NYNr1rE2JS449ZhP5QAJ9DKIUBjpeR5OFOamWgr3mq5FV/ldresrHyHpop0hPfomiMK9rs3B9Ci0LzM/cwL9VA==","shasum":"4fa3a9c310680b0a373dbbec9bb886b2a1f894a1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2925a25.0.tgz","fileCount":10,"unpackedSize":25614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdgbWHCRA9TVsSAnZWagAA3DwP/219bd2qGRF81cBVWNmT\naSkbO+CLbN3XFYi4UmzSg4w5sWyT+E490Jfx2tMwV+fX/4ZuQNY3gXiBweLc\n2gh01EbyNRAUnKkF0rMG2W3qRVrMbUdqJfmrRI91tpp1eW6gi6YDwh5UIUHG\nhnnkJ4tS+4Ds5vUPkxi85bSdfKhKdmwV4in18euqDd0z1OKdmWwZKwONiB06\nZI51UHo02aumYSRZaOw9+0ge0aFuF3qIvx1w7/TpG26qPczeUwuNetWGcG+X\ngcAc9ziyIrcBKaj4stdxEQ+d10LWH1MtybuQMInflNVHPNTGXOQrRaW8pjNy\nytDM5ktarHaeAs85biQaHf7SV+AM/p5qOYFE2MLsPI3vT4ho0d9lVR7kKc5u\nonASx+mXLbvd3iQetbtIKIfMUXr2Bv+qewy0VNY+06HPfzzMHn9ssTEt9H4B\nJla6F/9aorQUK0VCKn7U7ocax/LcBBqukp3fzQ/g6u12LMPVJPb8p2D39LRE\ns0LVcdH4cMN44YFtKrSvcIGU1j6175Q5U4gxakrZMfT0BDt9mtzhu2bwlOEB\nhaPF/cxSRkAYgz1x48mhXWGWethc4FEEO79BbCWtxUlJQvQW1q67YI6PIWon\njEuQyL68zTDGM1QXCy681yU12828b7L2LPP1+SPbOOVltXqXZ46YbS6anWwI\nHTxZ\r\n=rH4J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9o+VIU1vH1L/Z6mQxXPbPRuis4AXSq7XuLLmyzT4NuQIgZFl/gos9/LPfx7P/5rmouGAEX1H/dxb03/rU/nI0eP4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2925a25.0_1568781703303_0.09666551660097422"},"_hasShrinkwrap":false},"0.0.0-canary.49d4d79.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.49d4d79.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.49d4d79.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.49d4d79.0","fusion-plugin-react-redux":"0.0.0-canary.49d4d79.0","fusion-plugin-universal-events":"0.0.0-canary.49d4d79.0","fusion-test-utils":"0.0.0-canary.49d4d79.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.49d4d79.0","fusion-plugin-universal-events":"0.0.0-canary.49d4d79.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.49d4d79.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.49d4d79.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-T1vBRCnmuiRpZDGeOFoqLigiwn7ZSWm+AG9D14gbnj1ygCnXoVgsEoqhdn0pYrXkWbLqZqeZIwdho2oH1iBgOw==","shasum":"a7ed6ad13637bda01670b810055e4b7c24b2ec43","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.49d4d79.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhAgBCRA9TVsSAnZWagAAYRoP/jDdcE42YLedhGnL8R6G\n+sx6XGyNrnWcw4tMcaCCKgXug3Tl3z2yo2K2ruOYt97aEP+JYChXhtQO0Z+j\nD49F/IwvIX27VmUyzy1Ze4jn+u3uXwSdqlX+eg7u5g2jBwmzEc898BvEOBbF\nZ5MVav6HZdnxe+uO4myfWHVd+J4gcTMwyQr/qo6qD0jn7qooKDPJ3sNIs+lT\nUAc031UtKkgU01qDHRNDlOR0zANlkjtuL76Qpq1tMe3NCVZlb9eHjJPa9FI0\nkRB88rVQRRjXrKPnA67dsOLxujrqVwyZFUek6qkGx8DurNBAHKie5cllJhpm\napCNhzpsBq7J/l+msgp+pgLXzU4C+SikUeTaH/VoQjeN89r+VEHoVdsCPrk4\nYIfZ8PH4lsuAHT5PnH4zOuIoRAWvwPXpexxM+nYnZCXUtzey3Mjif86VH03o\ni4PWOq45zxHoJ+VbKPFsXlIMx9jDkGKF6OiV+YTT+FIHnP/3s+JZd7abqwz9\nZbIK6HWmCPBNI7wNVWhlXMc1Vgf+9jV/0WURReRtqkuUeXmSlajLLOUaw2Ph\nyWryYi6LS2oA746fFwRMDYgLOX68R7ioIy+ad7YuU6EMAw/GK9uHm29/KiH9\nAlPG7RtZW1XWUlpkczBKwe/rMJMdGNQbI1K1Zua+sUoyRDerM+S9ujcLqKlg\n2MN+\r\n=P85F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKGFRZa0RULwXxvSp4zLaM43bsMB9KlAvnHEBQ9YGP9wIhALFWEam7Mi6z0Ms0fQcM2OW2mc5S8S1yBQZ/C4xO6a3k"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.49d4d79.0_1568933889252_0.23589259890272696"},"_hasShrinkwrap":false},"0.0.0-canary.d4b0b6c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d4b0b6c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.d4b0b6c.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.d4b0b6c.0","fusion-plugin-react-redux":"0.0.0-canary.d4b0b6c.0","fusion-plugin-universal-events":"0.0.0-canary.d4b0b6c.0","fusion-test-utils":"0.0.0-canary.d4b0b6c.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d4b0b6c.0","fusion-plugin-universal-events":"0.0.0-canary.d4b0b6c.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d4b0b6c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d4b0b6c.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-p4E0988P92mBfdlixX7ivUGGJxJJJfWoGIhXzkdsRcyMfRAjVLYkY475BBawS4VF5/lFYfFYQG8IZyFk+8THWw==","shasum":"d48c454fc4af67403d549bde06a732c50541a79c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d4b0b6c.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhBMVCRA9TVsSAnZWagAABcIP/0ywyQiS/3LDSnfofpLC\nxd+aqIABvEpjtT5/Kt0VUxhjEW7M2259hocEP+IbEw+rPOQpSp7jGafkEXQD\nSkqBs33p9RERthWgj9GggKhFpEHUXX+jpFbo57NOGTCj5aFpcToUxr6KO+jF\nIqzCCB995G3VdDGkxPPi0OpRbbpq2J5iZ4OLlHYNtH8cNHCTT9KSLGQ78xu9\ncaZop9saWpjqD7U8xNNy9fwgS42o2q5l4c+MPuA0YJA15ttxeSlT3iEicxHv\nAHj6P0oAnNOPMCGHBFO84C5MwC8LgTgS3fJJXNWKzfxQHMXwXXuD/7BzQ+uQ\nkGwNGl1Eagxp+DlVXQCBBCDPmGj11zireEQJNVkmxsYc39aubQf+Y2yFuhr6\nfqjMVFFqX7g9kXSrRCpdRrGWmg5l6RFAE/MrxPAq1euaSWryvPg1Wqyvqojt\nnBiDNoD9hbCbXRu9o0lLSG+MEneqAIqXgJxaI7ZXw3UXQCK09WnOQr8ccIgS\ncWqd8APV8fxdsjBQNdL+5IpQYkLhYLWXkWxX6HOxpiKdL0+Fw0K0d/6uksZu\nCEySx0oc9a9qfgO7f+6m1jhPuW9W96u3OTmBA4Bl5sy/sYPUCoh3Km4MiU0c\ncGCKfZZ5tY8OOOyDIK3gyZVcdAhe2zQfDOlkn8T+VlQzNQQVeH7fut7qngwD\ngKmd\r\n=1TYP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGLnCIRTVFA/UYn2s/CM2iuil7s3uls3bYgClMxLjJ3fAiBB688A10zj2oL77MPaMyfsFRVrb2LHyCYpe/QsGNgCpw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d4b0b6c.0_1568936725123_0.8461134961307828"},"_hasShrinkwrap":false},"0.0.0-canary.5be6a00.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5be6a00.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.5be6a00.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.5be6a00.0","fusion-plugin-react-redux":"0.0.0-canary.5be6a00.0","fusion-plugin-universal-events":"0.0.0-canary.5be6a00.0","fusion-test-utils":"0.0.0-canary.5be6a00.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.5be6a00.0","fusion-plugin-universal-events":"0.0.0-canary.5be6a00.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5be6a00.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5be6a00.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-1Jj04Ef3isl3LrsGRn6p04EnCzx3IhS0JbAfV8l/6QMoatnGLmZ0uE3RRV6UmKg/lKed8wYRnO8k+WOBtx9o0w==","shasum":"cf6e3213915f83370415564d4a35327adbaa81de","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5be6a00.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhBzUCRA9TVsSAnZWagAAm7UP/0PuzwzUIYGae/8q+reW\n9YB344ie66Y4OsRWk+3e8s3WhgNu2dGyszygJXP29uwwPjRTEzZotT6mYXNO\nbT+7IMZjARaoSPshXEK6F4c7KwgEs+9Bv6V1odEy4AFxY0gsssJMGiN2+x2m\nJhqr9krvJr9tQorkA31RiwOFGXHXSE4n3cZClNPnb+qpCPgUVJqTlkBbpPOa\nmn1ZB3iMuSJzuMyTZ8cGryZtSQIADhRSec6oe9QjMNN5lkAQj0YPxj9PgmFo\nTrplu9DeH8Np09ojINB3lt0Lcy6LQ/p+Ee7QKLZAPYu4Z+yu/aTuTv2PL0bt\ngjUcjTOHdrI5CV1vZpTs/oSX+WVmxSeEA02AtYjDIITnw+pfZihqVUAvsbu/\n84JgR/9H8vzgZ4DxpJPNMdmBa6A4DbbGgCk0A2qI+Go8df1XZr80xaNDxxZB\n7x2tPYwtD1Kcp3UZKKwjBsh6aRonoewyQ1QWlxjk/oSPlt6FeUz2dx7CnY/e\nLk3gMOHki+4LE8V/qQhK9EBlp30cOTIm874foFxzptpzLgN5mvrvl88KZRLA\nbof9Dki7UhQ8mtjpGLCPFrU9tBhxVrWj21H5CCQaBq6A3W/S0y0GBQqC3XTI\nlynTPqR+AbyCrutd/Bl4AtaDjuVWny7+FJltusAc0p5COdY28icHs+4ELCip\nNt4f\r\n=2jfM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFe/4XUuY3P7vpKjlo3EqulvEbCDczpH8WKKebBezkfrAiEAzQc4fup7vP847VywxfDI9PI6qSpnD1AeTri3gEG+wc0="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5be6a00.0_1568939219643_0.5837610831765672"},"_hasShrinkwrap":false},"0.0.0-canary.dd07585.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.dd07585.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.dd07585.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.dd07585.0","fusion-plugin-react-redux":"0.0.0-canary.dd07585.0","fusion-plugin-universal-events":"0.0.0-canary.dd07585.0","fusion-test-utils":"0.0.0-canary.dd07585.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.dd07585.0","fusion-plugin-universal-events":"0.0.0-canary.dd07585.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.dd07585.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.dd07585.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ufcEJ7kMWW9XOQUhtbpWxFgkx6h4FN7FZR3MEzeFhS5qe4oP5VLmAtJxnf3F4F4XXW4lZjpy16V+InAvZpDyiA==","shasum":"4835578f0e91f631a193aafb2ede8633208c197b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.dd07585.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhCZwCRA9TVsSAnZWagAAuS8P/1siJUYsQgOsaAH84ouo\n1HMiCKZn82m+9a5hLMRI37WwaQOujv/tyee2IdxK5RZaah+vwumI+h4BhLX7\nyzRq/yfbPE+rPkGYqI905C9oWLbmfUPqxwFltgwCVMafFQdONrjT9mmntb7/\nVtvbw/HXp2a+1K7qCjtyIYXl9PV9lJgxPZB5UtGAclR6ExIJ4BsGS0ByNG+T\noblcpHAQjcYLuIziFswlBY+2S2f9rfbFA4fh7Rx3SalJPzrjNpeon0oxF0+L\nIeM1J98AZQHGJ0VvTVC7KDfVUqYo+T6vb5ZfFum92Ec6VfXyERGy0g0tzfRw\nnODtY2p/RjtZuSpkRWzcRFpCNMj5PYZk1t8V1yslgSM695R3iBhDCrmluBvu\naBChSkHSKVjHuRNzEkBWG8KmLn5M3hWjt6AivKiAjkNBV5NG5s5qVfq3+2Ba\nAnMLFRD1dgYxbv1GC9Iou0N5BL54OKSdwIWUiusIx0w0IPTiC1IB7pYRh2eq\nnRavx9to4yMNn1Y6wjEkbNpu57Jc8I0NJ/Qt/IyntPpRmpXz26RHVrYfbTzp\n1C/ror3cxWiP5Lo/cT+pg6f3Cr2yqbcsSh3vpCx2B9JqfIudlMpaXjPPgOb8\nTFu6v4Xw++8S3SpUTclVueh+x77971q6Czg7WEDJ3wS/IZz3jYqWkj4lq1sT\nnnks\r\n=4h3O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDB9EU22UKX2leau4jhWg6hCU/vb1o21OFZvoOmoHPyxgIhANXfIdgTg49lMAs7zGlPGSTiHS7nXdw79DQOqvUZC9rz"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.dd07585.0_1568941679875_0.30602148106398186"},"_hasShrinkwrap":false},"0.0.0-canary.22593cf.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.22593cf.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.22593cf.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.22593cf.0","fusion-plugin-react-redux":"0.0.0-canary.22593cf.0","fusion-plugin-universal-events":"0.0.0-canary.22593cf.0","fusion-test-utils":"0.0.0-canary.22593cf.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.22593cf.0","fusion-plugin-universal-events":"0.0.0-canary.22593cf.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.22593cf.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.22593cf.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-FV4jY2B0DgWoxCWjV18VssTkTQodllLL3crrvKYBQ3o07o2nT69nNnVOyvwrI5/S/4xIy/qJfrgedQlZ0ndeMQ==","shasum":"367392d3a10a677197994e4febb812d97d33ec8d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.22593cf.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhCeuCRA9TVsSAnZWagAAY80P/0vcPnx5o27qyOy8F305\nrO1xwaDkXEZXGKRciDtjwTXQigoUbbTmUiAm1e+Wq4sLsf3bAFTVB/M5Dxz7\nVr3F4KcySwyPrll2OYQ7DkHInnscJRqHYrBlNXXcvXlecNgS4ZJUAqjMUL9/\nj5KEE424YeEmiAHxwqvh1hpS+6DU2bfhOkPQ5SQgBsJU952E5E4C2vQxh+fw\nMWTqXUV6vwyZyMH0Dhbr6CU2ngrQnd6xoPvNt+rvG7lj9O7+B1JGIZ2sr8+X\nyGFEyHIo/KcL29ziPcJb0A4WuQ++ncMHrYUWSjhUTf7DhIZNpsU42tueGr0H\niPIzcOWVE1iGKE/6oXfgy/1bnh5PIDpxCm6IiidfcqowRBVK0XgvATbUz4mr\nC5SWL6bGgNzi38bvx+7sorcr6oKluUt7OaX+8NEK4R0W2fpjsNTbHTAFFFVj\niQUXWlh2vssYYGLI5znwFm4DddtObCQy2vYk1IyOqdGVoE9/dj4u2JGfiDeA\nhQebw4W5hVM4VRYMmAJHsyw19xylT+FnrpHFAgZVArsFIKLSDhxF83hsEy2+\nsDHUi0uhroA/6rr96j2U2AUD09+cMdL5YLo/RWoQC49WpfQNZg3J+Z65fWPI\nkFpamnZH6a1H3mNPur2phweY6XPfj/7ssEZ2Y1sO/nUsRDLH/rxunKJMYdCc\n1y2e\r\n=v+gm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEfHlAfUcbEmUpgXDn6PT4y9cZsi0Usb/nK/spXDtKtGAiEAxa5ldBL3Gq46xJtA2++QH4SOQGjYZURZ/+5jpoCV+4E="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.22593cf.0_1568941997926_0.29966172012169845"},"_hasShrinkwrap":false},"0.0.0-canary.a911dd9.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a911dd9.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.3","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.a911dd9.0","fusion-plugin-react-redux":"0.0.0-canary.a911dd9.0","fusion-plugin-universal-events":"0.0.0-canary.a911dd9.0","fusion-test-utils":"0.0.0-canary.a911dd9.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a911dd9.0","fusion-plugin-universal-events":"0.0.0-canary.a911dd9.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:public/fusion-plugin-redux-action-emitter-enhancer/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a911dd9.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a911dd9.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-xV2muvabEPCy0siL+BmMiUyYvYdbG5AwuAiesDAvVIlPBYWseuIpnNTQaJ3FWw+hAGNSCDxgNLkqAZjIT/vOCQ==","shasum":"f416f2cb3d448caf38e84f1d505db7c15624fae0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a911dd9.0.tgz","fileCount":10,"unpackedSize":25614,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhQoMCRA9TVsSAnZWagAAHpAP/3iHjrVf8p8yU9qw1bfP\nEaAasD5Z2dBFYWklVV2m7PvH/RZhl0sJoARUEvktyyU5igoYiCEyqyhpgF2T\nEYf9xTx240uFNfhb0y8B/VhLb31akT06o+BJT7hgcJOfYlI7xHBKw/RFdKTQ\n7UIJHTliZcquttfdcmhVippajLGaPsg1sZezCUQ/9elCHxp/J77elPZMeTt9\nuiTLptaqg5L1PjPT+4jfkr2y6qf53tPCEEtnSeNMBzr4QRpqCr8D0gDxeXs0\nDZv1NLN0HI7FcHcXhvBnb1lafDqIp+kYU5t4+LGS0m12twQ3S/l0pfRL5OV1\n1fu9tpxxGjtU/iiMC9126E2GGGm10xabIti+3SBzvvz9qchfPXAGEohmhlHp\nFt+fVkhH9XXqw+SkNGFvZvM24hFG5JcymuNpyZBo8nvgrKZBYQE1L4G17oA6\nRQrQSXJ7foayniD5tFZQ0+R6CsfcTKDVmN6u1iKMCymcloLeGfVSo4oGYtun\nGF28CYInGHha91cdYD1/KOZOUrMpp//bRgWMBvBlkpwKYzMUK7uS4iTIx/ob\nJP4zBn9RcFuhTcCpGCiBJrJvgZgUGIkH+LDgYZWk83uyihbzNU8Ttdv1uKjz\n+fsBcr6P/Bftn3SVkFadvpzhLORsjnPQtmnpzIzhZBSeMOy7lgCJCmob6INe\n0mis\r\n=oITO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHtl85T6K0Veh4f9oGTNiZCQN+4c8Zm1v5rOw4V/6WGAAiEAwe9l8mE4p0MvH/apzah7oPxQnUNZ3rMUriIm7GIx9B0="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a911dd9.0_1568999947899_0.2725005195437371"},"_hasShrinkwrap":false},"0.0.0-canary.67e33d8.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.67e33d8.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.67e33d8.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.67e33d8.0","fusion-plugin-react-redux":"0.0.0-canary.67e33d8.0","fusion-plugin-universal-events":"0.0.0-canary.67e33d8.0","fusion-test-utils":"0.0.0-canary.67e33d8.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.67e33d8.0","fusion-plugin-universal-events":"0.0.0-canary.67e33d8.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.67e33d8.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.67e33d8.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-LS2/oRCfXPW1KSAesb1eLJ4ZTlky6eV6ddNaVcM6OsP6dRRA/coh8I+8v0UEyax+rDEWWYlbChlGpbg+7pMBDA==","shasum":"8abd52988d140cc933ac8fa6799c63c1395c3cec","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.67e33d8.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdhRqXCRA9TVsSAnZWagAADBoP/11jVZv/KJ4aZpM62OUS\nmUC3ptlwfllqXlmv8N14kAjpROQ+chVg8Vqbjlsmksjij5F8q79SIxEGEIcs\nRMwNYUniJL9BDIF427nh8+o5Qe+6g/uH/H5B8sbK+12GJCG08rmd+wiLgBgu\npuG09ur0NJeOoBGRQ+yrNhInsNla1wzIq7V6z6uwblw1fG77h1SgcZhyhX3y\ntlUsv2Zvt7IIaMcnRl4G/1yHZPb2qDXU0j9WGvt+0Ht2mq0004pzGP0f4z/7\nb8LAWoA7V0Q2LtK2e26b78lXXKmZVfv8eKbkK/mCfuEaKEZEc8Iq0thWnqQQ\nwCHciCLsdNsfglwEhi192SLkUaRtN70swriYSSk+KXkx95LQWaHj/VW/BuLK\nE1C47tf8da6Ycc/QA3KTot1o/lpP5Ev1KEUzBGNa/ydE7OEivWmBVRhNZ4e5\nafbSCVPOiYrPC2AU7qlBjgug66k65mQFUFAtIYHbiyI8srZuMr4bAB+QV6ON\nQ16GdGx3+KXwuQCJmWuNWlvTCcZBVWvaTWOWBOqKm4SHoNBVaT/WnlV5WgMQ\nwhk55l/QuGpx06bj8GM8M306a2OFnsX4dUZv/PR+zlFussKc9tLcis9A09hP\ndIlscMZzdqVezv9iQ9ASATgwa1uJsXmu3ppZjLmBcgGLvOY4U7D+oizP/n/l\nPtBM\r\n=fL1x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgOEuPs9GwIAHjlfcyGXzVE/c//JAckZ3Vtlk4yjJyaAIhAPAKxCDkTOaWmJzF3lsuII0z/ujaQJ7i/OLG8feVoQJ4"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.67e33d8.0_1569004182705_0.6798279228519566"},"_hasShrinkwrap":false},"0.0.0-canary.d787a1d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d787a1d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.d787a1d.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.d787a1d.0","fusion-plugin-react-redux":"0.0.0-canary.d787a1d.0","fusion-plugin-universal-events":"0.0.0-canary.d787a1d.0","fusion-test-utils":"0.0.0-canary.d787a1d.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d787a1d.0","fusion-plugin-universal-events":"0.0.0-canary.d787a1d.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d787a1d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d787a1d.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-N25LYxUIuQHBv8z8iZw3Q2NreW9sKpbbrdHLEEzjpZlI63L5bVe2urhW3N+1CnEIpiygveNlE60aOcrGImmTNw==","shasum":"3d2b7dee20e3c3281535478e6bd7f0956081549d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d787a1d.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiR2kCRA9TVsSAnZWagAAtPYQAJ0h4saubhzp7xgT0axK\ncBoHVOB3IsFYNipChTfgt6DW6p0rlX6mKQEoiLm+bnhkSWqD0waHm6jm4JX5\nxmwfUeIF8b68wIVUbuD3/4760wpsvDP3X9d2eYWrdORF1Gz5pJIwbXi5PkNI\nl+IqDvyGokLvD+arMzZYlQcv7OjIfR0Etf9zSdRYzBApZ5mdPUVDUWWpk+bg\na8vvfuJ9cAydyBMkU+YI/5C9r5L7yqyX/2bznwXCbnsl6RKHsTSsa6W/wmhI\nyUrc+vHUbOy3ekEJtLXeWSKXV60bEVHj43P3gz8sZBperh2B+5/vK+J28+ad\nWM7P8lX3BWMgN5mxaAfkEI6RizJStYYOU3g0hEX110dPy5RdQ8pxgP2tXYc1\nPVutPK7FwedqEHUSJGL4ROvVTYGEacWRW7Ux4Lp02oyKGPm95TBkG+VRwqRw\n69bERQlXHilOHbO4dnTDyVetIncAH8p58yprMhu+dH2ZDQ14mXOsB/X/pyA/\nBX7G5B+Ak2KJKLWiFCBELRF5uqdwhJKuMPT++5RcmDgpf99AImHbXnNNE+4P\nzW9hTkUIjTkg7y05ZhYoRkehzOTTk4FSagDX7PYLmORVCI1g5p0WadW9bKCA\nT1tkzIjGg3lHrOwSzZ7CRhnoV0gmRQz3nghFqkVssWZdMDWdeXT196JZk6w1\nS2Oc\r\n=FIya\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9rgf1chWES886tEyjUZe4w0dIoCXu7Jxz/XCb08vyHwIhAITuf0EyJqDq47mLyXmyBsBsuZDUphAEGn/jImhKCb+k"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d787a1d.0_1569267107606_0.911814698503767"},"_hasShrinkwrap":false},"0.0.0-canary.a399454.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a399454.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.a399454.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.a399454.0","fusion-plugin-react-redux":"0.0.0-canary.a399454.0","fusion-plugin-universal-events":"0.0.0-canary.a399454.0","fusion-test-utils":"0.0.0-canary.a399454.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a399454.0","fusion-plugin-universal-events":"0.0.0-canary.a399454.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a399454.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a399454.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-M3Lac5E6nMTyrG0otlGoBSXwfd6Bzphv7kQ9ErxsCKqiWBJmOud7EKfao2NDvm6mObHwuGn3QEho6EsBaNHmFQ==","shasum":"c9ff5c8e2f1b81422266f9b4832205b5661cafcd","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a399454.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdilO0CRA9TVsSAnZWagAAC+oP/1+y9mzHkw4QHm8k9bUX\nRGX86z8c/dYmaJt1aF39tzyygA84JR7+LdBB9xPX6CQH8c5zul71xWcCZbq3\nhWOw9nFJFUASk7Mb7j0fqEI3dToGNCqxeBj+bbngYz60Q0laVm3Soor7ImHn\n7uMju4ko8AI8Lq2xUDqNlRMb8vjt3ZcpwFiGnYe5YF7C7vHf7G9NbdhJsoFW\n41ue2omKDiM8e19+vOoIzTOiVB9aELq+KJqaB8c4nOi8gVIK1gZrikw7tK3i\nZ9Q06JEGkRi2xxrx49GeJaqAGcpAIYOW7Xe39GiPeLe/exg80fbeIwTio1D2\neczRS8ddt7k0lukKzkGQQ+3zgaRFHKaJ/XqH2q7xUDRqPUsAVL4n4sieS1jz\nzGDF0ULklSgy5EeVUR3dqGr+123D+g+ny1RvJ88397lqlsJ449vfcorNFY6V\nxyQQSpZhoGCH5L0wfvVe+o+DrU/vP+0RWWoQK8LoRnCC3+w89EwWjPEST7DJ\nGkf7tsuSFFZwkhMfoms1561zodvSFYvdzVfP/8N9wDd17mrRsjXRPzyV1kVZ\nJEIYvRq4H5g62l0gpFHfKyeyhs6uIFqjYAnmZF/en9xKFeNoSQF1YBubInPR\n/eQsrNtYq27xWL+yy3XdGA8Wbh8TYVaADWM627B5U/uSSE9ZkQrDlVVGn0Iu\nLc8v\r\n=xiQr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVA+yAiGoEJuwFyA75LAuZ0sVkmm6Cf6RQZAnA1irQ5AIhAP+pRK6L1gyWLlj7rCaHFBoo+wtycRKklyQWYFE/1xIL"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a399454.0_1569346484193_0.07112410557706084"},"_hasShrinkwrap":false},"3.0.8":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.8","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.4","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"2.0.6","fusion-plugin-react-redux":"2.0.6","fusion-plugin-universal-events":"2.0.7","fusion-test-utils":"2.0.6","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.6","fusion-plugin-universal-events":"2.0.7"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.0.8.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.8","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-P+ELQuxECncC/16htV7zN0cvc09lkFl+mNhtB/GmepP9f0u3X9uWzLm68Z46ApOh67wYw/zVWoxROS68WT92fA==","shasum":"9c4c220fa9ae2ac074781927343c8df8bab0d3ab","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.8.tgz","fileCount":17,"unpackedSize":41982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdimLWCRA9TVsSAnZWagAAtFgQAJD/LHSFWQLbpVWAJOcu\nNAD1W2277ufSwdy1wyuOM3LA6rbIfaQANMn13cjyBMoPa63JyJI2LPEX7za1\n+O9XRBoAlNZ0oK8S2RUOOQHvOjQmqs6+eUXCTw+XbGLmb7hxmO2pwg9wEuzS\n7cpHwKbZOQA2DB/WsUtMpN7rL/EFWbB0KApDkmP8m0ouNPVhVFjRMiVKltv9\nuuD+KZF+Bx4VKWTDlNBQHBXw0DhF0+3TFD4sxgsiuSVmhdwlkBeRg0+h05ZB\n9t5TutasAbJ6El1YAZ10CrX2sRlicXEDWH1ru7ShyWetAUwZt1oi+Eb50n8C\nKt64nrRnoSUME85WuHhspx+0NULaol2n9TZCMqbnh9nRYAxwDI0ncIGN9UR0\nRTzclmeeXsnF78sPPXW4T6Rzj7vWeiNz5SJHWTFPtLJQYP4Uxo/Gprnw9/td\n5H1wiPZ1Id8Oaf2NAp87FfXaiQyz8d/eqEe2jL+/+b0rM6oOKKKf9lU8Kd4b\nCFLOeF5jzG0Y/oLaiL9KVTb1m/+/eGE1cijis4DwXjF8ec+IQiXcRsZ63p+0\nc8nmPmhlA0bmbh6fCLZbHl59MCN5PsBhgQWIinODY7SwWKGkO1WdEt7OdwGj\nGdXPBqwKG0LxnWuRduCQ//PHIMS+eW6p1YL37Dry892O+DsY10VJhJMfTs6D\ns5vv\r\n=asOw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFriPhRZPcquLaTRcPwUOLzaSDlUD7Aq55kdsDYPi7B3AiAvdn2oPXZQObRQ5/wCxuAIxwDEp5Q6csp/7xw3D+Te0w=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.8_1569350357901_0.4132378380977364"},"_hasShrinkwrap":false},"0.0.0-canary.acb5af0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.acb5af0.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.4","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.acb5af0.0","fusion-plugin-react-redux":"0.0.0-canary.acb5af0.0","fusion-plugin-universal-events":"0.0.0-canary.acb5af0.0","fusion-test-utils":"0.0.0-canary.acb5af0.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.acb5af0.0","fusion-plugin-universal-events":"0.0.0-canary.acb5af0.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.acb5af0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.acb5af0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-AChbD9wFE1EkonwWmy3991fCnlJergrvBLTRlLTJkGoUGiyZFdRhrJm4H6cZyEGXQ6wGCsphyyMHACXQb0NVjA==","shasum":"94cae3c18def6e0e74cff84b4b3e94d9b1396748","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.acb5af0.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdi9hrCRA9TVsSAnZWagAA3mQQAJbWmSHacc0OL0ldAgwE\nv3j9QBQE8eCB8qkwi0ZE2Ms6gM9u8f3lw6pn4e0l1lRuMGw1TkL94I0ol6vt\nHe9mOwhBozV5gnTPSa+LKE3NI4i6whEuqkqY9lbP1Ygt0VVimB4vn0vzOnB0\n43T1r7icsbH+YLdYHYCJKGvCMjYEFmbS/vQaJkkvE20s0kJOrk6BXJ7vnYYj\nHP9ujH3dL+lN2uVoho1wkI28XuHX5Mtv9xtcW6sbBHcj2ebc9fbxXsokXXSl\nXF/fq9bn7KWx/9FxxKVoUXFfj7yCl4fkNM9F0C1nh+jO/0JMAFeyckCKnnZO\n/pGWfNSsQ4DrVqBb0ClFKQgfPHm4nV3eeAFQOqMQpaOKx7Gwth1G5ulb9MMf\nawyko/a4Q/X7drJtexMOHoZuaVPqhJSutqCjAHBQqZ1YV8dtVjwyrGGnm5Fu\njyvPVQNzzQL/UtB7z63VZtaDrfgnnycCekSzpX5aUfLmVLK7kuGM60U8ocBY\n2fmAN/BEQxqbf9Sz8eBPod9VVRykkK3o8uaNHpuenEZ6K7NYWOzkSG1Px5uB\nDcoc6xRF9W5x9SKnDJiu4Enh5i9Jf5PraLdUcMvBFdzrRCU1vgy2c9dEnk3Z\nfYm9XdZt036s/A/49p9v+aSrj/TwslefbNfRZ4UuNqPb4NJr8CFMWH8LTcXW\nDsro\r\n=mU24\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDxtnEgehqgWF1Vq0TECskVqbkoY8vZgV0XUvhINH9mgAiBZ9nFhpxnVisLjOiE0g3lFlFo3zIM9K0r8R0IMQ15fMw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.acb5af0.0_1569445995459_0.5055990525699321"},"_hasShrinkwrap":false},"0.0.0-canary.d7c5910.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d7c5910.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.4","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.d7c5910.0","fusion-plugin-react-redux":"0.0.0-canary.d7c5910.0","fusion-plugin-universal-events":"0.0.0-canary.d7c5910.0","fusion-test-utils":"0.0.0-canary.d7c5910.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d7c5910.0","fusion-plugin-universal-events":"0.0.0-canary.d7c5910.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d7c5910.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d7c5910.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-FUyzd0ftyK6PCsUhrOMvz9aSAdCu+vWVvnLchbKk5MWSybuAUUJDjzwHWMglt6sz3yCjoDadUw4JPR3UChRUIQ==","shasum":"2e7f43ab5f991c336430a2c43240b98f4dd6ec61","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d7c5910.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdufZLCRA9TVsSAnZWagAAEJEP/j8a1kr2lWJo0Zkux3TA\nupod7DvrXOQmfiJQkHkD1WV+bN0XyfTERrNbLOX3I0NWLqM6Okcmo4F34reM\n2Tet2y3g3s7lt/4Sa1wIOGTyIA2DSbuUhODj0e/tIgneMYpTHUVAVPqqsKBl\n3CujhPU4gAl0UkGxDb08uLu4N6q8h6hnb3S0+XCpd8lL4OLfA50sK0Z8FB02\n2VYVbN9bJntXydczFv6i/as9bMQ3Hf7DsB3XaPs1nsHQbOtqsCm9MDRwvBlY\nmVChRzJJ6lt4OQtad17DDEqA9/Ic97gTO771546162triDqfAXrTi3QRYJkV\nRb4oItPLufwi7fXjcUIM6ZB5ezJbOKLM0mietlkjVt53/i61v2O+HUa9Tkfw\nPVXIu4mT52IeHVdAMInVThSZI8EQjJwrIyQ/ntq+UW+irjHMvj0Phdysqa/J\nm4Nn4qGY540LrYphJG1utSA2lew9g+wQrE5cwDefFO2JSYCNv9OosC49j9xf\nc0izTrkZfuHfs0rq0FZZXHnXR2YPCiqlHVdhyGUEVonVaCDm+UtBl2yUswDT\nSmal54/yWr0xL6mCJ0lEqETHOJ1fI0rm3M2RMlejP3CfCQ76ftXvV4ArEm/S\nUP/c+GETqvE3wMoacqZ4NZZ2WhO1wYniDymdW3NjykQsobkHNbLfsrRZu/BN\ntalB\r\n=5tNa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0SWyvmZ5X7eKKaHWFcU3dDWpcEjbZB26kAxEp27GlAwIhAJJNFA8qVCs98N23R5yVAi8t8dlUOSDFWPy3hUtWa5Ua"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d7c5910.0_1572468298823_0.9757995911620578"},"_hasShrinkwrap":false},"0.0.0-canary.f12f055.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f12f055.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.4","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.f12f055.0","fusion-plugin-react-redux":"0.0.0-canary.f12f055.0","fusion-plugin-universal-events":"0.0.0-canary.f12f055.0","fusion-test-utils":"0.0.0-canary.f12f055.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.f12f055.0","fusion-plugin-universal-events":"0.0.0-canary.f12f055.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f12f055.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f12f055.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-rg637P5Jzixowkr+NL9yNiVzgCBaYWN6d65YV6w725WO47g0JyAJqHzIdST6mn6aQvcUN/ECw/fwJGd7BkwALQ==","shasum":"608df42a99a4842bb9e6a293209b48e1fb93dd3c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f12f055.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdugpQCRA9TVsSAnZWagAAZmUQAJO4ZdXyp4rhDxY9LH86\nVK0ZawD1VhD4vd3AaLeGpMpbLxEHxNmkyByGJmYs2/6iGwh3Q5BZtfEl+k1w\n1iSqq+BxRiTtT8DEZBneT0+4guyI6BZ0MIL1keuqxwe/v3gMLEzu0V25SMFD\nVWoS2rhU1xNn/y5V20TCPLhPaSIyZqqhYe6KtcnF/3rmKaupCN8wLJsg/sES\nWPtMpi8jMpNb7ZWH7R1DtQYk22sAz4TBqppdEeHcLfU0kGr/wgs6gLYMLAsw\noujZyUSGsJbN+O75GtWjvT31PwBCNfqdBQKr4pqoM4IuqQJv0aAY27bPFhhU\nQx5J+wl4qZZrlZuu3GNJmrQpI/l9AUFpsAoLBotrqJlSt+oTMQxotMBkq8EU\nKq5EP9Qqqb5BxW/f4aS1g06ZNyhnLFwYD8PsAOWWPUTeMb/C6Ob6G+ZKAyrM\notAjWoUlx9G+5WQVT4DRkzfiIUP7e2o6YlZr9KVdzl/0mIMNW+XPZvRUSd9C\n3WhXc4IUlemTVnFT+vH2XSbLCfI5QrUN68dcWM6xqoa2b2AiCTGqPVirv+Qt\nVzVx4Y1t0YCme2SJz4MHaK/OP3Um/+43J9nMl3U6WpLhPgubBuzcjPll3FX/\nj00b4jcKHd95vvuKk76jtwtF8LBooN0de+Sq1IUa+kKtFAI7tXnYerpCxprW\ncXlF\r\n=j1rW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBHahxzTn9Gzj3vcRA4cyZpHuatXaoTMs+57p2NhYb2RAiEAy/cL4KPfR1bVxAfcuqSmICGGiRc7cJBSy+esRSBHMFw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f12f055.0_1572473424280_0.5019126188805481"},"_hasShrinkwrap":false},"0.0.0-canary.0b935d0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0b935d0.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.4","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.0b935d0.0","fusion-plugin-react-redux":"0.0.0-canary.0b935d0.0","fusion-plugin-universal-events":"0.0.0-canary.0b935d0.0","fusion-test-utils":"0.0.0-canary.0b935d0.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.0b935d0.0","fusion-plugin-universal-events":"0.0.0-canary.0b935d0.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0b935d0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0b935d0.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-/TnvnKHDodIipET3iBjh8WF/UtySNpEwaEwNv7LQd7OTJXMpygQoqfacRlfzocT3d5I4K6L85K/YLPXK79fZGg==","shasum":"5c51ff72b62eed4fe7d5e2c391729e94ed98d38a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0b935d0.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdugpjCRA9TVsSAnZWagAAWPIP/RQo1XEIVWW14dfMFduj\nSvVlkIE7xIfisaPXVWnJxYgN5Ay10tJtYPKCMh5KbBv79Xp1vE8V5q9cgz9D\nuXXxkMBv/bXbetBwPoQuty5MOyL5d8qUNgWidbaiuLDjgo3VNErswSUbikJe\nnl4cZb96Ar+DGIaoQ+/LX8fhDnyct3FO0gFavWfR2ut2VILcLR5MR94TLF7U\n5OYXcI+TSRpEqXHJp6+l0Ji1SUf4hziXeT3+rXmsx7EqgyhLULODiHh478Q1\ndhA0/knkaROmTOv5mx+k2f7jDnGBdHH9RUvJwpV+aCULzUb4820FbJV/Cegm\nq59q0TTTHK7U8fQLLXWRQPqmTfHaTqZiQ/IoYg0ZxIb4yns8w2ynEEReKLx1\nwJw0nUOVz6woeXEU6vZRQtg2iZWcy7Tx1Vv/f8oA/B8nXlD7k1aa9OplvAeP\nm9lXisSafvqnVu8aFwVt8rZwPH9vT77TJ9M0CZzx8akFDw4/i9/LOUao6k0T\neLydL1Vqq9rvm8VckEv7zmx3fLfLjdK8t72C4NxRP70GYeL0sXzIl/rcpJB6\nz/rVrSe2iZSbm9i0AnVhBLKv0dC67tRmSSKbScSvEBHdjKltj1P5zdeLT3Dr\nrPRMHdMB7/RD7ozm/vfoR3gD0nQffNZMFnFIAllocuAV40p7pAQX3PYQGQMf\nj4Ue\r\n=KIhb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPVxp+Vy24IPjWCvBTqwvc7xMT7xiICbXHO6TBIRXRkAiB5XCIkqm9QSMOe6bFBqR1egh/ORZoUMhqMrbZ1AJ54bQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0b935d0.0_1572473442963_0.9960003305206406"},"_hasShrinkwrap":false},"0.0.0-canary.37af1b2.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.37af1b2.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.4","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.37af1b2.0","fusion-plugin-react-redux":"0.0.0-canary.37af1b2.0","fusion-plugin-universal-events":"0.0.0-canary.37af1b2.0","fusion-test-utils":"0.0.0-canary.37af1b2.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.37af1b2.0","fusion-plugin-universal-events":"0.0.0-canary.37af1b2.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.37af1b2.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.37af1b2.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-nTDFbQj9vLYCANH32J0D2sN5oVyYW9bBCBHz3xnlsden3UqCosYzUm7e2rBsXvwhU9XrkwWGYXKt5+cp8NU4Eg==","shasum":"f95dbc9063e94d18a828994d0050435abaa8b6a2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.37af1b2.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdwQgkCRA9TVsSAnZWagAAeZMQAKTFGVetqUGt5hcuk2K5\nfQXGzPBku12Kscxb2Y9NVb24OLxn5dOXI4SOD8Gox6Kq2dTEKekeAcgTQZ85\nAAzgrn9t0ayR73fipMfzW8qbEKJp6zCeMYHFinouP+aBvUfUjUzdnnF0Dpd1\nIEp/nMlXQrHHcO68XIQeV7+4YXg150QSh/IBLch/P4BEJ6haBDffVksXezsH\nG3Rx54jT55/Vj2XmdStRhvflL/6iPLLCI6Ni8oiJzBL/pJkj2+1LJIYGhfYF\n+Uhu9Vivn09nZ4k2ouX6V1Jbo6uhZcWEk5HxbMbQ0AGG9DgrOdcDIdFu67ar\nz6qDkIPpYXtjlUyX+binhjT1wnGwHQVVA/1Q+NqoW2BI24RAJ3R5gyoV9B54\nKWV06nYntcyY+nCEhs8it/gpVWuQ3SvwydUlR10PmjKFmfFiw1NzMocHKIyK\nMWmsMQHbYk9OL+yGRFtQyrX0YHr+Dp1FYW4K8HklUKpdKpelhAcXTD6DxPMw\nF7IyqvUP2av5GZd1MQWgaqjLaMX0WQwTDvKxPPXfwYS2ZA/qeZAnpaK308rw\nLZdiB1dy7sFSfnJcU8IddW5ctJQXsCeyTL8YmH/F2y+6XaSLTohNhTYG4r15\nqVDNbz/u/SKlq8/xloXWxMXrDU6xrmwb9IS1UAyAh+pvxh2vUrZnTyOLEPsF\n/JRE\r\n=1w7l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIVztm23ocNpz/Dgt9sHfoKkHxEfCsnttJtpUQHQYNGgIhAL9FEb97on8l0eQ/EAnyduwBY+ZocK3s6UqQi4bJkXJq"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.37af1b2.0_1572931619927_0.5077091865596695"},"_hasShrinkwrap":false},"0.0.0-canary.e3078c3.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e3078c3.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.4","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.e3078c3.0","fusion-plugin-react-redux":"0.0.0-canary.e3078c3.0","fusion-plugin-universal-events":"0.0.0-canary.e3078c3.0","fusion-test-utils":"0.0.0-canary.e3078c3.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.e3078c3.0","fusion-plugin-universal-events":"0.0.0-canary.e3078c3.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e3078c3.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e3078c3.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-GUetP7qL/tcz7YQnlJRlkLqHQAKGccK+bpoZFvCIlET9flZs05lwtNdnBGIrhEpUZD2GXnnm9LcKoMKB0UnvIw==","shasum":"b7a8cbdc4c776a296e8119aeaae0284694cb3eeb","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e3078c3.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdwekyCRA9TVsSAnZWagAAZTAP/A7XmbbC5bBYYDibEqeX\nS+FJduvW33xECFyWxpKjCIP0CXBG8ZcMLI2uQh/bC7WAFhLgFM56VTQZ+UBc\noEtANg2C3eVTJ4xY5nFNhGIPxpEsNQBVcI6Y/bwaKgjl/tH0sfsVksf38EV+\n7JzbNBLCjwqlTGVsR2gLNl7l+VQtemV6tI/ttQBmQw2ziFctGP/QwJGstkg/\nMPqoe8zOn33ZYW2Y4aALt4CZM5yovWr7tXnUCM5w2CEZDONj9P/Dl+Pj9LSJ\n/qiJHr9DB+vRiAcMs7UoayLRQHrbhU5LOvBRkJ+n7DtRysU5SNqxjV6q3+Pc\nAt7UgFRY4XEfzzFh/1xS0Ggs3QN/0RxpN6qT3DWjgt0y+9TDMnFWA361uM5P\nGjpnN2qCS+27A3lNbh+vEMYq2XnMqiXpgvqazbNThjBCuge3Ka/zpWWF66Wg\nOlvLYqiFQsWSqWC1ScKqD2PC02nLObAGZYHwubKy9faFxXU6bvzbrc3Kgs1x\nIBRLoi+jGb21Kn/yG9e54n+En75YH+8tQxL8eoQfY6qAaCgVrtxfIeVJfqDL\nmfgOO0phOVDSx6vGQwvLIbwn2mEUOX9b3NxSe9LwOmnnEbrm9w8hissK5G6q\nXmV5uxLcO1VYNc/YFkTv64QnTCIEWLSw3g5p3jQo1QTsJnHu0GPub+C9yhg5\nACZO\r\n=QoSl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyhB4bmDIiKrOId3p9OJzO9ofTRJFzAm/XSIjSgxrVDwIgA0T1FsYiquw7IFvdrJNNYTGq0ApmJODK4mGA3m37Cfk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e3078c3.0_1572989233447_0.7083465728921534"},"_hasShrinkwrap":false},"0.0.0-canary.f8e4f0b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f8e4f0b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.4","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.f8e4f0b.0","fusion-plugin-react-redux":"0.0.0-canary.f8e4f0b.0","fusion-plugin-universal-events":"0.0.0-canary.f8e4f0b.0","fusion-test-utils":"0.0.0-canary.f8e4f0b.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.f8e4f0b.0","fusion-plugin-universal-events":"0.0.0-canary.f8e4f0b.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f8e4f0b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f8e4f0b.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-zNTtO6lCxvrl88JWjRv+n1mdLAZEuy+ZeU8LuZbeOn/W54NMJap0Za2VJWgf0B79ctjS0oCgCdxWM4Po/iNAqg==","shasum":"b1d2ab5a1f02f7f5435a9cd58772e630799b7942","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f8e4f0b.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdybMVCRA9TVsSAnZWagAAbekP/3RC7G+1Uu6iDcTk7XGV\nNUfgE2yqwzRSb0jH+9qQc8JZmPz3+WH7QmRr7IAIlgjrvPrWBKOL52LskQD/\n4f+0BSEmVJoDdCjnLcqOFL79tz5FC7lOPNGCJITA41krIKIO9NofbZ5HQvnR\nmrrp3YcTTM1sNUzfH2twFp1RepBDNVIhUC53v1oI+bBVNAwobbkgXYe0Mn5q\nxyyEsE8mLgiysK8A9F6913Nl7Q8C6tFgXzU/gASRrU4QarhMqSr9eayp8/De\nPjO5dpf1Ql6Owhhk0UITChNTbd+DOWOndzOxCHq7Et1czz52gJJnLr5PQxBp\nvc3ypdz6EbotBbUZXdg6Xk4yk0JGM/JAPoGMWPv2QCahF0hp2WcXd3qNwR+e\ns1MctGdmEr6qOfYgxHaczasXTf+5W9JHBftLORvww1nUG8IWDWbY3MLrtoKv\nlK1sKjNNKksWqmNbSvU46YRiccaxnrMMrX6hfM3I2AEc3ky+VjjLzSM0pvQf\nlEkE0BLnKheXzrsMzTj8w5qa5NgDEiE4Czop5bqa/Aoedesbg8PC6o/aZAu7\nHa55VbeascjfxQQxKa2szhKYjyEnTZeCnqX3llaoUAk6D3ewGexCNPp5rSSu\n2KpmfyCfd0jGJbwpv/8GbX8CCebqVTYcNBYZ4dHGke9WRxZLzEL/Ok7B0t9/\nFgVv\r\n=pH/B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHK2UMylvZvCl8wSfV54zgZXbz3GFic5oT3PRErYF7qoAiATJMcgXgxplsTl0zx0wsLzjQQs1bA6HV0uuAbHeB6J9g=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f8e4f0b.0_1573499668880_0.9571262403059175"},"_hasShrinkwrap":false},"0.0.0-canary.0af264b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0af264b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.4","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.0af264b.0","fusion-plugin-react-redux":"0.0.0-canary.0af264b.0","fusion-plugin-universal-events":"0.0.0-canary.0af264b.0","fusion-test-utils":"0.0.0-canary.0af264b.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.0af264b.0","fusion-plugin-universal-events":"0.0.0-canary.0af264b.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0af264b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0af264b.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-lK0BjZZrYN3bzv1JwhXgkSbw7uwjCDCrsIzkPWjlcPGDm1BOm8IvsogiLxvKOIWVfp1hIKMg+lbH4yQhveU9pA==","shasum":"bab7d32a99d9d93d87e38416234cf53049eb600a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0af264b.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyg1UCRA9TVsSAnZWagAAYFcP/R5+vostL0mQFuRfVxEZ\nU9SPzGFtizr1Rz84cQsvIN6jdfKQtWalo+gVvCVL6MqqveP8YnGJwLYF20kH\n5PSDceOm7G/49I4CTJj8MGxqfnJprIvHIVC1fKsrxewr0Uo3JV+RoHA3VEDG\n1DlimnOOPhRKbA6a8T0U36sIwG4uHUXaejICCVelAAy3k0OFLbMrZ67t6S5O\nTdVeFdCR+FRfK2BQ0tcAjcmvEGVRTZLlbz6zNrl4eI24LoBrD1FVZjiyAYxU\nB+W9aaBNQFiJfzN3GcUPoaBFjCwsiaPVyh1UOzTTijirGWpOlLSX/qMp7x3B\nj5tkw6rgtI3/NAJnCzCXOirkPfiwnwHzquroWpZrkzqOzU4MfItps7o2tczN\n+g1vBcOKLi02rcYIVbSBOzgnONn2SQuLlP3G9KSZBSpYnzMRIIVbNfFFJC2E\nkluMdWerm5jTvpUH/jX4rUMhjkpkJfA0ijV6uR1hqxRp6ptuymDsgRPpmlXF\nZq7NV7nhTg3nMjqgwVvk4NMQROTSRvOnEu8hjDaMjnhjfblQCa+nrIYIKZlt\nqow9VPy0Zl8LzBDplVu7iexz5ElUVBHTOAZxBCHtEc/Bphkthvw56Je6wqGt\ncy9rmsFk6jwGcwxadx6I3xb2EjbcZve5j7qCrfstARGzKE1U6Pfmgt0bKpDO\nFFGi\r\n=7aCD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrbhBS+t8SQo7XhldWlOTeR/yTygAx8Zw5arNtksdimAiBckMrvW3Bzop2ybb1Kfaewq51bA6phMJCys1X7dzWfgQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0af264b.0_1573522771745_0.7773696798734993"},"_hasShrinkwrap":false},"0.0.0-canary.78c977f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.78c977f.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.78c977f.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.78c977f.0","fusion-plugin-react-redux":"0.0.0-canary.78c977f.0","fusion-plugin-universal-events":"0.0.0-canary.78c977f.0","fusion-test-utils":"0.0.0-canary.78c977f.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.78c977f.0","fusion-plugin-universal-events":"0.0.0-canary.78c977f.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.78c977f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.78c977f.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-2xA3hcMmDMU/mdZZTTcxRGoekHRSV5DMgCts27/A2gOkXSXURxPX58MKHe+sPd/VJKe0Zk/V3BF5/EWdtTXfhg==","shasum":"d946027d102c5ee109e16d2bb9ab8ecc00aeb0c5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.78c977f.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyvDcCRA9TVsSAnZWagAAzX8P/3WIdjQkGgJZ9c8d3Xmn\nF++ppPpwC0kn7TVC4OBYccumzOC1d+JCZFp+kYLtYNYFitypMESUksh3BYYQ\nqFgXt51lr0fMemzlUCjiBw+YKCr9tfnH1wLyB+b8/U89KUInhTZMWwFfMjpr\narNfPbCuDxNX5AYa2pwRlEyf2N9sHm3SrW6ozmfA09KqH9qIkGe1es8K+sL+\ndx2SbdK1KR0RjNEerLnbQguFpvC/L9X4m7HuOvZihe2TLR51HfxwMXtdDqQB\nlJJr7sGTbWQwlTzV8Z3s6uWQIAfrERtEvBAzRk1G43X71ZPQCKfn01hx9787\nSBeenJJMj7+pf+IMY8r7lEEGvwEKpvqscHvYtjgTBbVUAaNiqj6yG5QjaOyW\nzKYAhLSa6Qvu/gWw0hK8lKkdQVfHBD4GAHFHi9ivMtt6TdMo5ad/X1rcdVLN\n1q9A0jXFWxW83YsZtM6z3QV/oHvPSq3BbxZBWbtZ43dKzoY6oJSMiR170D4r\nEraYgne3895vHKD2I0wvnh9a24JtoCYJgarfhZ3qlGiVPiWIJwvvLbNeZQEo\njFrU/3U1NegliZLLN0j4gNBaWkReNqGn6QakUZ/s1Zl8VfdIMGsYrYtkivGO\ntn2qpug6XlusnRioSjNuoL5CeQCxqchPF5wOBXjwY2Da8hPFNLYikBM3Bkt7\nsgEw\r\n=5sd8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxG2BIB5O9YGnzjaofMdFNVpYCOrBZMzFCTaEX5EIfIQIhAKPQGiQxE4dX/gQpobUi/G8vlzd8JRxOod+tl9RZUJd/"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.78c977f.0_1573581020292_0.2507152464533504"},"_hasShrinkwrap":false},"0.0.0-canary.0af264b.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0af264b.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.4","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.102.0","fusion-core":"0.0.0-canary.0af264b.1","fusion-plugin-react-redux":"0.0.0-canary.0af264b.1","fusion-plugin-universal-events":"0.0.0-canary.0af264b.1","fusion-test-utils":"0.0.0-canary.0af264b.1","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.0af264b.1","fusion-plugin-universal-events":"0.0.0-canary.0af264b.1"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0af264b.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0af264b.1","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-O1UvTg3KqJnU8XSIY+gvHZmJHErBAeb9CCa6dGTrWY7sDT1C+HOtMBi3t7NnLjMDZeCvgHW2nAFzyOyX50zZ3w==","shasum":"87defb68f801166d09a4cd06a75caac9b778dea5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0af264b.1.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyxWCCRA9TVsSAnZWagAAMX8P/0/X1H5NiuK2WMZzDqvk\nw0sab/YwArnzetlM2KOR+Yajart8rAxoIPGbfpSEgllbAUcR6SWHYXL1rmwE\n1sEIbZjTen4gEds+T22FaDY1NnQxPqsbDQcIXvj5kwGKk4NVYawZvSsFcjMl\n9FPGV2pbMp8HNwgYMe+igIJ3LXcshalCz5kCLEKwRBthkg3UtMHREoFtB8j6\nO9Xe66m6VT70jz621XMjZv4OmUnmq2wY0XkgKcegX+sb6rurqrHlcmrYLx+Q\nXJZFw7+R7d6UvvkGg/BFiR+/6kBnEiqbsGy8WaqTP4patccMMGvk6ohJUgMQ\nglAq7K52UPNgXnPv/AloLX6XmfhPSSah+872CvrreDLTLJL1aiCYjo7ubNkb\nGRG5uPoCJce4DTE4x67uv6oFln5JmXvKEmHwcUbMfipBYcVVkxtevb5+EfL/\n35fAgJEDv22Okf6pNdpSb0p4mQaRPMbmXLISCBMpWx/XJs4F+8rZ04cZQXyY\nG51FLvAG9dBC7Eo0ErxnJ0YdbgvQGtGL34rkWkGjIiJsXRxRP4GsMRLZRKHk\n8CLqYXxhMRtol6xzhSCawONw5jPnoZFPack9NR56X3Ppki87WD/jKzKtktL2\n/ycqtmHPNI9iUWK9SQtsuMG1yV98/oJPC8X6GT261JedVT859v2DdNX2Nubt\n9Fzp\r\n=l39E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAOBCeGrRPNg7jPrOHXAx0RI8tf6De1fttl7CyUR3kY/AiBBKCoZfYbKH6kyX1shfhAbqS9f4gNI7TcKhgl+F170xw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0af264b.1_1573590402192_0.6714263529568583"},"_hasShrinkwrap":false},"0.0.0-canary.cdf3e91.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.cdf3e91.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.cdf3e91.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.cdf3e91.0","fusion-plugin-react-redux":"0.0.0-canary.cdf3e91.0","fusion-plugin-universal-events":"0.0.0-canary.cdf3e91.0","fusion-test-utils":"0.0.0-canary.cdf3e91.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.cdf3e91.0","fusion-plugin-universal-events":"0.0.0-canary.cdf3e91.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.cdf3e91.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.cdf3e91.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-H4Oury9FeIinx//pEwv6xpSrZwJ9fD1LTM4+wfEnazK8zJKkbAoOpwSvmR1Ew7KFAWa8/Yw2FnbTVejuOXCQCQ==","shasum":"822aa9fce2f00cef8aa4b64e7ac19dd5752397e9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.cdf3e91.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdyx7LCRA9TVsSAnZWagAAXNMP/0uijNY3/3XAldf74qsr\nuxb7PyJLRCVy+6/7pvsqJ97Q0pTmso5ATTesGMZ3mw87f0TUd2IInWspqNXO\nb9mSTFgYWekiBu4e9gBe5bo/muOExhgEwr6iibqs7d++ncAu3NTWKhKmKnGo\nzkP1BpmBm6OAI/4GGO1ATwYhrC05e3mk1flO8g7FyWWkQxYf6x46KWR7hoob\n2Jf7vXwO2AdRWFzuDPtmIo8NmF1g24kXunztBErbJNsdpicqzTH8ScErr53Z\ngxJJsPOShZF4daGJyXYRoPlkUt9E+Q1+KeDCn6BnW282SH8uYVqBnZxBtjuL\nQjJ6EVq/qx9/UW57lWu+Gr2BVaf+F0zeq57lQRieE+HJFSTa2sJj0IxcCKk8\nhldUCHvXJGcsP9NL75cKoeEVzKUGGyvAQHNmRIMhUgfmvfGB5fPkFdDTOEEH\ntuja6VJIpV5od2o4rF0OSil9HMPcDvO+o7Hro9IACXkEBG9PZVpdx+uUfJMS\nXEcw/sjthjtIBP088mPV4fl36lAXrLncPUtNUtHiqARozTLfVNFG0LiJvQOJ\nr6CY5ZbV7OYUxnItNvxDjOTbsC1psBdprdfEd9hqZOisThmuSeTjwAn7VmYG\nm8m+FxsEbLSETp1b0FigPAy2ziffqVuhSZ8RhscY+EtbqoX/B6k9I0EtK4UQ\npFS1\r\n=L7q+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBp4XXLatUKveRcadCOlFOPZTFHXlfMzruJ6dNOr09UAiA/fFsKgRJ2bqRs3hr1ZNcmYgQ71M+k9nEFv3+GrwP4yA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.cdf3e91.0_1573592779091_0.9274779151572732"},"_hasShrinkwrap":false},"0.0.0-canary.55945c5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.55945c5.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.55945c5.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.55945c5.0","fusion-plugin-react-redux":"0.0.0-canary.55945c5.0","fusion-plugin-universal-events":"0.0.0-canary.55945c5.0","fusion-test-utils":"0.0.0-canary.55945c5.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.55945c5.0","fusion-plugin-universal-events":"0.0.0-canary.55945c5.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.55945c5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.55945c5.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-dvgRuliSP0rkdGFNCMwBL8XRkkKJUe1a9JW34nCTiLWANRvO/IcYqneGWz7zsPKZnVA1CVXJ/tJ0Xk9dHUdO0g==","shasum":"e17a3ca29cfc18f19f05cf3b277b855597288fd3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.55945c5.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdy0c6CRA9TVsSAnZWagAAbVgP/1ucg5nvy4p55/qYF6eg\n/V5XqearumtxtiJrCJC0jUNmLfRhWrjl1HaOJyMn4xvLzWIu8HmXcR8+C225\nmn0gjlrpHa07Id6cNDkZ7ycgMGLL+XfaCe4sApDH2AdvQD/BByonjqIgfqb0\nyEnGPOH1ChoZsuJy2dyrbW8aGxCCGQKTUX7Zov4PRObjzQmREqH25qU5J3w/\nR3a5W7dx35VSUw75IeK0OSNt9lX7Dpkis9NGukZZ5TYa3rY06o0n06wC/Qrf\n79jnOMM0pz5YNdZoFlX3k4zYotU9yuf/pBiyplai3ZoO+mQ9nvC4+0jb7pf4\nl9cWppBoAZ+2poGADYOoYz22heWvg4nJorj64DH6A6A/NL6fZZ+40QqJ6wy0\niwzvM//CZ8J6SOPYzyJt4OIHI9vX+vvYgoVuCP56HOE7TM0hXkZ5V4M/U/90\niSZ6CJW4uHoBaKUrSQYGaQIGxy+LBdwm7Qr22eZZelE6HaDvVXc9AA6c5FK1\nUyMsLZbmYi6gNor49puhmCEwl6lbLGnZnFVK5vkQVHTThfWFg838feEfSh2n\nPoAtLCO+jB1bRfMzCKfTJGP5Tek9SbDsw/5fTXtaGJsH6npfT7DY+zHvTd3Q\nyzqpCdqTu2vX2DFLeqcrNiX5BD/O0P9VZYy1fZ+HGis5rnM7huph6Pkx+Bi0\nhX1L\r\n=hKuP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDw2mZCCXdDxIbmMThtLLI2G6BQrpt7HodxyderGJbxmwIhALCa3vh7h6ZFR1fkxN1BhSGpaZ+9ZakLXOxmow4fKIQf"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.55945c5.0_1573603130500_0.6785798358776847"},"_hasShrinkwrap":false},"3.0.9":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.9","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.5","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"2.0.7","fusion-plugin-react-redux":"2.0.7","fusion-plugin-universal-events":"2.0.8","fusion-test-utils":"2.0.7","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.7","fusion-plugin-universal-events":"2.0.8"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.0.9.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.9","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-naHdwrlDgANuQC+MJiajXTy6NW1eHmNr/QR86413cR6ckjs+E1nNlbVOOcH/VIDUBVxlokT1g5C/s8EkN5GKiQ==","shasum":"6affcae064fa09dac8dc7e399460c45c1ddc8c1b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.9.tgz","fileCount":17,"unpackedSize":41982,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzGfeCRA9TVsSAnZWagAAWIUP/RICn3al8Zydk7g5gqgY\nU3l0+Fl8vJ7CPTPdhWqI0WPz0SxAPTC1oA8pjYvoTcmCWXEBi6pYQUfoU6kA\nZVA5KFt4sm0nDD8pGi0eYZfz3XUB+EHNYIKWyN6cYe/+hvzyNEXXjLXuVqb6\n+AczUYtsqu21rWn/A9AU7mhro3qscTan188sVlZZFNYgYpqpyl+Ev1F6RByR\nzNc/uPJkP0k6pwF6dx86+vEdS8X3dBxv3C5Grz/wCDoZgP5lCItXZG8yT4mH\nZDDPzp7fnTxWwGgI+04okFrRP0K9XHfA4aAmV1qAiDue9vdi7C+6l1C+tDpT\nEvKACp3Ht00et2R8u2GLBeUD0qN3duGcT6GMbYgI2vkWO2YXmDeUpcD89VYg\nbKFx9VaTQ75shYPMS2aUcRBJKNCsjg/Jo89sC9fS1WgQYuIxjfl5Xg4F43im\nFkh+NlultG8kr9s67nvGoLhX+SEoQxJEh+khqh5DIXXUrY3b/CmNgnenPmUg\noXa+ucvvtuCuzTBnX+MoRNXgdhPCIAHBx87PU3MmhMUBOTgNln7Pp0UqkM5Y\ntBK7mOXjGoRPhAtEE+Yi/83iZNuKiXFiAszCG0rBRrF8EF284G6OKyLBSUnq\nuh7/Js72M6iCbSgDsb4x66YoWcUjlmGc0EDnufj/cw1OrmqEfZmzmhaaOP20\nEDE7\r\n=ebYk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSas0uQ88R2C2+oDFTZTbrDI6PHOrN47yyGHrmzYzMVQIgf2G3ZGqFArQ+CwssbM344Zt9KG53KrTkVh/orXzhcAU="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.9_1573677022264_0.8140593380827832"},"_hasShrinkwrap":false},"0.0.0-canary.08a30a3.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.08a30a3.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.08a30a3.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.08a30a3.0","fusion-plugin-react-redux":"0.0.0-canary.08a30a3.0","fusion-plugin-universal-events":"0.0.0-canary.08a30a3.0","fusion-test-utils":"0.0.0-canary.08a30a3.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.08a30a3.0","fusion-plugin-universal-events":"0.0.0-canary.08a30a3.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.08a30a3.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.08a30a3.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ioKNP4EF8QowIXglXIRRs2ScT3Lj0EcvaAKZ0HPFjaEy6E/Ful2cHwcL6NlM7CVhkuURLVDzAHDoRbxSyblx+w==","shasum":"31ea058254ef638b2b19f3d3dffd8b7df39a598e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.08a30a3.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1EtkCRA9TVsSAnZWagAA5BUP/2H0BSp+Cbl2uBEaygJF\nUYCgduqESmjS+mGu57I7VWYXc51WVQWaXFQkOS1BPewI7QjmEBzuwIoqbBIQ\ng/0otRpCBHY1HSo6d08WBKGgo7fWPbG0JFR3MQ6DucSQIA6Rw3E27CeGF/LD\nuwcm/ly+xbPEgjuN1bIMYi4Qnb6uv0OdkVOC/3uBAPCJKoyJdmK+TWluIJX/\nRRJOhbHpCosjq/O0mYF6mOvNVohLXsZdcDhyFun2EEYrQYDN0YcE68LkMMtL\nCMg/Rq3V8P0gz9RJ6w5MHzeumLECNb2Ks6+VZ2yGfiFysIBWOWBmOvEzviGx\nLQRxsrOKRpwobpI4uL+Sf1PJh2SGQwFQgChY/N7f93YVawPQttPHnxahOgrP\ntauy562eiShZbLeMnFQYBxwPBWnLGgzaWwBkV3xN+uElmPpn/yFGgmbJ4x1Y\nUfDQ3CM+5lG/2iUECxoxETNjzO4ywtGt0YlcUZLLcoCZPLXRtiXZ4qe71U0a\nSYpMzRhy6aK66mU7tMTQDxgyAMzbXWgCvln+C5fPIs1wKBL26w/ixTn/hz1d\n611DWwQFuaEjpVaUmZSTEeTqMKplYS2BURgML7iWnJNSQbzDxghKtIppqPSD\nr3OO+bpVFr7QYof+DDstbdih7BXW1a8pQ4t32ZKtRirLE+eO1R7U2VfA9iVv\noiJz\r\n=L9g0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQErX0q+wxn+3TkddKI+NKLuAY55bp7fiHQBmBcGjDewIhANrxYs/mGv+tUGQoIe2Kpi0N7qi37ZBnGimAVAcYFC7q"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.08a30a3.0_1574194019943_0.5305433664536152"},"_hasShrinkwrap":false},"0.0.0-canary.602f682.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.602f682.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.602f682.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.602f682.0","fusion-plugin-react-redux":"0.0.0-canary.602f682.0","fusion-plugin-universal-events":"0.0.0-canary.602f682.0","fusion-test-utils":"0.0.0-canary.602f682.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.602f682.0","fusion-plugin-universal-events":"0.0.0-canary.602f682.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.602f682.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.602f682.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-kgpFkcJjUC/qTvYLIcjziAiavFxYQQEe2ogAn0YaYpcUzw9SYnkhcaRKPzhDndIs5kHgSImdOM1PbYMMiZH2Mg==","shasum":"655b7862c7dd47f8a5384f9b0a61f9ca97d782d8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.602f682.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1c0OCRA9TVsSAnZWagAAIBAP/0P7YApEdBnL860z7pz1\nwFN0obeKcu+QUaeGNmq4Fj9Ht1WxRbd1Ka1tU2QbiMlbhph0kJdtRDXfblRp\nH4wQ0GZgeQ773+h+FYN4E4lEn1AFj6Mm6qWMzE31MkSHquSHJfyAlF2yyfgT\nuJCXvYszToT3RcD6x/xRAkqbnJ65O7iEQOaDncI2B/bF9pfbVop7pN0UkD3i\ng83XwSpWQqJvUoaduNFpLMukyTplWo6XqQ/5QrJt+KH+U4HQgajsQVMNcrC/\n6xe7rMOZMIvEDmf4HM2eZySEQpkVJIqYo+wczroT0VmE1qg8BgY1Z15jYqgg\nPa1B7sBijYIUF8Bl6DlCG1t5TR16E8y2d7F4pY19XlMfum2lneFhEaW3gh9t\n/EOwT/WQeXpOcH8sqHaGpHvtixmOy8CAR5OV6JBod3NYVkQ3fiThJtE3dB8T\nkLjShVCwjI0X0GHUvtrz3gdy3sNepA/x8sWjDQTvdPD4d/wNLp09FAKyd7Fv\n4DhseZDMjqDxUfwNDmPJAx9i99aNSG771uo2a/hdxap1xWCwY5Ys7sEZkHYF\n9qH8u4fhnVFz2tXQHIlo74beJhYWeLbAjTKqpFLGkA17qXs4qt4e7cCovVsE\n7rKmbCdsPQtiVIPTDwOIFHYobXlPOmZlMuxbOdXT+i0uEYpmPJhDS2TVXc/P\nUaAq\r\n=t0Z3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCA6XgO0HD+nCc833nE9jVe48pqM44J2JWA9grkk5VuvAIgNvmXhgLK2N7fIC5ltGH3nTo/kaP0/CMyCt08whoMH6M="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.602f682.0_1574292750250_0.40183005584885034"},"_hasShrinkwrap":false},"0.0.0-canary.b4d0561.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b4d0561.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.b4d0561.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b4d0561.0","fusion-plugin-react-redux":"0.0.0-canary.b4d0561.0","fusion-plugin-universal-events":"0.0.0-canary.b4d0561.0","fusion-test-utils":"0.0.0-canary.b4d0561.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b4d0561.0","fusion-plugin-universal-events":"0.0.0-canary.b4d0561.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b4d0561.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b4d0561.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-pCuHYpR/lXhr2m3KBMHZmR+XkIYvPIq3lXBZw+XOodN3SKjemhWVLhtsvU2YainruAR1EmF2Wc9V1srdsD0Eyw==","shasum":"afa13842806a609cefef9c5b1b829cb2250ffec7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b4d0561.0.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1eiLCRA9TVsSAnZWagAAIFwP/jZlsVWPW8WjYhyFlfAO\npOgZG+VbC6wcup4eF9uNxo9ZX8fXfLNIVpmdBArcLwS8kgCkJmwFgToLb7Ro\nwhH5Uwb/J984e/Nv3rxug2HaEmUpo8CpMhF84RnPbm8uHbZyvvZl+d4fm4yW\nPv3FXCrHNAFVOQg/5OCNWSZP0hce7yU2sdDC8mmJFGt3bfcpg1V/RHDXKuTP\njBIiJXq1A+SV8yldWYw7MRrpwRDnD1OBlhC2UQSr6VuOG+lxo+U90GigN7LS\nHS056tgCKs9F4NKthELvE86FfThI42UfwI0wTPbXcGPG/2I97F0Cne9NNE/t\n/WXHo3/FeM+XB1xpBtp5o1kYeP3QT1QMnwoUZ3eZQ+6m4Afkxiuk5LdWlh4u\nfbzqva2NEEAbQt+M6liP67lQkkrpiOxtifNdznPDWGzhFBQYqHhUM5Lhks65\nc6CUWyz70A/ZvTLadK3XlYk0TuRAC0lnKN8vQG3Fcd8kcJCkSvWQNk8Evo+O\n6ZBlGXLZogPcTqeksR3UAeqJIzYNcrf2F1Nwf8lp9YlUsVFuOUDM11wTuBud\nscYIOb1Uc15useIO1LqhAJklQnWKvqLPGIfP79CBwI9rXAroCSGObN73YI8a\nP1VfZHao8QiyrRoQXamfTnRLlo40JHlkJZUogIR1fmoRtF7vjbrqxpUlwn+P\nB9N5\r\n=Nbh8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdysmNchzBgKibYNdMJ0KVMom9BlKxOw6D0ATxLgKmCAIgd7vWl0ob/1r5kADVhaVatKd/mgi05/7l/c6QQ06r+og="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b4d0561.0_1574299786574_0.15207492255036748"},"_hasShrinkwrap":false},"0.0.0-canary.f16f299.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f16f299.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.f16f299.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.f16f299.1","fusion-plugin-react-redux":"0.0.0-canary.f16f299.1","fusion-plugin-universal-events":"0.0.0-canary.f16f299.1","fusion-test-utils":"0.0.0-canary.f16f299.1","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.f16f299.1","fusion-plugin-universal-events":"0.0.0-canary.f16f299.1"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f16f299.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f16f299.1","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-AEqW/U2A7qLM23lfUjJGhgzPoqkJor1GWjiKm7lbhjH/2H9EyjvJOcrXBIQmdrhU60s8BAm79/jpgA0Zj6+NRg==","shasum":"6d41fb872960683d704c3850cdbdb0ac84650e62","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f16f299.1.tgz","fileCount":17,"unpackedSize":42118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2D5nCRA9TVsSAnZWagAA2OcQAJlrLhvfhe0Z2UczKber\nLmYhYgR+YqjGoxxX2wK/cGTfU/zT3ybWn0J0hWfLrjMdAnUhLa9TgRVa4UOx\nj/L7VIhITt0+mgEFlXI+1vUpLgt1hNbNGiT4IHOGu24N0UkhEVA/A1m3M+6r\nLB1lbwEqYsCJUTwe1IwlkjBRgHwZwCeLEsJZ7EZQRnDJfBVYSo6R2PjEjqaB\n+Nqz8d+CUm4sOzz9Hg7Vjq/H3XxUKpvGgfQIOAxpNo1RGnOe0C60p6LTPaJw\nfwTBU5+fYjrnsFnzhI7UnEi3Rpm7XpamZVQZmeGB3us0W06xK0xVuJ99PMwL\nsiILha2omgDwVkvHmK5ymP3BN2Ge+aoQWKdZQChO2vvZzKB2Wf8A//8/9RIm\nzUJu3XtPnA6To9mavegeoHeQ8V/UOzGsf+4LSET/T6Ck8410h+RKkp3wtntG\ntbBetXrFDY7vYjCD+5hE6SzvxQuRxcP5hdmEmJMfa3Ir9VC1qf2an4feA2RA\nbrZ0KkHcuQBtlgdR71LrR8EXjubw9t6mRwspnK3OCMZyRp3/xIid+FMtciyD\n+rRObpDvgQrgR+vwmVX1Z2zI3SXmUkIvlJakLnjW4DqP38l6lFmKOyi+m3sK\nyPGq7sqiUw7pZ2DO/UrIeoH8NlAQI5VOp+YE8pYp2BHCThPveMefCVQ5xtpp\n0sFC\r\n=DvSA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDCfNJefP3jgk0XnU2hvJ86Hhd2kLk3zm1K+JpG7Ve6QAiBFUuF18ND/2RpSovegrwnKStlKBkiug4+vQpis+XrvKQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f16f299.1_1574452839225_0.4179766961549669"},"_hasShrinkwrap":false},"0.0.0-canary.9dca7da.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9dca7da.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.5","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9dca7da.0","fusion-plugin-react-redux":"0.0.0-canary.9dca7da.0","fusion-plugin-universal-events":"0.0.0-canary.9dca7da.0","fusion-test-utils":"0.0.0-canary.9dca7da.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9dca7da.0","fusion-plugin-universal-events":"0.0.0-canary.9dca7da.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dca7da.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9dca7da.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Aetb8zW6rfLzsK3MaYNOL/wsyssTvxIv/6eX/eNOfu6z3ld/nga6G1YER5C+ZTJ2EVupQHdFh6jGmRhxHLqoPw==","shasum":"16dac4077db82ba906ecf6d06c4840b0f182cd77","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dca7da.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd2JB/CRA9TVsSAnZWagAAGsgP/1UUUIlG8LGGzq6tE/a+\nzko+WoOorEeSJAwniK9XMlUwRG51WI92V/Q28t6pb3xI+QEjuL+QjZckrJHc\n40MXPQIricLYU78Hk2XgcdzQ1Xi5UKtSTA+3pKenntgRuefrCex5HgPVUgSZ\n4DBOJn95sG2s8seKo5zB4ZkyCDDdwHpGgxX4E0Kn+DoCz8PEryGcfJeJDdSo\nhnoUjKdW5syaysreJD4uiUNyjF5gj9Jcxv9yws2C2/B639smo6o3Q1xk1SZI\nByAv1W718yNrh9ha9ASJ5JJivVVbXimmqmdrI98VvWdSmRfmfypozyxVuqiV\noFWKqki6uUaBLgwXJ2d1vS5+xzQxbta9STbbgwBeQ+uI5rfB2TwHerbE8vPg\n+e5HmTF0onyIObokxrA2wTVxHA1m9kx4op7GddsYO64zF6rP7jwm9NpS94M+\nL/9z02/GsFohoGM1gqu6B0X7NFns/moaIOPBdYbP2T1lPFXDGWtcmP25o985\nhu0D55jeFHdmZH+FyZ5jsAJofhNZMk37F8yUSp9q4D2aTqcyiZHVPqoW7tU/\ndvN5pJsKtaDKeltWCRqQzBkGJVbviSQIkE9PipmYPMuDfb3mObycNTpNY/A3\nnLPdHh17qk2jQ+mwS51nojSsUIM/lD3klMr0O5/mKI65ptKeLkExKss59Bsj\nHPox\r\n=GuyA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdG03HNmewrWOrmE03dny5W9c/GLVmw7nYZNDRKhnvJgIhAMERKFjzLYhJKx6MVJtFsNd8fHkBQmkdmMdtpu1xp8Y8"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9dca7da.0_1574473854113_0.2113608557911424"},"_hasShrinkwrap":false},"3.0.10":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.10","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.6","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"2.0.8","fusion-plugin-react-redux":"2.0.8","fusion-plugin-universal-events":"2.0.9","fusion-test-utils":"2.0.8","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.8","fusion-plugin-universal-events":"2.0.9"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.0.10.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.10","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ZmfNnfKnEKr+HCbSbq7l2jYf5LtsQoeI0BenVA2X9+RpHKuPRok3HjeO5oPYISVsk850u/v3eXhQZgn+d2friQ==","shasum":"996a4b53367ec9c3f53de438b41af204b6551ed0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.10.tgz","fileCount":17,"unpackedSize":41983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3DI/CRA9TVsSAnZWagAA7asP/Ro49wlY1vCwboiRGWYi\nkW4D+8VYNh6i6e+051lyXTnhXQkZFrkOpXXQv2M+BmUPDikGU277ldClEvU1\n3EyvG80YvEnzQVmKCLijRjpicdl7Ukn5WYapsDVL/urPtvbXLL0lSMVXo5dx\nx/TQ3wGUIu0E/1NkuKnFq1CkKhudokDkNTSMChHikSLzZ2eO1CtG8hzBKSMK\nrRMNxUxQY+qgkB3EfvHrRWlK3liJXTZH1e0HXrqgDWXzmVyHpDysPz3FlSfi\neNT8zqmuVqHyK3wjCBwUrMmEPBxcbH+8DTQaqsZfzNO3yq4jlolxX7s8FwST\nhWbQa7gRCK4dLe58dTzf4Rzl6vPBAjzScZcymQMlHU+TWQMfDKJHzgdoRRLn\nq382K8qZAr3/CS/qfi9jjDDlGLsbRJrQ/DwcZOMy7nX3rgPHan2nHjEZpUZj\nxksmYgv7n3UR2KzheRBQYTpMXmxuUNfMj4LzVZbgDla0qi7AeyFJNBvL4rQ1\nWPSx2OeqxVUcDltn9HoQZK80WM5/+vpnkcWMwGHSlyy4oTm3nmbtzuM1npBx\n409Cxr3EickjouI6GCXJ27DI/dz0x1oTrepXjQSwE2Cy/E5cduFpppvX2yT0\nprDIwOVQbAdYw1CrORlwD6G8VB+RypWDvZ7JRItwOvxQMaEBG9MeJVrytYh4\nt/zR\r\n=sVcY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBwa2LFtAMKEjkMHPkh/PqdTRyKhMuM8cHRhGV9Kij7AIhAJLt0igrtUx9mraeehG6+zWlH3I4Fncv8H1E6Qu3x7BE"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.10_1574711870763_0.8220309435539579"},"_hasShrinkwrap":false},"0.0.0-canary.2dbfb1d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2dbfb1d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.5","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2dbfb1d.0","fusion-plugin-react-redux":"0.0.0-canary.2dbfb1d.0","fusion-plugin-universal-events":"0.0.0-canary.2dbfb1d.0","fusion-test-utils":"0.0.0-canary.2dbfb1d.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2dbfb1d.0","fusion-plugin-universal-events":"0.0.0-canary.2dbfb1d.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2dbfb1d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2dbfb1d.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-EpqjMPcXXR43qdVGfi8EKAdIUPvUZckMMzVXCqk3OjM+SmRB3dmAI441D2h+mHg1l44c+DZbxjMhOsPqXZ9brg==","shasum":"3affdc8d781fcac98234cdacd7c2e259aad74cce","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2dbfb1d.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3FqtCRA9TVsSAnZWagAAn4EP/0/Fxp5WleH+CQaQIX5o\nCWoJokFMqBgkuAuaZUteYi150kz53kU6TWBoIVDU7d0I3ikHrdWwsYKjpaK8\nvHTtx9glNq+56LJUe8JKDRKwtI7xeAgAY4YWs3/9KhIHUzV6rw/mxIMqcy5m\nLBi1ot1tXfXgVY4zqUphNvpgHEtmUPKGz2SWZ2zZY1SwV8QxDOyeSfVJDWHV\nU+h5uIInfTE1d1GDf7kblpZtisqwArTT3ILb25C5ny0FreQlrkVDtVFdaLGm\njGUaTK6U/caz3aih9xosELfvhyFN/4d1d4eIFBKy9K++a57BDFQ52sUF4JCF\nZKrFV7a3ySSb2jcywjds/f8/koPHp8dKzELSprjNK85EwyKJ5n4IwD2iwLvt\nnqZ/fd1RgmKUpjGCzyNGtOy2rvZXHgPkE8hy1LZ1U38nvQqo17hWnpcALGbt\nLSMS1rAcTZMdJrMNqwB8QKkH2RfLF7aEzSoFCVFYOf3HlrhZS8kVcAVBhkEI\njW01hqPvrFaamHrv4VThTdTHRYHcU1CK3A6IeFSCnKbeQ5QLfqWLIPs9Rn1e\nMrKqYHUI2hXkhB11tJBjJ9x31crzuYEvnCey6MbcRfcaAPLpphP2cpbMjrtx\nbMn2VjoOwNvsRhj75tePho7sBjU+07VC/5BDWObPJ/3rcWZtTHdzcRPuW+1f\njGG3\r\n=duiw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDCKWIIhBcX7Ws6aAM9Cv5fK2C/eZtjwoGgFB51iPFdAAIgEBVsL3tT8I78BYJAEnC9WV9FCv82NY6OX8NrmhK60TA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2dbfb1d.0_1574722220560_0.9749435840580662"},"_hasShrinkwrap":false},"0.0.0-canary.777f2cc.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.777f2cc.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.5","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.777f2cc.0","fusion-plugin-react-redux":"0.0.0-canary.777f2cc.0","fusion-plugin-universal-events":"0.0.0-canary.777f2cc.0","fusion-test-utils":"0.0.0-canary.777f2cc.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.0 <11","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.777f2cc.0","fusion-plugin-universal-events":"0.0.0-canary.777f2cc.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.777f2cc.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/4c8b6bc04b61175d66d26b54b1d88d52e24fecb1b537c54551.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.777f2cc.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-3KVR/l+pHzwWD3bNh3HEqtNEclCRRHeiPtB7+YFpT9B2AZ0lHilsB22H9t2Ls3M9FvjRpfIslMX/0rHgqrw4cQ==","shasum":"5375b4d428edcd8828977949d9fc72024aa6e0a7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.777f2cc.0.tgz","fileCount":17,"unpackedSize":42101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3HOECRA9TVsSAnZWagAAHdMP/0e81fSsHDq9Gs6ucmYv\n89i+yqIREdt3T5l/kFG6qkO9G5wCbrATkFWSKiaiGsoMDFnKDz+9Sc6w4dHC\nvonb3f2HxEsMq1GHp59zT9aHSqHfLd0u9XEG6QWz4LI1uoT4S/qO8J9yag4o\nQwxscPhNSjaYoECHx3/W96R2snmZ0yU0GHGhWtMXO+hLqgjGE1pBdGTociIY\naWIYZzTSc5Dqn1dpSls6jAiiNa95V5KTqkf+715CpY51ci7Q+pOrEcm+GMR2\nOE302cQfhPPEh19u3kVlypOiR5IcQZ3EeCORBvKYmaiKT0Bo4PRTNVjLciP/\ncU+T5VNN0bl42EcMO6v3wn8A4f126u/F62qp09cEGcMinjCUIvCXHve64+dG\nYCa2ymG0c+xNTGzSB0zwx2HLgC01R6QQnHAgoqX251uDQ9G9GHRv6bgAP6Y8\nXNGfkQbfDHUajmoVCGRJinGFB9s6dK/qsvAz7jB3neultlUJRqtP0twZOSkV\ngMk6xyssNGTJX/n98b0iK7CvpuJ9yQ/I2TUgSF9bqCGn1bZUbQjK7U90oNPh\nRLv46CBgzJDLLVGM3xab6gk7cBTmY9bFgFlN5AApU/QB6VfbRu8BMdGDuVxK\nHo+lrC4YbDROZ/+4pgGJW35zVZz/w1QPo3FEYv124Ci7V+FComJmtjRvz9ea\nZAX5\r\n=CTI3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCaz8ry2AyjaDnLTeFwxLKPdIRmo4qbzfCwGq6JG8LumgIhAPiCTJ2uYdATvDwncavOeFKcmgXHl6RpsAm2VxuWwhdH"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.777f2cc.0_1574728579844_0.23725878231461328"},"_hasShrinkwrap":false},"0.0.0-canary.6e4e073.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.6e4e073.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.6e4e073.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.6e4e073.0","fusion-plugin-react-redux":"0.0.0-canary.6e4e073.0","fusion-plugin-universal-events":"0.0.0-canary.6e4e073.0","fusion-test-utils":"0.0.0-canary.6e4e073.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.6e4e073.0","fusion-plugin-universal-events":"0.0.0-canary.6e4e073.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.6e4e073.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.6e4e073.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-7I+VabPXqYJkOxlomNqpEbSBFYz9gudJiM/OqBQ/Vqh3YMCf8XG7uYgv6s7JlADy5WHjNpmubx7AX+/p+ZJYiQ==","shasum":"5f5efaca3a74d81de41f3fdfbdbc7a6628702199","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.6e4e073.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6UnFCRA9TVsSAnZWagAAUZUP/iKPUZQz8Cr6x1ZT70P3\nwexy+GSV9pQGT/VsB6hzdFcKHltBIOEskezqLQfv62bI6pfBylQTCW7E9l/2\nmqPBJn5SQ0HLj0dmK4qhGiFztQEM3szuRt8WShQDcfUULLhUrinFeruyBaiU\nQ/hFimP9EEZkxjeJOHtf7eMyXE/DgMj3e8VKJTHWVyOYQKseLOpk/llQF9I2\nFOvJcXfvJiYKC5TR1wKMuzaiYTw3Y3mX4XtvL4D+31gAsTA6NOvReLZvl/Ve\nx4fBW717vRIXtdtNJLlISN43eIL58nT6LbNQt6opS4yf1M1k7vfTn9cwU3vF\n+eZZX9evaUBc4+xZTDLqFddm8vI6/Sg3QJQ5tglAEjzkilr9La9KZsVUT1RA\nOEp5RKotqRyEhcItmrgPlNeLarGEiHBnbAIwqgLWcBxax3wDX+0YJ1P7N5Nu\n2weumoNSXZWsrqHJuxUq9H41cHUfv2/LIvbizurlYgmSQdIb8Em7oz2qQhJW\nIUw7o7AusVg9rcwEs6gF76krTxpZI9EMJ42jDkD2mzSouT39XFZZ7wna86h1\nOOhMOu0sYQRjAYhghK4hR5VQRNeQVkuUvcTvMl6Nd1+mKwwJ0LbeDQfUD64/\nK67p01Mm2wkdBPAIPPnsWm1cVrLLgmBZGtpfCDddSKfhVYgKAup4dyF/nUrv\n5NMR\r\n=OxtG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGjDZxh1avguRGbCFRmQRwkKfvZajCTv4g0g3wZf7kLUAiAJl3Eo5zgF6Z5l2VniXILKouk20I7H0XWHuSu9uBwJZQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.6e4e073.0_1575569861223_0.2943437111623317"},"_hasShrinkwrap":false},"0.0.0-canary.b7558a7.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b7558a7.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.b7558a7.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b7558a7.0","fusion-plugin-react-redux":"0.0.0-canary.b7558a7.0","fusion-plugin-universal-events":"0.0.0-canary.b7558a7.0","fusion-test-utils":"0.0.0-canary.b7558a7.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b7558a7.0","fusion-plugin-universal-events":"0.0.0-canary.b7558a7.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b7558a7.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b7558a7.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-DYyZj8UOejTAbdgVSCp/DYsUg5LlQ28W30H8hOBICvdhL6LUj5JfzzEh9KwxYtQhtXDF/NIDSY36RnSF8An40w==","shasum":"407073162c2366d4f67012f57a1536874bf517ae","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b7558a7.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6ZzVCRA9TVsSAnZWagAAr6YP/jODXwCP7J9am+NL3zUQ\nR+D0tSxjzSUjPv/o02xQaB5fXm/889KC7f6hkGc9aXo5517wBlNzrBxINTY5\nv/I2JuXIm+h0jfBHCOaGL+Ot96Ea2cDWe7i4hpWstofPD0afRpIo/9q5g1Bk\nnfUABQPD36y2wqzFXGhXpfBy3GzGp6Ywkb1HcpqTLfZDP9PGHUIApEU7s5iZ\nJjw+9DbtWR8D0VOHjSx4dzgMmfEMNslJldS6lRujNvCR2mHQlDbgEn9M4jQt\nV/lAzdhFi082gw2AYzj3fNdIXKUZL+J5HE73GhYKG08C6Usho4kFiDbCuAES\nhQSmDzjXdtsv3rOVhJyhpramby7dExI1ZsT5yccb/laEVgQ17G0lBQ2iJyBG\nSC0oqfExwdcyB3+2tiOHB55lWws725ceqm2vgZI01yiGL7pdFALw9gALoV3P\n1nr3+ommU2unf+zDSEcsQWP5ImD6RPVAfrDkfBy18A+lpdboZnOzQ7f7F3VT\nHTPUgOqxS+iKew8qIgCl4enILmfynWZRsC5Ss+C+QP0QmRNJ6SUbvW+q5Hj1\n1vZak1G5M8T2JbuDI+NktwnvCJyZfilETiIJ2X0WluMWMRGvqq/4AFo6emw+\nfEkm/vjLlDZtYBR6N6j/3mXWbzBkAZz5EarHojsOXnbr6SzJqNPB5c0E1MA6\nsTgA\r\n=V4is\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzl6CjW6eGvWNuLYc+OqDNyoSi0cwv4h7BDuYchcV7yQIgWY9H8jjaw9Wg3SgkypFEO9oEtJyyuEBnG+uqr88Wa5U="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b7558a7.0_1575591125261_0.1053277424903889"},"_hasShrinkwrap":false},"0.0.0-canary.f55f645.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f55f645.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.f55f645.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.f55f645.0","fusion-plugin-react-redux":"0.0.0-canary.f55f645.0","fusion-plugin-universal-events":"0.0.0-canary.f55f645.0","fusion-test-utils":"0.0.0-canary.f55f645.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.f55f645.0","fusion-plugin-universal-events":"0.0.0-canary.f55f645.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f55f645.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f55f645.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-JEPdOYwyOS7SuUQPXWOvdiJda3qdyIwxdsDKvodb35hV8ZNLoBgO1m8j5jCAdq1d7u+or1n2hHJa1YBW2UBksQ==","shasum":"8d24444d0a896894344779d7ae44b0fc39b07de3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f55f645.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6pR+CRA9TVsSAnZWagAAMRAP/jmpAe3Hgbvw3o1DgZOF\n25VkF//1MT7rEOtyb0YaLCLwQXclBMNsdjXC5ODgDwVxjN3otI8qnxqQP5NH\nH40dzYvtpa/Cb8w08RBpvV8G2t8xk1l/fH77OT9MuifvVas1EUFpVWoxqEJm\nxyL0lFlJCCow3tJZ2kC/9MHG8ymnhbpI5c7RIjABti6MpXD7n88rzX/Jr+jw\nGOAkO8hn/54dUJmvFJN3PpYxNwlRuncI+5ayI5GJ82/atuoqR31sj214z4Jz\n7al/9lLK8jd23DC6zz/fqmblrLq1IXTkK+Z4kBaVmzKdDp/ePpbMDrg1SuQW\nmSPc4nVKKBkiQvyeBgaN+WFqW/n69wRSwR8UkNFP7Y2olkLTlxF2FlGIYYYN\nB3evoKBG3uW3vsOCIwYn36KK6EsiwnCLKarpQqUPFNRkqfIgHTqJnf6/j2dV\nXC8OeQqgtvJ3rKB6iTYz3UsYZGEJ47kusZrBTtTC9lCXifRuJLnWjkRjbsjW\nBPLAcwWKl4Sof3mrYzN0QrBbuCpB2rp4Mptf/XtJZVYL2PKQyo+5mEG4ywtN\ni/O4TubkYhXlzxBMcb2nsk/hkppuRQ5COysDI18v3Wvh1hoZ9BzMJREvVU4/\n09isgvhttFT9jaggMmwPUHIGT2eqcSdB0VFeRvEEo7F64a1VJwkwRZtxKHSe\nstOZ\r\n=IYZm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCanuA1rbkjQvk7MTdUEsLtx84FWoRhzJqOt5/FzNAnHQIgGrjH4psRAiRfxVSBVg6ck0Bgz0COLlQSRFM+rC+yJQA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f55f645.0_1575654526187_0.6169019316853335"},"_hasShrinkwrap":false},"0.0.0-canary.a1f34dc.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a1f34dc.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.a1f34dc.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.a1f34dc.0","fusion-plugin-react-redux":"0.0.0-canary.a1f34dc.0","fusion-plugin-universal-events":"0.0.0-canary.a1f34dc.0","fusion-test-utils":"0.0.0-canary.a1f34dc.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a1f34dc.0","fusion-plugin-universal-events":"0.0.0-canary.a1f34dc.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a1f34dc.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a1f34dc.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Mvfm32CoMP04eSTYd0RRNOhEtlLYqW5b4cCizzTBXyz0wbdAsSeEVCpn7Mo14WnBxA9rz6OviyEll0DgfgFevw==","shasum":"6606aec268acb0997a66d22787df258129cfe245","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a1f34dc.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6rCmCRA9TVsSAnZWagAAmGEP/jc3NXxJTLlaIIwvf7LY\nhmFp3lbfzE/E+RUfxlIMncOWOEZF/V/GRPGVzqlWcfoVUfBqvfzIeIm8kANV\n4nMDsDGBNP2ldjK1bEm3ie5N7nMXebf/JYsiFj3f0vknQqvqMwOsudqhgBvR\nCskG3AqdQFpu+wCIlE08G/QRzkV6kvkRFFIu3GW3o+VC37z1SLDlEXBEsLs+\nKP/PVPUzDlA5P+J8V7e0eLdVrANdhVku4XFbYt+zEWcqdvWWzlQllynAsDGD\ngcq37/EohtMXbEmwZ0o/c5CA8PoNaqCH/pRCxc7eRbmdvgkeiOuueSJdH/PL\nC88rILGX3VIW252i0ijRRfW6EoMQUpbAC+GCZC/e/Z9ZkvZoSG2JAe2crNz/\nsyWnkCRnR5c44xG/90DqXLXH7CaLiPfsnHZ0vnvjaT/71ax+jf6njR7EBr/O\n8s74CTENfo3ysD9Wbhy6j80398q13ekh8U/4CE/qyXFzUAC5Qdx93gIVAYHD\nMSwqwB6dLElGlbxEf3Wq4XC7bG6h15b2zyf02qe60jNB1XoLb4Bd+83Y2DH6\nPhBTt2LRwgnQIkMhrOuLwwPhDWrn6JjwTPyWLAQZg9U25obS0GNEbPS6dwvO\n+XY2pTm1UYy6Tc7piD7/8+vNoeW04vipdCq37E4GRLp/4ugArzpXPc6WT81C\nxJFX\r\n=PX+e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEJDgUBAUfq5ZRRTiNplEu5tg5rGq33wRqj4tlEYnzMAIhAIFZE53K41kjlw20H5Ne6cOL+vLqyYBn1a3J/guIO/rx"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a1f34dc.0_1575661734216_0.7870532511348307"},"_hasShrinkwrap":false},"0.0.0-canary.17b7929.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.17b7929.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.17b7929.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.17b7929.0","fusion-plugin-react-redux":"0.0.0-canary.17b7929.0","fusion-plugin-universal-events":"0.0.0-canary.17b7929.0","fusion-test-utils":"0.0.0-canary.17b7929.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.17b7929.0","fusion-plugin-universal-events":"0.0.0-canary.17b7929.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.17b7929.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.17b7929.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-U4rGkeKpnhNsw81T6o3DWuutfWN3mFjGVFoHrz3DWQGhKkyd2w6D6ebokIYGMlG2b8OK4enH0N8MFLmiDETlVg==","shasum":"6e69a391501843d5d1b67adb8f68f0a1b0f38fe3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.17b7929.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7rrXCRA9TVsSAnZWagAAW6oP/0ZTecarArU/IhJDYTah\nIkXw6D3PbkFPHvf8hQwHGwd4AIBHjzytCPUfESavpi2lt/md6e3VP30nwse0\nEu9NeekIpyjP6US4Xy1tY4okHNCvjoq+L6Cs1HfrpvZf4btIEngkGVYqUxNj\nek3lsZ1XEsmaA/cSH3l5v59Nmloo+XmRsD37QXcJpp3FxylpFpMCU5yuwW/Y\nY9bm3buJGRLSY2Kev7zu0qIEyswDh0iiW/gioZ1rkFmA6mlVQzJh2vYSkqES\niR7TWlN97U82LQBUODxrSxepz661L+E28c2xE5aJy8AGaCW0ik/Qn+Bm4H9m\nxS21h5M3rS9NreIRaHyAwThkB7511vQ0ddIjZN/DBsAdp/+oismTIjfl/1xs\nadSztiMHFfzb6TGT6vXfqi/eUtTOLFpmJJT0gIwAiCyfqdPsOyF2PrQCbWkC\nvPkYgZzbc/cdMEEBY1FQfzxbzq2arLvcZ8hSql2F98XHNuRGwulTU3G3f0+w\n117aFrU1IPZhTe/cMDCACHQGQA6xskyNIHpJyQhtwL8EOb+7iqfx/W8sKtbS\nP2ry7Kv8D9GgzioauD4231x9un2gxXY9eG/GV8iA0GVaVemKNAalB6jr9dtN\nB8gyuUpM/ttm/sguTD2XR4KbawBoBWDgYsvVP4L/DZvaMmVujT4BUFeFeyq6\nju/Y\r\n=nfRa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICwOIwBCdeH6eXkr6UultKtMeedD9NQP+ictXsfr/ko4AiAkDU3QDasns2tnv+y6m/d701MVPSMlHuVwbsiptFvSLA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.17b7929.0_1575926487014_0.1238338415825253"},"_hasShrinkwrap":false},"0.0.0-canary.e266b31.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e266b31.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.e266b31.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.e266b31.0","fusion-plugin-react-redux":"0.0.0-canary.e266b31.0","fusion-plugin-universal-events":"0.0.0-canary.e266b31.0","fusion-test-utils":"0.0.0-canary.e266b31.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.e266b31.0","fusion-plugin-universal-events":"0.0.0-canary.e266b31.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e266b31.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e266b31.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Y6Mt/NNA3DSEVfm3QLJYNt6s5+Q8N4te+4FRtYl61f6VWtgQrrHXJc+Ql02tUTJ9Ksn1onOeDPCi8ik5apQDWA==","shasum":"1a1aeeb641d00325f26589b37b1e0df17cbe4173","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e266b31.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7rwVCRA9TVsSAnZWagAAA38QAKRA/uxtS/f9TfkBtRv6\noyep4oGQyf1nVMHD+BN26sO9MYnyggFQGtIYTGvNWnhzw65LQq7TBi52yNzL\n9aJ64y1MWP7F5NTt+DxCXYzjIgotx7Nl47KAinyivYARJO7J3ErIy79u6zoi\nx8yC4GMYSB1gvnxcxu4eB9IvJ/cPGDpDwnbn8mLfi3/DUNosMHtotB6dzu37\n+lABJF+pDkBw6Ry0pHAoC3Trw7pJsogj+JY01fL+yLuI6rqkN0g97X2aOvRN\nEA681C/Yw6W/b03rm7IAGLJ0aJiteBr9jK7JZChPzLSZnvNEgJTN/bmW6AeU\nLqyA9By7nJQ3vFB5XWUmnDiK2adLpxb7ungqEJ8UNAQN60d3G+2YFDwHxib7\nplFRzRlsFLY3TIvKDinAfoxP5d9wCMtKlw3av4wF2FyKKzFj/vZDDb5mJj3n\nPxmcvkzA3lqYlFw5X65mGgZx13AwUxrls7q5VqVCs0vCcWVUGDyzgx/NLq8Z\nnVFcE7JGvXgFQt85T4SJypNpBw5QPHuMV77BFg66alUU0fwWISslWfe8uYWC\n7qGGpIb7OaPxICCpvunbgRjm2YEVA1Nss7p5GZfxRk7p2CQEJWFZQJQ6CE/U\nF+d2NbZUD0JTLrmRwubVDjYD3HBkc7EPjvmUnzLwDDH47HiNy880NBtRL74c\nYjAw\r\n=HqWz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAJ58rUWki3Gr9JLgshjvsE83HvLpRWBf8n0m2ZoGHvrAiEAypNoGEV+WCcHZMRAEg9Hfx/q+R/zak5K7i+xuj/H/So="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e266b31.0_1575926805335_0.26457537753657334"},"_hasShrinkwrap":false},"0.0.0-canary.2e98cc9.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2e98cc9.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.2e98cc9.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2e98cc9.0","fusion-plugin-react-redux":"0.0.0-canary.2e98cc9.0","fusion-plugin-universal-events":"0.0.0-canary.2e98cc9.0","fusion-test-utils":"0.0.0-canary.2e98cc9.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2e98cc9.0","fusion-plugin-universal-events":"0.0.0-canary.2e98cc9.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2e98cc9.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2e98cc9.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-T3KRM/3GMYiS1M4vDJRq7ITY82VDeAXmRHSv/MPg0Rl9qk1rNhZdkqBJudS4gaSP/eGXn3WkbgpTmupErYn7Zw==","shasum":"e5d2d3253ff84555559adf1a3f1b573612b916c0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2e98cc9.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8GXDCRA9TVsSAnZWagAAg4kP/RIyzXyKj4pjPCsNdnrF\ntXksSBAUChDWvRHA20xL9Bsu7RyOcZyIZe6SRJPLwQKRsg6exhoDdl3jUze8\nqQUpuIyu0ohFbPwzq/7VdJrR7qj2IbL5je8TiuROx4sW55DS7NzBefgze7TG\nYRI8FOf0wstiGkroAGNb5K8Sqbjp+EgbTuiVmWBTjmc2VZPN9HwCXHcAHNIi\nF5otvG6jk4N8s0FeJGLC8rQJ55RvncZ9KTCu/Ghi8EGs11umklGSUQOdIBcH\nZD9yVs02VeOspeyz6JqgG++0Fz1FTjRmIEQAKj3WT3mXpg8FhGUeuHGVnioS\nEJj6rgjhnJnnwzSK18c0fxDvoJIftKlqdFqsJ7fplwpgaJzDEetueC1+w7Wz\nYX/XobkgC4Xyeg+5XPQUhH+xGrGcq1fooiH25v4T6/cmLuiRCkHGKNKkSVEf\n2V7z2suDk7Q1rDeZ1+jXPI53e5QoldSwjmtit5yhH/Tuzg2LMsKByYeZzDRn\nJDhowWGTBKhTKdW21JzHkOrrhIztf8JCziMDmRVyeTFEeYMtIq/p1P3RunHH\nvXJRsEWrnmn3T2/6fi+BC/pfbtuuqmKhpp62A/gvFoaZIj+ExZUm/ZWJG1GV\nQE5xe1byMG6duk9zM/dLenhSK4r212bRUlRHO93xtG8D/qPiUk3iNHjlwZCx\no4tU\r\n=/+8+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDc/4yweIJLd8+sS1QAgMkROnX0z+0ipC8wCFDIgOm1DAiBQ//NeWC5p15NCgzyl67YZDbVv40cWVHZQNpGJJ3xN+g=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2e98cc9.0_1576035779413_0.6286061583600233"},"_hasShrinkwrap":false},"0.0.0-canary.c4b78ee.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c4b78ee.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.c4b78ee.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.c4b78ee.0","fusion-plugin-react-redux":"0.0.0-canary.c4b78ee.0","fusion-plugin-universal-events":"0.0.0-canary.c4b78ee.0","fusion-test-utils":"0.0.0-canary.c4b78ee.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.c4b78ee.0","fusion-plugin-universal-events":"0.0.0-canary.c4b78ee.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c4b78ee.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c4b78ee.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-BhoyVkNOm1O7NrIchZYCvccWLigWdEvaWdC8h/EKJFtpI0YmXkmpGV/IxU7chCgvvz5YaMbpRRJwIbzaY/fVQg==","shasum":"103c4733b5fe482ecf92cd8c0a0b44f5b9770fa9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c4b78ee.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8U+/CRA9TVsSAnZWagAAmowP/3AbJQfrEWxzuYplycOa\n+IWMG6m9l1wc/4Bkr0nosC4fX9E87q2Rm/a6kxRTgHMq65Ri7kwgG4iBvuZ8\n4GO99jdgcjLs1V3TTLXdOblTFx+SXad6k4QPm+PnrVhygukzY9AMEA4EQ1M2\nTIGrir7P5AgTvtJRzy/E1E+hBftkPDaComHhMnJHf+6HSw7R35XandW4DD3P\nx6O8xwy2AXcXL+eP6DwqVM2pyd0k3Vb0QDTK2RoS2GbYPIbmgLHvDzUSnhFz\nespSCzK+rP51Iofqtpi7tSV0q/jI2dgOS93QGpIVp1yCpCMRxBrC0JOwp4/G\nM335WlFHXIk0mE4ezXZPCMivD0vlU8ty1vQWFT1BbjBULol9mnsfwwZLLRxU\nVQuBEeakwf4T8ICW4Z8WLL4lI15+g8L/qfmUa6EDr8amQz6P/R+j9ySHH5DE\nBv5WvpFqxyO5llotaDCU51wgAS9BewH8d+pbkxUbbsDKXHgsn7x0O/jRqwhH\nIEn1Yn4F+ymSn21CWv+ezsiWsMuaBH07xSoTeSbxUVGh9BBk1R5bg86msBp0\nmXQwiDWWOHsVJBg4FL0zd4HBiQkQmEnBn7LQUHUOjyobVFviCmIsv9Q/wI6B\njFs38Qu+iZLh9KXdGLu+F5jqE55unCKddSxCrnv5zDD66MoeuUnFVCGbtmIk\n4qli\r\n=9dhK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJlioS7xq8a1LxzW9mC1sBHefGOMufCBtJJssYLmgHXAIgaYKEEgI9yDV6j96zB9Sld/XJ0DGgroOtH9xwYiZkNT4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c4b78ee.0_1576095678907_0.6205486080455394"},"_hasShrinkwrap":false},"0.0.0-canary.87d361c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.87d361c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.87d361c.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.87d361c.0","fusion-plugin-react-redux":"0.0.0-canary.87d361c.0","fusion-plugin-universal-events":"0.0.0-canary.87d361c.0","fusion-test-utils":"0.0.0-canary.87d361c.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.87d361c.0","fusion-plugin-universal-events":"0.0.0-canary.87d361c.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.87d361c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.87d361c.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-rZglWpeErZ7epCm+ZlaYv/o+OMhj1pFYVDpxhxtv1fCvViWLeO8ROpxZgCMGQI/v7avuHPQCriJYIZlgh0qTag==","shasum":"895635c5c18c178438f844db5f2a185c96f7e323","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.87d361c.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd8Y2ECRA9TVsSAnZWagAAufcP/28uIi5zGgQg95S0yQ83\nDniJGoV6Ieomcvn6HC2ONc+BxHivueAtCVuXGC4d+ulGh4oWaT9EkamcnHTH\nXJ0QQEy6NfYJe4iz6H0eat4y2SCxTQbIwKIHjc9zMw0XFAQ8QwAq4CXdM8Rm\n9PEW4Rw/SBq1erSjv3XnOCDh9RSKdnbq0HUvleWWiRf/XiwQqrg0SAixhatd\nWYzJNbNoRy23emA/l/cVmyMv0LtQ65XxDNNMp3VEZ5rbt7ghuxcddZ8pKHN0\n0pQRqeRjAUA7KOxhu7PsAZzn28WvUUptw54tnF4X3fIVN1rTt+drmxzaHw0Z\n2CL0yMKxBtVUKiMIIDUDZSU2ECKfvGbfA3Hy4mKWdGRvhr3UWznoeKO8AAWu\nCKq4eT/MJFd+6pEJgFHjIWLwJkKe5Km+G90pUDYpKCHQ1mlqSCm4bpHzMkmS\nW2OW7jSmKZ6qSPlOA/EFLqZMIG9y8hSKJOdEoqgZw7LPpJzoFPirOt2rAbek\nt1ehLJrpuRh6uvfXoUlq6o9qUI1xlz4yO/4AkPqeay4cdBgowraPLyoKerhs\n5GBVMTfU7LJIWBnp58ttZYgOEyDGEMelOOl9oavRzImx9oEeKQECuF0U6o7T\nQ8F+Ka0ZJk9akTFixiBnohgDrMr18ciLqY+MpdKPzmOhGD/t/F+wAffE9s6q\n1ZMa\r\n=u6my\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGhSFL1GftIT2sAPbKtko2wlgJUEbbrNk3tYcqb5c4NWAiBVgMiMr6n+WRzyLZLJvg/QmtEIQcvq73o7biHKeYpAzQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.87d361c.0_1576111492068_0.6676739297873338"},"_hasShrinkwrap":false},"0.0.0-canary.32cd5ea.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.32cd5ea.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.32cd5ea.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.32cd5ea.0","fusion-plugin-react-redux":"0.0.0-canary.32cd5ea.0","fusion-plugin-universal-events":"0.0.0-canary.32cd5ea.0","fusion-test-utils":"0.0.0-canary.32cd5ea.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.32cd5ea.0","fusion-plugin-universal-events":"0.0.0-canary.32cd5ea.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.32cd5ea.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.32cd5ea.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-LwFKK2wLzreMx7esO7tqFfxypzVF7JKzpTkwnJRkle9TSxVIb543yjLLleJ308dNRq3yTrSJ+r/f8gBhj9gmFg==","shasum":"4878b81f873ae0cd8f073b399490485ec21cebe6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.32cd5ea.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd9DjUCRA9TVsSAnZWagAA/+cP/3TEDoJUdaEV3Tx/bnd+\nw1VvnXzs3GBMNmryE2puRksAhKWzy/96hthr0MZUUchk2Eae/30skFT3da/S\ncaCh6GnvMmcNepu+ElCDrUWb8E9lXEpe/FoI0D5C9JjXGBcXJJGjdj1war/S\nvuePqf+IXncq1PXiMAcXhjuAC6GC/KpFpCWJvRPrrFNVj4PCmOdFbcNMzRYt\nh+yFGd6y5+VAD2FT+2/ZOXepnNZ1xT4WkcnC1HEbaqt0T8WRqTgGrOP0eL/e\ngU1j1d07K78lCL7M8HRd2UAUrhsneHCyhf91SCzX5DijDdcAL8sjvPgJSHI7\nQ4r9lK6++aX11A6fBCK4Or9Ek/O0fqDw9LhBM3/zrSh05MxxSWERBHneHoXv\nxDgpVg4MslgXim/8B2oXOtN9PWq77sD0h9dyX3b6V8sD3tl57kKtvOOjB04+\nqYKgdqNPXr20z7rtK/PByBY6FkdyUUi+Oy8kPFfKJoeD8IFbMakJqIVj/wGF\nRTs8/sWGgglSOBkZu6AnSUbUgSml4DBM3XlVAHUq74/R9y01mKgS3Mg2rXhU\n6Y9495MASsZpWFmhR3KRxxPds6EI2DnLIqBlbSViUZs7jgd7rCV8WXUk1qBV\nMrjF9n4i7Ws5Ep7w/cIcczhh+0bI+EizDzd78CX0WXErDBoRdtDrPS2GIXz4\nO8I1\r\n=5G5n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEi5Bg7y/viAm/1DupJR94+Phu97hA7Z7pHzFfhhMMNAIgFBCqhfYw+GVDi+ydE+1B/eqYdmHueYbdLdIH5o+HfQY="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.32cd5ea.0_1576286419799_0.8207778654528055"},"_hasShrinkwrap":false},"0.0.0-canary.8057c37.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.8057c37.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.8057c37.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.8057c37.0","fusion-plugin-react-redux":"0.0.0-canary.8057c37.0","fusion-plugin-universal-events":"0.0.0-canary.8057c37.0","fusion-test-utils":"0.0.0-canary.8057c37.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.8057c37.0","fusion-plugin-universal-events":"0.0.0-canary.8057c37.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8057c37.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.8057c37.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-qQIUIcNWwWx2t8HvQhySliQaOoIIoKE4+Gu5PC9pGHpZU3zujZj26mELkPqvkgEitmhhr+xKBbVHFAEewWyPWg==","shasum":"67feb73b066d0118de061caf3d70733594c72fcd","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8057c37.0.tgz","fileCount":17,"unpackedSize":42114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+RoRCRA9TVsSAnZWagAAJK0QAJQGZRVFEE5ZeYuooWgO\nIG5UhjpjexErAEp0zjtTDbIsOBBkPTa3LNwHHDzo15mMSteTpmpYKkKHbsaW\nMxioEGsxg0qamISa4Cb63dMkzu4sPra6bqcyXr3iMw0QIVjIunUnlckvLdVl\ndD08wicnKKCeZpbr2RxQHhD0woy21xVVRi2ACuj2JnjHDsKaadpJRm+ED4/C\nf/vSEmjBoocAduwRbhNDYfTQbbP0TjvvM58DFrXMgR+9t4tGNUhnd6IfKtzx\nRkC7g0fGhOfNKD8Dd+1pnyjmJNRRB7VDFM4vpUrPRUr0GkiSOQ4kVQqmYD9d\n9q8a5lUk92qu2HNiPlR5aot0wWyln8FpFo2gRC4fWhLfWYqVJfbODBu83mic\n/FLXkP1M9fMd4YSLs2zwqyOVZw8JaG/pi30HnT9K8UTc4HktVyGftjanMO8x\nVZvdt6n2cFnUWMnHpfV52TUq2I7v2uKmlyFOviZwiTF4+/MOrOwQHMQLaZQT\nAMSfxC/CMnv+P8SpjJ9N8QF1t0CN7thTnO4DZXvG9sq1Hnwm4WOokJAFa4PP\n+FGdqTa1Nllq2ahcReZfr0oeaT1LvtUSxCIxY50lc25CiTC9AoGssjur0XlH\nnwScXkYyC22kIgw+PAYY5CM8F0QtWQBjvAjnxPAabMx4GM0P4JHq217PHuIt\nQtGe\r\n=n8Du\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGXKpI6+Jo7ZLZmE79a6XlysA8ES4jgemzRCxu9ctCBQIhANNvvMAC/2VflUtJKCImK/GN6s0d3YUvhpFjs80/uBjC"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.8057c37.0_1576606224928_0.04943702263345795"},"_hasShrinkwrap":false},"0.0.0-canary.4d95fad.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4d95fad.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.4d95fad.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4d95fad.1","fusion-plugin-react-redux":"0.0.0-canary.4d95fad.1","fusion-plugin-universal-events":"0.0.0-canary.4d95fad.1","fusion-test-utils":"0.0.0-canary.4d95fad.1","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.4d95fad.1","fusion-plugin-universal-events":"0.0.0-canary.4d95fad.1"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4d95fad.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4d95fad.1","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Td5lxnkGIVJSdFoLUjl+9TDuLZSNCrr3Jdo+EdysaAC2ZPDHg35uUcndZ2GAjT2K9MrnkfmYatgODUDfWGYAzw==","shasum":"dbca49cee62e7fc8b28be8c2e0d9157682bf9b32","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4d95fad.1.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd/ARjCRA9TVsSAnZWagAA8CYP/i19VyI8UmFLy88UDth7\n0fNDkF7zPF2sng4g9UHyrOQ4md7w6ouig+DJ110IAnN1mx+B6C5j+EH8Chzt\nmuiGfM2KXzV8O4eSvETf54TXp4klw42DgW9XhZAcgnkh4iA0WYfZSwzcd9b4\ng5VE90X151xnkg7kKD1IKd8WubOH2hmA6oT7yG/rSuGlsr0qxuH658/dVnV+\nKuuq0izWYMKAVGQpCXHgIHrm+YJrQMqXeKzqk/8JDUPzjXyTcUelqWONlqky\nRt+dN+Lz/UXpWaJuafC7OU267RhZg2M8fI+MRWTVGjiZviuplxs96SSGaIU8\nJc7ErmH2unQH2oEZLjAwGAprF2yewC0rHz4O4PgTtu/SxssTqm9akLbC0ST6\nAtz8Uckgkrsj9Xrld+jyKJdYqcUu1ea4ZTsr118CZ9n5UM5MMOo/Kj7NVLlG\nV8rTh4b1X5bnBtDvODyeDdcjJtOvZatVtf3LYXdInwmErJJ/OUCkCAFHDkZR\nRRNMEU+3m4EQCALyCKCDXFgJ+qsWawuuymEBqkIa1BBy8WOKuCbswJHl/cvY\nHmju4ME29YjFFHgsZ9NSnOpTDG4Xzl1KIYWB7H42Zu90i+cQjYqw6fzLhWqd\nKe1bxCN8HeonXfLTezVeSTsoIvgzvAMjYl8/5VpIaNoCDfb50/K7YcLGWnau\nc7Xh\r\n=66o1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8ajh6q9GSOYo4E2sQ/j40uNE9pXwrQTYf2a3fTXUBXwIgH4/IcDe6zwAS6jtws1TzNgxkAfbzjg36NVxw/49R7Ns="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4d95fad.1_1576797283175_0.9652712463353481"},"_hasShrinkwrap":false},"0.0.0-canary.39fc7dc.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.39fc7dc.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.39fc7dc.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.39fc7dc.0","fusion-plugin-react-redux":"0.0.0-canary.39fc7dc.0","fusion-plugin-universal-events":"0.0.0-canary.39fc7dc.0","fusion-test-utils":"0.0.0-canary.39fc7dc.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.39fc7dc.0","fusion-plugin-universal-events":"0.0.0-canary.39fc7dc.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.39fc7dc.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.39fc7dc.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-58A4YFBxRLtn3Ih3NkRMIctNCshQ37/mvJ+qypEaGJQuSZCk5LFXbt1gbwDWGoPW4e1P0yHmRr9XiS0oHsZEFg==","shasum":"5f16d8bdcae81553a4cc44bc91de97e31d7d0858","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.39fc7dc.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeBSd8CRA9TVsSAnZWagAA3wgP/iS2AEITUE+XrggK7k0y\nzzsWLVwCGX3ylhw7TqcPakUZBW7SvlmwRm4r0R2rh7eUdJijtUzkVXdqQE1H\nc94OSZfh0y4UQqztpTXhROw5ssu/2jCEeFLyx9xrfK+KzID4/1U9hCAc6xQx\nkCFVFHm+rZy/ct+Cq7ZuoHY17BnmeJ6k9qE44ewkDxNWGfXrEzzhBdgqb7OL\noOtQvisOFBu1PTPCO2pG572OkhgcypI24mu14mkWR8qtHR+z5fXjhA/rZ9AM\nB0QYL+boXThBOgpgEmTcF/uAOj/uLG+bOpVn1B+V2+0oLlwBCnKBzOZCfDN1\n4MsBBVBg+PjIlXp4qbU7l/IAg2SDLkBBWMzv3ug3fLYQAVhQAZYosNsYYRzf\nJvk+JtD4HYmAAZoLU5jK++Csfbg0XkIhN9OmPmy8ADwgS+ahkTiSsJSWDPFT\nHCg+aT4w/pzgnMx5pjM4vQPTXkPuhmrHxRxlhaB3uSoKH8Cr+8d0bPbBfyAW\nuWCto6enOqEZuRB2aY82j39EhMtVw7v2ztZH4OpWXe/fpC40IUq6u0MticD3\nzWZHKBMP/CRsEDIVH7SjZ6Xb/B9pPj8Ki1erIB4Bbcw+N15+QHTJy3rVbAPm\nzyQiA5jgwqJp0sqAXBpDHIBQQOr3SnljMurhjXvAYvty1vdgJlqcT5tas8vn\nY23Y\r\n=pjCV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH+9oOIRTHrl3ji/5Mv3PLafAmo7g0sjP7auyer4/E8ZAiEAtdlQB6K4IC/Bfg4aQ90xGIMJ+4di9ceuztIeTF9osNk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.39fc7dc.0_1577396092021_0.9602065189792954"},"_hasShrinkwrap":false},"0.0.0-canary.549dba2.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.549dba2.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.549dba2.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.549dba2.0","fusion-plugin-react-redux":"0.0.0-canary.549dba2.0","fusion-plugin-universal-events":"0.0.0-canary.549dba2.0","fusion-test-utils":"0.0.0-canary.549dba2.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.549dba2.0","fusion-plugin-universal-events":"0.0.0-canary.549dba2.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.549dba2.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.549dba2.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-XiW5e4rLcKmV2YYrXD8c9+HPcrEx+JytEXU+dWuyfj7pi64cfUKgYnq9gtWP8Uz0Z6bCZKU0vvzylA7vTia4wg==","shasum":"4dee9e54d4fca8a27878866099c70513778d88af","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.549dba2.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeE9hKCRA9TVsSAnZWagAA9IwQAJoSmc+E2YywThHTt1A1\nIiNW/4+xBkaSC9PIH0I7A3Uwf+HFv5UJnfZlv37szZRfVGZiQIbwPYwWZGp3\nET5Fv7OQVNNVzOIYS/8PErePzpWSjBaLB02PqbKwYo9WR/x71VdbVWF5ComS\neUMGoJA5G99IX3CNTIcNZjY9fWde7Ekur+4PqVRL+hky1e5Yy7rKmdjBxWo5\n7JG6n4mhH151NtIPA54bajgPEbMyLVM6D9IpLb2Mh69/0bMhVx59xwJ99RiJ\naT9GlqBLD/zhRzAx8j1XY9NtT80Jyt/g1ti91xhPQtJSzUwfrPNDHc+wF+Y+\nXzLpqD8JazSWTk0JbBYgGscwq04aMRJAiieFkR0jxM16qWMhxtyXe87JnMqE\nCsaPLDQcbXV8ZVy2R99DKHDErJoUPkjAVroEFKzrUXZ170X1d4WHyNSFozJL\nhV2A+tvczNix3b//f6IKPte2Qz8iYomiRFzngeOMW0+p/8DkCUQ1+guF1HLG\nUAsnEd55qnTcg7+Q5M+FyThyTZZHh8UKklH4S+GM4Dp43aa+asq2rmQ8L4qS\ncEH+pboEy7mdro/mETc/YwkNhSshX5+/+OkO+8/BPdiC3Hwzp744Hn12nF5G\nqaSvEqOc+E3j+RgIBBstPZGi/f1nxC1k6MWbI01r6IpbbF30YDWWNTaeytBO\nTIJP\r\n=2TgU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOpFfRnR3uB1chjZ/KiR9Jhk1voJDJ3Rh6LTSuBDFDmAIgaiw+vaKhYZ225aObsxaTSxA29B7uoFg9OmkSJugn0As="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.549dba2.0_1578358858108_0.32836043402408"},"_hasShrinkwrap":false},"0.0.0-canary.69f275d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.69f275d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.69f275d.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.69f275d.0","fusion-plugin-react-redux":"0.0.0-canary.69f275d.0","fusion-plugin-universal-events":"0.0.0-canary.69f275d.0","fusion-test-utils":"0.0.0-canary.69f275d.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.69f275d.0","fusion-plugin-universal-events":"0.0.0-canary.69f275d.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69f275d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.69f275d.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-AVnIzp1ECRad+Ye394fBr+djsQ5rHPg9zkh4KJII27I/RTfJBDOYRqZ/Ia02G/8y5s4bgdwKzfsJdvzKD+6WOA==","shasum":"b154b9c82cbfd4c32b244fd3e2d2d36cec11869b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69f275d.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFRiVCRA9TVsSAnZWagAAQg8P/0LWFKwH2m/uKOGkJ+/1\nTwiqGLBxb3wqiikJhMxhMS36TA4FI3ELLT2kQ83Uegj7hAEqXqIcwLu8x0/a\nw63rGKaM8gDSB3ZPTVVvAC4oEwVaBRIk1H093stYWvhLO53XkSVk9VzwfUIR\nVWRkE+7tsT7f9NDtApCHth3X3LTvjGhrOTa8rpIe5xqQf3ts9abGME/T4iHM\nWu5wjnQtBYLDJSMEZ7hdrF1idjXuh1zmBfO5eNQKF0M0DdH/RgYRVQGThFog\nG8Oe5l1cnaVGFmeln0iuf9rokhO5LLE1Wl4hoTFMVMKuDo2a+F6ZJSU5Q2Cu\nydTl9vwhkPqEGiP9LaU/8+dcZy1LMMG0JXxUqueEa+NDw8kOXuM3McQZNWSI\nnRF11qIrpC76a7Qt51if7jHd0FE4gaobyjb4V7kpBSGlRT57giGh8Yz07YgU\nggjLU8D9XiT8YpuqSela1OHd3w+YAc+wapDhHi5NOUr3RzXHbtJf6G/Ukwvd\nJ7H80skAYxJziLU04omkKhFkVCNycp6ECZSsf0M9VLTnudBY4W9d7nhiNTiK\nUmyqQ86QG8avyaJuGxCti4vmgUC8QJXyvdm9io9DfnVReuwd9uZG3maZfnDy\nOTK7kgbHwlcsWPS7TM8L+EwmExpdMO2ra49//HhhBAz3kVURQ9AUjSHJ3dtg\nwy5o\r\n=n0uB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuAJE/e0M5A/mN8eMu7TNqZp1FHECVhBw/OV/DDeUBUgIhANXeRLz6sF0xqODxwX4mZqHcIit6w0UeTCC+rtQz88G8"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.69f275d.0_1578440853469_0.17007592205156996"},"_hasShrinkwrap":false},"0.0.0-canary.1d2aed6.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1d2aed6.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.1d2aed6.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.1d2aed6.0","fusion-plugin-react-redux":"0.0.0-canary.1d2aed6.0","fusion-plugin-universal-events":"0.0.0-canary.1d2aed6.0","fusion-test-utils":"0.0.0-canary.1d2aed6.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.1d2aed6.0","fusion-plugin-universal-events":"0.0.0-canary.1d2aed6.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1d2aed6.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1d2aed6.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Ibw1XDi8Al3HopQcysKumuNQQ+jmmM2vaWUeSc5qLOAJml4eIVvmSK63jmAz0oEjdQbsUvw1JJbRTTwTptYaPQ==","shasum":"0efe250568e79c035f7617c31cc6286934831433","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1d2aed6.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFm9hCRA9TVsSAnZWagAAzeUQAIoTbS0/P5QLVNT6imk9\nZUzuPL5M+iaF7vZbCz3M+plmvCql9qIvC9lYw/CiqXWLbIOJARRTcw5CVzhi\nbAQJxfhKGVEd/rLBSKzaO7KKos/Jz+VBbjjyfh82Z4qwTyOlVxc9Ac0+F4Zt\n2EGmyEhWjo445RcRecr2q2LZAAVlrykB0iwqDMvHzdflRnlFatMiZd3G3Q4y\ndutE4JUCGXLaRQRgNkbj09rDFMpyHPDyfI9CfsCYmEwzMUlWchcjOdou0qC9\nVSpckUnhuAFSCkP4EkHtTYEt5jqFtB98HgLR5yw18l+wr1llxqBURHo0Vpsl\nOETcz/eFmClpOIHUsTujwFTdT3+ATG8iLKK0bIAB3TGEPjesYpJdpU6A+raD\nUaXA0h6jCw3Yp9vM5Q9UPlP7AuTctsG41IkStp/Y36Z3x4fL2XAnvA5X2zPR\n+tog5YccsNRa2Icy5yCdKrGcXJgR2qWk/2WP/sVPaZELju8lKF+cAtOb+JVi\nZhzySISeLd2fCKYFrYHB+bUqrzw+EE4b695RnUVZVkUsr1VGvnj+pv6u+06Y\nAzxrOV9z7TM7Jw85TrUBjY4Z/adGENQStoTTBojuZi9PrDqdt/5hMCbNabUy\nRwsk/BZnfFXJucJhTgO6EujCearIx3RlniBs1+qZpxFLkeRqgJ/Ekj6OQT1d\nicoj\r\n=kaDt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjcGQ8zg2Jm/bwIU1orQACne+0i3TWvLWYuGaHrgVlGwIhANz2123Xa4MPTKoFSeqeAbhmG3nLr8jZULWavMoqz62z"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1d2aed6.0_1578528608757_0.6303958945417985"},"_hasShrinkwrap":false},"0.0.0-canary.7ed789a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7ed789a.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.7ed789a.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.7ed789a.0","fusion-plugin-react-redux":"0.0.0-canary.7ed789a.0","fusion-plugin-universal-events":"0.0.0-canary.7ed789a.0","fusion-test-utils":"0.0.0-canary.7ed789a.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.7ed789a.0","fusion-plugin-universal-events":"0.0.0-canary.7ed789a.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7ed789a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7ed789a.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-yQjXT0dItmQs0WVcdlEOpEef+x8wp0QI8/awiS9IMu6E55MJDm0QUMnGlCIIlSYByDHeHCKowb9vqSgbVi20yg==","shasum":"5176b370fe54c729becea8c66efd6afb002f59fa","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7ed789a.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeFn+0CRA9TVsSAnZWagAAMtsP/0LM1lYcc+BlCAV7z600\n+bfTBGQ8cjH+uqLKZiTyx/qVgWJDjmSXyoFK1TFaHImmQkYX6zaY4S9D60Fs\nJiuJAodAhK2dNCn3FjYn1n9t3MZwHV6foATfXb/xCFCVyLdYmnP/q7a0NeHE\nQUfIi9w0IyPGUvDMNX62uiOrf3hm3nIiFlP5NWiT5h+iYbrt8hCU0/si34wu\npGRBcJWmVrLDNqPHOyQ3Bsz4dLuFB2JqY65hkNlpVnfU0gh5GHC485zq+MKK\n2paW1b47BgJGePOrB1m5q59mrILk7dp/fu1Db6FKweoZbmh0OAA9n3LFO1nq\nb0zazP0c0dgkPXrtqMMukiJXI2WP9dcaLZbTbreMgg1K4CKTKG2Yig64iY0O\nDrKiW790M4Ll+HQPLO6U4KxC37tAhCRPg/e/YoPhFs2UPGJ4+1XWWWbaEb7U\nlT0uizVirxUZGwnTM7hDTaQw3Y63h5rzfEGGbTVYQuhxOeLCQRszxGkQaHT7\nPVxFBYkfgXYeSCJ3MYSklGi9yDServZI4ig1AXgnb6dsLlkoomRNLs9di2ns\nLMYDVzziydvynBnpNY8eg421N+SKCRwEwwuV9o/Pt+uB3/AG0ZeCL/63osAx\nxJEzxMc3fEtWcVohfcSroDIPXT1/gpGv48yq279+wHgw2wAZRn3rA9a6VW8A\nnap9\r\n=dWni\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBv3Rd6WiIUb27BWHzeLv2VUp0LGWdE2Jpv6tutFcExWAiEAjWMWZzITG86xfAc93emEleDCPK6osi1BozKbo2rrqMQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7ed789a.0_1578532788089_0.030419086418723262"},"_hasShrinkwrap":false},"0.0.0-canary.cd789cd.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.cd789cd.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.cd789cd.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.cd789cd.0","fusion-plugin-react-redux":"0.0.0-canary.cd789cd.0","fusion-plugin-universal-events":"0.0.0-canary.cd789cd.0","fusion-test-utils":"0.0.0-canary.cd789cd.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.cd789cd.0","fusion-plugin-universal-events":"0.0.0-canary.cd789cd.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.cd789cd.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.cd789cd.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-V5GI4jfDbDxRncCurYXJK7Bsw3SZDot3il1yr4k/NFetY1bSU4FTjjMgDVK35icVM0rD8h0OcB4lVFbmY1nleA==","shasum":"89c1903a826bf7ba92e8e9fea57b7f32858c5f2f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.cd789cd.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGOiaCRA9TVsSAnZWagAArPwP/iLfsm/A3Zqi4K7caHU+\njK0nsLYwfs6LVoLYVW6oq9LWTYwTUBsouhblHvkFt0Vt2h6UPggPYEyWv6l+\nHNksoUR+j2L6DPvqAmiWVj2XxjG9cCHONYnAg48VnwGf7YX+qYO3ptudv53F\nQFsXpcKahQQe1rgBkDFHglKsUeoHQF+XQc3DiiF++izU09dNwebvBWl48h+6\nTzXXtml6rvlGceNgastW3i8gp+IyPwpkpLNotW9uhuLwidcgu6Aw5jyFcTxE\n/odmBcTOHzqyXymMpGudtJQrEuhP0XFabPc+u+Xa2f75tRvtH5+OwOwmbamj\nVIg5oxyB23nrf7y4ENc2MQjgKYTX1CPFfut402cs7MnEpWe75bDO/rr03Rm/\nUxh1i1tibbY1mu4b/K2JFdu5C/QQIG/APfgqSHlLC0Uvpo5vXl59G+9cq4Vs\ni+o60Oo4vAkBB6SzyYm2TAdjYHhVxCBbMqTjPzFGouezxRB2QefM8NsCoHn9\nTh0uvkWdHZnO4nWKhWWDUtFXkp2tNSYDvx0FpWAA29T+EGBuNLgx+T5azJZO\nADWX7thk8+ora9H0M6a3vq6Ec5Mqnw/zgqwNpuOzuh2kM0acgq7LN03/+IP7\nhuszkgz6k/stqDORW2B+WAzw+h33hK6DeGvdhZgxJeWDfphQkg+TljCxWBm6\n9TTo\r\n=LoJL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID+hLUTqhXvU2kGsGKOkRITxQ1eJs7w9k7Wo/57rnMA3AiAtbFJUBAl/luIrP0ZfnEMv6JDUczouhq52O6XKVDklnA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.cd789cd.0_1578690714005_0.6557981246208755"},"_hasShrinkwrap":false},"0.0.0-canary.ee6892e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ee6892e.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.ee6892e.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.ee6892e.0","fusion-plugin-react-redux":"0.0.0-canary.ee6892e.0","fusion-plugin-universal-events":"0.0.0-canary.ee6892e.0","fusion-test-utils":"0.0.0-canary.ee6892e.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.ee6892e.0","fusion-plugin-universal-events":"0.0.0-canary.ee6892e.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ee6892e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ee6892e.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-wSy7RnjuSeixWFKptB8XO6zgqUwHsVFug2nb+xoXSJP0FHzbBqzJiQcFtQSeKezArJ20YE4zwSGkyHpUTc4Ybw==","shasum":"81a76d76284bc11ddd6681640df8de55ef98bf55","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ee6892e.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGPOWCRA9TVsSAnZWagAA9PgP/R3n+w1iKfdBQe9XqKL/\nyq18aWy800ky99VBX3ux2xJmfE0vI4NLWQjMlOm/eZVRDLxY17Q4MXtGz9BN\na8s0im58LgFLAoZi4/ST9cLoabfR7BPloM6Fgons7U57qCoT2a/I8WqjmzW4\nzAzYZKRw3eNateZtuIPzPnLaAgsnBzfW9Q2WbJYK/pEZ56jKqS6vkNYspskc\njSz7N27mdkgB+Zcp3huEoI0bwd/r8ZC/M2NvlqE/+aS8Zxa+I7Q3Dket/o20\nKGz9h+yveGTFfMZNx1ps8larF4r1nCRDSjycK3u62cXO/SdShXWwwagsAAYG\n1mnW3Izoz6bMqbU1OtbVMYxbnp88scB+9loJOdptgpB8mPKc/Ek6l4JYzIpo\npEjbYdliq35ah7I+Zpx5Kwg3HiP/kafDDytwq7C06n4dmlNkW24GDl7y4Eae\nQVLJ+fQFRaV8SqmTo1/s436aCGxfl55nUPS/hWYEoQ6UQfUlPVqRcnAPxvn2\n99rVjcCg7fBG72LqdtgZVAFXtzHTFfVnkXt3oX9uR+BZgIzk5kk6douy72S3\n1VNn+mGNE5QOUsfL+e+awgo+TlQLNmtS7kPY6y6kc5pg1Gh+ZbW2T7e41t7p\nhAaR/Yt6fQWhcOFtcoWw7z8LBOPyNGyQsCVY3Y4kMLhpZIvWihkzkBoW99gh\nOeeY\r\n=WPWX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVKP4Oknj5VJfIaS5RjOqHphTZngO8jpOubxKB5vDuNgIgWlao0ya5aaY5poiQWU8f2lo94mo0D/Q9RYSwhsSZGoE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ee6892e.0_1578693526110_0.7774209217441168"},"_hasShrinkwrap":false},"0.0.0-canary.abffccd.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.abffccd.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.abffccd.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.abffccd.0","fusion-plugin-react-redux":"0.0.0-canary.abffccd.0","fusion-plugin-universal-events":"0.0.0-canary.abffccd.0","fusion-test-utils":"0.0.0-canary.abffccd.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.abffccd.0","fusion-plugin-universal-events":"0.0.0-canary.abffccd.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.abffccd.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.abffccd.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-X50Gzl763zTPYcQyTwpeJiKXmTnlVsMAeOtrtiX8Ej2G1mPiKcI0EiJDbWRMXbSya95q7VANJRhvwj7APQ64sg==","shasum":"f58ce1cbe6925924e1784303bbe4e22b864551e0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.abffccd.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGRmxCRA9TVsSAnZWagAAtWkP/31q78G6xYQ91JyZsOY5\nIu1CTIONXshhsEmsx81uOm2kQ+dqM/sVqrsY0dlTkcVknyz7a1+Ty6MLejs3\nq0DbNEAMbjp0Lbzfsu8AQXebVATyGbIP4d3nUg70TEWlFq2SFx0vte7SNNyj\nNxt6HGrhwJuhkiN+VvE8fNlZgDjQ/AsKdMrIHJMrwstfi7EpTEcoRrSqX5yQ\nWP1qZdlZk4qhMMhRhdrKx3wWZxx/18luMTuGKnPGi4GUrXNud8bU01di3g2T\nIjLY6F57CX3WoueviF1ZyCGF3Hufr/mr1ShJbOboUz1P0eROwrMMq/SwIovG\n+ieKiWyxC6IODy6ejXEjNl8T1+IOGhR3kw3bOb1noOQAjnvjwq3pd/NfZkcC\n6liuEj6V2fkYapzCYz8daZWS3HN1aC3K58yp6AL8P/HV96G9+pBGcFsJSZpi\nlSM4qaBV72LYVQatpnb05rNAqivMA5KhPpdy4u022t9s78kFsALilnyzGOrb\nQ9silY/80coftiWxnY3oufb99cmLeGbuxA0wTtH5uwfgpXtPz3apMPvUKywW\nNfCtBfwmqQHQkJm6SeY7MF6647e6Xn+uIlb2qiJZ0k2jzsnRdfeajcgaL12d\nXyq8HPux3jNlLIIZkyngzCQBulc4GwewtR6PDpKP2NvTmVOUkleip8cOoLRo\nE01B\r\n=8A6w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDd7DHG48d139YI9tjXhtbGv60yZtGef0DtP01hYzpBUAiEAn1WqFF4/32bs/qHAXXT4PwbFR1VOW7KsAzlb00hsMPE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.abffccd.0_1578703281478_0.6633011805350046"},"_hasShrinkwrap":false},"0.0.0-canary.b94debb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b94debb.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.b94debb.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b94debb.0","fusion-plugin-react-redux":"0.0.0-canary.b94debb.0","fusion-plugin-universal-events":"0.0.0-canary.b94debb.0","fusion-test-utils":"0.0.0-canary.b94debb.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b94debb.0","fusion-plugin-universal-events":"0.0.0-canary.b94debb.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b94debb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b94debb.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-zXp/7QS3mAsJAG1QZuH0HMZd7C3HOzrd3pNZkLQhYLhynFUYQPaLTxQ8J6CK0LiWYb9+ouiN2u/MgyQpnFPpUA==","shasum":"371c60b734b04bfea7635a9423cc92efb3b4c46e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b94debb.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeGSMvCRA9TVsSAnZWagAA0ssP/R0QQ4cSUNNK9xqKiG/p\nJ2e2by1Uly6lFre7u/UDyRdOvLaIsHE4tcyGJYjtOg3fNP+jRXAiMI/0RRFZ\nLoDMnLP7LenS21VdX5oUkmjnlfiOGe0dYW5AfSvCu2d97D1HkfQupHB7hD1C\n3DwzUAZlR9gFgXIziLmGwJDCbLIwzGUveLMzvrFseLQs0OTYfn+m9DsWqRA9\nht+A3PSmwoOtN5L8LlPj1ZqGHxQgnvtW8f85OYA+0Y1m+O7F20YJaY7voNRz\ngmg4tSYxacMMBbm2vRClWoEnImCO0rqus3nvzMuHcC95iFfuqbYNtTzT0V7N\nAGCc9ahwAf9scQCyeROEw4+FqxQbRHPIsqSaCSC4g4I00gExSkRK+39zsKt1\neBBp/9N4osywJcNw3ITlaaPHJCZS68WrZoRLA3Vis45LlQrB99d01nWBHGQB\nJwbe2Qj82MtBaDfMB6mBCqatMFK4F1HrxM48VjVlMtP3NvuNSynx8DS5P0aI\nsYMHQyTIYAz/KwnghJIveuG9Ec90qROVsIcWCObQtchP7/bzxAhp2foUyp2W\nzktvFKL1PGBoHaShzo0D4Me//+FNqlc0K3xgKUjJhJR5zrbnS/uMZiO9XByT\n1ssT2ay1QJJU9X9+wGar/6tLMpOcjgl+eadygdFc5lo3qQDDEZzm/32UQVbB\nbGzx\r\n=r0qj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF9lnfm6OdykPWj6j8c/lCdq/y9QP5KOwoEWCJQ8aSp1AiEA7Jb0kerIFnb7ViBJ/BCmaWj7lZL4ioMyAJwmO3sWOMc="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b94debb.0_1578705711303_0.606158152354086"},"_hasShrinkwrap":false},"3.0.11":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.0.11","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"6.0.7","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"2.0.9","fusion-plugin-react-redux":"2.0.9","fusion-plugin-universal-events":"2.0.10","fusion-test-utils":"2.0.9","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.0.9","fusion-plugin-universal-events":"2.0.10"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.0.11.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.0.11","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-zXP2p0Vso5OiBBeHkAFjxcMR1T3CXAmXewamsQQzBtKZyqycdSe0a75f3KxbaEXNzhiK9vR0uQ+SkC9EEmWRMQ==","shasum":"afba613b519f35819ec80f0c89d5dcab3bef76da","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.0.11.tgz","fileCount":17,"unpackedSize":42077,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHQ9CCRA9TVsSAnZWagAAZ50QAIL9TacJxMY+7ZBFkoxg\nw4rAfPPvzwlYdJy/j35FrVE0V+ElODyn9d3cI+7g/Yg2HFGKf3sZJMFZZs50\nohYBDTKk6se9QYTLrCtHbQZETi20azmbYfokFicUKCSfTeA6SmaWlCjkTJVs\nuBCWy99oGSJrCcZBI+KROj6rHDFSoZ37JeuoeJAuVgqzCgkUvsXRv4FZwgpp\na3ezXqRWsMm5AZhp7K676VtMcjKtk2w139cT/7s11Q8I7U9h2PDT9AoglJME\nPZ4GDGIYl2WZ50R7RPOBGlemjr3sOZNf7fu02M2/oBVJVEyvTf6zfiTxFY7p\n+CgL8Yp0F45c/YR3gmzxUkeLuC4RIRTTPAeSShLfKf8tGh8ecUdprXovDsQs\nGPoxtqun5RF4B0IzQFNK0CIxGArxkO9u0M3Yy12iEKYxktp+SX9VztUGK1cR\nJu+Q0gujhYO7Bav38Gys5Fnchxdwobp45eylAfsMLlloe4EV/6EVojGzdq7q\na3L7T5ojsm9sX/LVPpIjBcneGFUBDNgGd8MKicF7xmEETN5h73k6kKrToPZO\nd85Lxkee2Az6jItMKNwt3Y9CmOhX5pSmWVplRsFZTb7OxeoD+uYJKmYWAfoT\nPZfwB/5LCfFHvuEOXOT8NfG52+8e+c5kmTMi1dJawuds7P16ZIwi4O98si+N\nZkLT\r\n=rzwa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAuNnu6fYCUd5hc39rGNkjut8CaSeIDKV/FnqJ2HQlwJAiBFZNvRs8GrFqwcWq+0IgaLiEFC5XTsTvFKNyhViLLyNA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.0.11_1578962754111_0.7777254172441725"},"_hasShrinkwrap":false},"0.0.0-canary.659c743.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.659c743.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.659c743.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.659c743.0","fusion-plugin-react-redux":"0.0.0-canary.659c743.0","fusion-plugin-universal-events":"0.0.0-canary.659c743.0","fusion-test-utils":"0.0.0-canary.659c743.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.659c743.0","fusion-plugin-universal-events":"0.0.0-canary.659c743.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.659c743.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.659c743.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-ZhfuMFW01phIoTlEE8fYR8MGHdVELAnlOU4hQTTVDN5VXwsEIRSJICCS7hlkbclKBM6Cub5G02Ry+Tbnl8TvRQ==","shasum":"3bf10864946c448d6b869e4e0e9f22b9b852d3ae","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.659c743.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKKamCRA9TVsSAnZWagAAjkAQAJkIZC/O3RbcnrEK29/i\n8bKxffxkGgvvIN2n4E1abn/6ylvffFUsqfiuytDBD8w9aaCWifnp5aFiRfSP\nk4OTk9ccRFx9fVeTOdWtRNOh/zOCnR2KVF8gmN+8b1FQ/PkQpLbzQLU8xevD\nibP4ULe9if3AOQ+E29Tywf0vesBeNSATBae13vMy0wKGWoyaLCQXWbCQDc94\nEq0NMUggLh2eUqtxXLLwbOTyw+4FpmDoyYedSzllwWwwU/+iwVNaMbJF0J9m\n4cePSj5ONajwCuhic3FJvfPu2uetqW+zAIhAjo5HkyZ6rnIT7OKNDwO2141z\nnaN0aoJhi8hT61DgdT6BWw80IkoVyi6pLULpLkM97hV/+6F1F+QYZLFJfiST\nrwgd5t076h1SO9bvTXUmey1hxBqgo7BOlGPfwI8Wm8kUxcQeE1IxNeeGF45V\neWp/EU4Kh2fQ6pISWJ6kRPlQRfyBJ7RMtqUJMrWDV3qlH1RODnHUJlCutvKR\nwFTC6Wy6P+ekLUSOjuYKU0wRXHmesQFsP6QDKusxWTdpBje6VFb0wbnqaRLf\nGp3Yneuhw6rtc4HoVI7ZQGnx1YYD0u55CVqK9DJeuryzrcSS3dwRO7dXXaH2\n+IQQkuKCAj9b/lhaAZuHgxCqW8FkHbrcFBcUfKC3XzIYtQoMAUwhfyxuLTMr\n6+2v\r\n=FhF6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIJwxcmf0xgDtMs+46vFQAXMVD1aqn9SM17rrqW9dMZwIgGmeEpgC4ZTyNBx0sXwAd5eTpOkINTArv5XPMAEIDrwQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.659c743.0_1579722405830_0.25751734463302567"},"_hasShrinkwrap":false},"0.0.0-canary.df13289.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.df13289.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.df13289.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.df13289.0","fusion-plugin-react-redux":"0.0.0-canary.df13289.0","fusion-plugin-universal-events":"0.0.0-canary.df13289.0","fusion-test-utils":"0.0.0-canary.df13289.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.df13289.0","fusion-plugin-universal-events":"0.0.0-canary.df13289.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.df13289.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.df13289.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-xLXiNsdizw9BAkhPm0tPLmfJjw+30HXD+lNdyYJB/HfuDBBn6AiOwviFQGJirIwOnN+wnoFqLRcSCMkdESQVPA==","shasum":"4dab692e86c1242299f5a420bb302da3d074b9c4","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.df13289.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKP0OCRA9TVsSAnZWagAAC0wP/1ty4ERKCK2j3lyYWIqc\n6lw11E2PK46tTtSHg+Xa6ILnofWo6CoSk4TKS4c/z/1bUmEEI5tD/ab08ty3\n8g04E25E3pLLOruG4THq0Vcwo+EAEZjURN1Ypm9A9jvQ8EOmFrpXSLbrOtra\nySWVixaDV6qccL4D+dNaUH8l+ZKJTK6QlchxfaX884b8l/NuHUHBTFMEjNjO\n0quSo3bV+fxLAvekNBtF4QbRQ5bFyidS4TD+u9tElQjgsUyuRNK8RUT8k7+J\n6LcG05nDgLO+muN1PH07bxgRs06Bc2gqvEZ59fVjqRUA13StxLXMfNNAHBmA\nq+8ZrT8/+je+u+anIHlqQxXRBYHeZ3T7coJj/3GQZr88NniM++DLBgbzEM0B\nnyE/8Vx7O83fLbbue/9Xa7rKpK6udCSyW6/oVZ03seNEPH3Z3YBBrFcDlI71\nrcVhug8M9wjNxj7zsOlPN/3MGeRMMTFPmFvufr3KGRFl7MQxJXJ7s24t8+ry\nem9M1m/Gd0hbkq+ZBE5bZ/gWqEta+mzC1wSt1knVaftZh+8f6+0URhxrza3s\nbP8CZ4qIBwkOmW5fF+Om6CapXOsgfj5vWsbdMyjq5Z3t3XYYdlqgugDbMAYx\nX9SLxw9qo5G+Qk6HAq+++YVNPHdre53oLLlOXgfwT06wbudOf5DDCbNkE5yW\nybLQ\r\n=Hywv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHnY+XAvzZAC3cXshlajwNCaRKaJ2NXh8uqHLSt/rGhOAiAGAcB/G8d3cUJ/3WLV3xK9pIApNpiRpCezpLwycGUTWQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.df13289.0_1579744525537_0.21754721866464144"},"_hasShrinkwrap":false},"0.0.0-canary.79c5c12.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.79c5c12.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.79c5c12.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.79c5c12.0","fusion-plugin-react-redux":"0.0.0-canary.79c5c12.0","fusion-plugin-universal-events":"0.0.0-canary.79c5c12.0","fusion-test-utils":"0.0.0-canary.79c5c12.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.79c5c12.0","fusion-plugin-universal-events":"0.0.0-canary.79c5c12.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.79c5c12.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.79c5c12.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-AlUusXFr5X8gtmexTTo8RvCm4o6rmeZexppfmwaKY7CZmZsiiRLhV+7ZLZrdEvNifa+fnOOUKJHX7tKGq9Y9JQ==","shasum":"39c2561ee9dced593f9c00a37670fe1da07007e6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.79c5c12.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKfLHCRA9TVsSAnZWagAAuXAP/jxgUgn1tR7j1gcnPSyd\nNG3CpQdsXz35hmzILf2EPamUXmZwUtM0ffC7LEHmJwCUKtdTlUpxauNCcRLJ\nbidPIaTaGcHI0t7FEf3Ld6cReLWslJjf1FU29+UObzmKHsTHB0CdTHsuR9zR\nYOtneDeZ+qupSS8B2k7P7IodfMgyVjWJMAnu2qWp/bMKCLrvYHRksGJWLMBs\nHYQToi/5kkPO/hS3D4Sk34g60kPUiPSbTmX1vWMMWFOABQq3oZC31livyFSw\n4+QI09e7uObwZFkYFbCTfEtAGcxcoqj9uS7x2vRJiVzY4MDX9e80vJ5sjWQ4\nssDJzr0ZmEz5mNfOWu13Qq3Demv7N4ECYqM9Klgn4U7+SdJQHjZPLyQ4sbgv\nrYCDR4xKAdkCYzVEsOygfzW5llinNQTJayQyIYmYlYMUaomV3hz7u4UoKWIP\nuNZc8IThLGdrcAA/vdb4Qbr8f7s6FvKENVq/Migu+n8pVg19rYGo7vq9wZtJ\niD4nrFtuGWCiMP8tZDZqGgPxA+8lbGP9amdjazxFvmiB5fvcRmWI0xOAN6v1\nUPtouGym8S9OYZn21jGrh4Y1T17Cx4gx7JqzW0EL2GEcZdsKhPPorq82B1ws\nlP2ZDQ5cU+b7+5+H9VhXqkXhtZIrMNB9V3eMmyP1CbMhRD6m1gG8sL9DTkIh\nb1wI\r\n=6eu+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpfyn5JXEmDQE5cgQtWZFHVPlJfI+TuWXGKRiojQMTJQIhAM037Zw3EYBqkZ4xglehPTaz5u/yl6W16XW0LDTH5uIs"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.79c5c12.0_1579807431240_0.4536015242483544"},"_hasShrinkwrap":false},"0.0.0-canary.3a8e24a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3a8e24a.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.3a8e24a.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.3a8e24a.0","fusion-plugin-react-redux":"0.0.0-canary.3a8e24a.0","fusion-plugin-universal-events":"0.0.0-canary.3a8e24a.0","fusion-test-utils":"0.0.0-canary.3a8e24a.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3a8e24a.0","fusion-plugin-universal-events":"0.0.0-canary.3a8e24a.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3a8e24a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3a8e24a.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-yOU7HKpoWkHc4vxfvqxy2bAoYJfL8XUaGyegZy95x3cFei/y9y8Y+3dAfBMhhZOQsYByf25N1eA7ENHK9dNSXg==","shasum":"c85bd3ea583194a63cb6db57915edf108c3381ee","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3a8e24a.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKiM9CRA9TVsSAnZWagAAuPQP/0fmVpJeiLHRHpRSkaB2\nn/XHdYLvqv3lQvZvp+Is03E5IiXWvFy2+CW6VkcC+kTiIujslj3MJonKIXXU\ndDOinQ2mGn7F3p9TD/Zksdl/WuQsE+U4xdWF9iKA3DKq9c216DXkOGBoxWYn\nTAaRPWq1Pbs/GFGXG0VGBjbJ5zoOwmwF8JrrhHn+jrXJecTD3YH3zpY8jdOC\nXmlArFQTJyhBtJ/sD1TUXFZl78sHmmVot2tRtH7wy+I/GjujbBM7GreIDUpt\nXFrStt+7SLsGKs3McEtKx+6qumHb3yjGKQol0RISFNjNm1cD0mes54uO5PW9\nBpVawB8p4tUUhOUlWXUpEZhgERYi2DRu1RtVPd9VX6/RkbY3y6F44H19xOE8\nvzK5vPN03Z+dm5OopW1pSPD8+3EeiIfSxbzOFps+shehDAWxIEmbBsRZQyhj\n381jU3mJDze9RIZrM+N0JhkwpjVm1QbWKgeSBw9u7HiuWVFGC+JscN+wAOjo\n0NwS2pfGbT534Iy9z1JaxuUBkuuHwmDHKGNo/9MtZfBRB27OJASNnj0JwOJ5\nBaSHomjQDZjhJlxiz41kxR/EpokoY6QVTmXkbpYbdY3RO0dOWvklE9NdUVtc\nWymjfhDBxRh4yvya9FNT5GOVc5ZKLoxwp/vzL1YmNX8JoKzaLZ4mKSWaImFB\nWlBW\r\n=4vG7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICpAeIZdDr5fpN6dpyBAuSJyqBlFHPa9T18CzCBay711AiEA4UmU3ufPxM6MOEZbVeXwWApLf7Emtb1sC61Uy3UpExU="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3a8e24a.0_1579819837108_0.0884182543997798"},"_hasShrinkwrap":false},"0.0.0-canary.55e2075.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.55e2075.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.55e2075.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.55e2075.0","fusion-plugin-react-redux":"0.0.0-canary.55e2075.0","fusion-plugin-universal-events":"0.0.0-canary.55e2075.0","fusion-test-utils":"0.0.0-canary.55e2075.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.55e2075.0","fusion-plugin-universal-events":"0.0.0-canary.55e2075.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.55e2075.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.55e2075.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-JD1T/CGcElTehTnKQ1/JVUpz5f3aSfuZjLGmxS1qYsFvLRXxTzuUYmd0jwAbUYTB9eoEiyfYqIEz904NQD1XzQ==","shasum":"a5749f8e1a5dcf8816b279edf2ae57ac111e6772","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.55e2075.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKj97CRA9TVsSAnZWagAAPM8P/08xBKMNDkimGyYqqfsp\n8DePRnBRcJnXwfsCqfxzjfhFRGiXMcGA3llKvWAVk6Oa9WR7LzNNdwpZYyKD\nJv7Vaww6YYFPbZ2Hs0hr8W6aHFQSUAXbUcuSUhnoLtdvTgI0/9xfFnA4T/qH\nDhvBcdIdZ+ClUbyKY6rOsl09rX31B0ikN10vTDIYUBOpPDOV8qy6rDF8xjLR\nBXz8s5gw037XA4/pMv82MpCWtuUQ6suSA4L8FkknJ7Qn7fA+GtPGNSO6KKNN\nOqzgEiUnETbMtfitbBl6zhSy3/g9N+FKqKOUVHa7y1HtPTTo/KG0nVR6uPSb\nc3+PMpR78XSJrrW4NCPFv0OmboRZKxkPs9dZxz8Im5D+NeO/9Tu3YNq2Upzt\n96Tw7NW026V0IRWU7cGHNO72nc6irI1ocSEz2puzY5G4KSoFlHg8NJHbxQSU\n+2wZaKbbxGXyQG8sp/S1lGQMnJMUf8xIfbPUhWnuMCa2NAWf99dIQwqtwgTc\npdQHMRsO3oXk8WpIy6vwz17M450GHI48pOuqC5k9/5U/NpvqU3KPCRDf9AP8\n26/4WDDkFr2NuHcFNANKPriZ18BjQ1gah0zFE63B1nOCi/IV26uo8u1Oc4NV\ngHVfORtvET+eVOoBalHwUKXZj94a5gkFJ7VUkSP/AOOyjcSuh8/cWparv45j\nJolK\r\n=Qlc6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEkb7vHeXswojqtjpyJLnZQtNmgR1FF7eUbz3exCAuNrAiEA5E56+M77s/qQBRGWSmDWLgD+9zsaOq82Ew4bzd3UDFI="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.55e2075.0_1579827067350_0.512641791692048"},"_hasShrinkwrap":false},"0.0.0-canary.294feb4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.294feb4.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.294feb4.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.294feb4.0","fusion-plugin-react-redux":"0.0.0-canary.294feb4.0","fusion-plugin-universal-events":"0.0.0-canary.294feb4.0","fusion-test-utils":"0.0.0-canary.294feb4.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.294feb4.0","fusion-plugin-universal-events":"0.0.0-canary.294feb4.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.294feb4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.294feb4.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-YQwG4D2EYWuoKtYytELRWpTmh5NixBSZs1X9/SSJe82BK6FXI7qz0A17TIDB0fUEZY5AOx+BO6Jvc+ECbuUnoA==","shasum":"d7ff523eea516d66f862beb7b9de50a5f02cb1c7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.294feb4.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeK2/FCRA9TVsSAnZWagAAglYP/0Tp5SkwTHIWBmcNmTZk\nwUQnnoWLS2W0QOiZqIsrFGmBlIzKUhZ06yBL0WJYD9bYSm6Ip0dd59FFdNOe\nu6cbActSvLcIYtxVt2ZeXJBoIbvwRsIvSdtyGLx5npjMG6QF6wlKK2+aIasG\nJCFrckbiPZMrUZkCQVtgXW5Y1aRN34GzrPiZz0LwxmGUIPej+AZIf3OvnAX5\nhAh4sLFbD70sIW9vrVI//GnBltYUrAn/w7qjQP0lOOObRamuU9xWPSYpz5J9\nNsMgH+/Ey7CZxBmu4yPhyO/7WnB7sLnFso3h/fY8hJa6++V9Pzhwi51eXxRX\nank/ywxsADP+yYnIz4+59haNe+1HWFI8moMDeRlv0vJ80QILUvT6v9tjAsbp\nMokFmaUSrExkt6P80sl8AF2XW35x0iKf56q4aixObRoOKy85a3eCKh6Ru4gj\n8cNpFEx1NY+7lYajIjRmpoSzLK8A+LMaonENa40OypLHQxGB4UX5w6PAy9T5\nbuG0u/uT1PKq+p0hs/0Y960Lak4LiaVyDIOXqdIzsf4pQ4rHSn96EOtAeD0i\nRwzCxE+U7xIanjN9bnqF9AmLU3Ewntp1xSgXcuLkQmucWMDE2+Iwi3ZPiK/v\nK5MsfKAoWjK7kyCG6+jXJ0Ghymdn2ttcI9KQJqIEsFDbky6s7yuAKXaRzBgH\ncLqk\r\n=zeQa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOfDkZaj0VVg0Y9K9wYe+03TnyDxcdrBPvzV4SYNDZ4wIhANfLxH8gE4H85KB2cRIr3AnWlE7xvvPQiJJRS1qnnIED"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.294feb4.0_1579904965418_0.45724435010088493"},"_hasShrinkwrap":false},"0.0.0-canary.5c80f83.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5c80f83.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.5c80f83.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.5c80f83.0","fusion-plugin-react-redux":"0.0.0-canary.5c80f83.0","fusion-plugin-universal-events":"0.0.0-canary.5c80f83.0","fusion-test-utils":"0.0.0-canary.5c80f83.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.5c80f83.0","fusion-plugin-universal-events":"0.0.0-canary.5c80f83.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5c80f83.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5c80f83.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-4YPGzOoFyU7IM/AThKqa040kE3+rdf1SxnN0sE12FAg1aSWv9tOE4GYfr44QcH+eXRmtHGF+mSd4NLIMIbY6Jw==","shasum":"c7e8ad72ac120ae137196fbc2f2488fa4edeb550","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5c80f83.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLzKoCRA9TVsSAnZWagAAvxYQAJWtu3q3PDKXj8cASQBp\nqSMcEtOBYpiqfXhYM+EIuvIs0Esa03jR4Y5o9BPqdDshF+8kfCwJdaKTwwfa\n5/MXNuDY9XHRadep1iH2E9tCVT2OOEYwALIQTFJZ6kvpodCuAZh7N3Xa79Yu\nZfKwD3ltaazPYQWlWu+mRs1obQmymkbOK4OKvmlQfKMrS30CJqa/dBXRYcfk\nSiDffcEqPRHLQHsWATWIb8dPTYqwf4hqnkHa6XM6mD+HqULjBA/xopTL5hnn\nLGN5K1HIeswa7mFKxLOX4vfqvrVGcnPGzRL1EFKdb2SHKXGJLyRnIPMwPKzD\n/FsdSMEJWr2bl8o1kEp10awJIo1r7U/143xgxgPcRpXOfTSrlu23H9lYwalp\nJYTv451523afR2jdsgELrr5XRHkCXpztWgCLqGiuga2Db6yuaRSJ6FL5c6Xq\nDnspVkhu5sa/6r8Ofl0T3cwXjTYWtUK8ZZ1kxyEJlR1FIreu4uzP+u0Hv3LW\nHTO/LmkrdUfhtLgVF3kiCSv7cp3qMvBbqZlFYGmlk+Bmw9kY8a/vEyHrOjs1\nGZ8Of0uyCDOB0ZCMkSq+bKt90DbWRYdPqr/h421dcOFPpe42hceUj/jlocUD\nj6xEO+J1obUHqUvzpUy/2JBbQjVaNA6Vy40EzlGdaBkQ3amGqDIUrg6ROi1m\nCgZT\r\n=A6c8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzDmBsugssSU7/EX0zOoj6+Cx0sgF/1heBQnwRjhrNeAiEA9YaxYb6BVRRPg1gx/w37BZXiB2bUtveVCpHx6kWEl7U="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5c80f83.0_1580151463705_0.13618322872882804"},"_hasShrinkwrap":false},"0.0.0-canary.cdb104d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.cdb104d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.cdb104d.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.cdb104d.0","fusion-plugin-react-redux":"0.0.0-canary.cdb104d.0","fusion-plugin-universal-events":"0.0.0-canary.cdb104d.0","fusion-test-utils":"0.0.0-canary.cdb104d.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.cdb104d.0","fusion-plugin-universal-events":"0.0.0-canary.cdb104d.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.cdb104d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.cdb104d.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-I5qq8uHUsKB6BbLVXIovFkhRlazLlY+KqGDB1G1j1kMToxcIrm4ac4p9AGTJ5ehyErtJ0pAPmmKfqHkmHCOySA==","shasum":"e7695b8a4b61f2b46c31542c73ae0bafd1e2d8c8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.cdb104d.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeL394CRA9TVsSAnZWagAAgDEP/0BSTLVQZ1aUktOAcZQr\nYh45aC/dyLnhrpup/HsTet4X4Ry1HBvQZpaxoXvBHKA8W7JCP2co/eY69Nzz\ntrc5nOK4Q2ndtAjYJylW+6nrFNtXhgfpl44V1u9c1p4sZdAvacEFIZtVO21I\n1ITvyhWsjy7EIS36gRzBn1GThQrmAt4O1IxTV3mqSQEKdkeWLAfR2JU2RkHw\nrZr7Vnj99BD6BWMU9nS9xOGuqyF0P7Y+MRt4SqHIO80RunX2jny6gxa3ZF5m\n4MZhSfRsHZv/EBkeqBRIRvo8mvn4VQ32jKJQLc3ZCpwlUX5768G7fnaHdDh9\nNDQRYmBzz7gbCZucW607Aet/aeRU4XKHXK3nEM5fAVc9QQG4DogMoQeOdSZV\nL0PWgxO2UIpjpbhwXd7r9/dXJSfIkele+1/ZYwYfaHpwry5ijGSH6X0n0Apc\nr27hA7nlGo0VagpwJkIn6XIMG7gHex/211vMFcLITZhjTgknMlpspkZrR5gV\nn6nx26KX2V86tpT60Jp6agPihTiT7jF2VR8a5fDa6TR1WVrkYIyz8NerxbxX\nBZZxzvVqKNOXwVF+lTJQIJxxSM/jq8nboDKG8x/2/ruq8wY2PkPzsXJZHSsB\nnFC2OGMareAI6zI/0kD7T+in5Fx/mwaOHr3ilSCxy8AzKBoHdXbj391hoMMa\nOssL\r\n=JRE4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC82uTQPlECzsuQGDjZPqgiBfqt2yUtTk+9Les/Xsn1KQIhAMB/de+9+wUdxTXKiKwiYsbSwgN01HdoyjDoTMwDILLe"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.cdb104d.0_1580171128023_0.0950482908458068"},"_hasShrinkwrap":false},"0.0.0-canary.1db323f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1db323f.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.1db323f.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.1db323f.0","fusion-plugin-react-redux":"0.0.0-canary.1db323f.0","fusion-plugin-universal-events":"0.0.0-canary.1db323f.0","fusion-test-utils":"0.0.0-canary.1db323f.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.1db323f.0","fusion-plugin-universal-events":"0.0.0-canary.1db323f.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1db323f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1db323f.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-WPSvofKrrQuNjEgPyGQCUtBZE+ANcXYPaWkQALxXLOidcFE1BRwIAY0FpqCT+9CBI7/1oPpGZezQlaCEbMf4qw==","shasum":"9b127a94d52b8d89047ce426c9e9b4f53cb29bd9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1db323f.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeL4PMCRA9TVsSAnZWagAAQBMQAJ0CR1xpzTJUutOBqfW/\nwaVEAY2WgXC6TT5N3ZmjgNshSZLK+bRHaqktyM6Awi5n8Z25YefoW3jJ0Sse\nVpVLkR5cyN8KoR72bSOmDNB/PSJi05YtWnmb8pbS3twNhNSkEm/kiscrNaA3\nfuk9Ex/wKbhnLnAOyobMD/dGuSi9lsWeP9cDqSNPJGZyRcexLCs7qNd6lD47\n5BKKOT6xLODXBalc5lWH74DrGP+AdT8G/vKdIIXd6Y+ilBgrn24AX2Zl+JWH\n4kTpNmZRpQJ4/bMQR29bJ15jjXhj2h3ZFM0U+UvQBOyu5Hv5jIlNjXyDNsZ6\ntxokTmWwzM7jClZD4bM9shZMPtnYIrT+xEXTMpI7KS+vW6A8UdL2z/oDc+kQ\n40GElEVT/1bRrIS+dSX4po3M4pnDmEllGxiEF8XUV4yMk+kuCo50470Kge6x\np5o6FksKmTs5pOUPTIY/TFS7sDqCFK4L0O67nMYBCjPVNGlckka+xRg+bQor\nJQ4Z7KOJPXHk4MMH7bl6U1hkDl5Am3Geg4co8e+oZHUtU3j2nQaApXh2gW6p\nHT6pMU/TrhgvQFvyuH1IA7vWCtcpkK06yH0Q2Q+9lRUJJMICZxP5TIPQutLI\nJXvCQ7T/HPi34GqhzLxnWGP04SgLXBIBSlr66BtomP1H7vhcSHcPtJJeS4Ys\n1h2I\r\n=BbjD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICPXlqKdz++1OrWbhHRHVEl8OLjxyXq7CvitSOyMEtX+AiBrTdpy/2YvLCV1eDWhdBz6ifYIiIuTi7VJw6OxyThXJw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1db323f.0_1580172235785_0.40275840283050446"},"_hasShrinkwrap":false},"0.0.0-canary.aaaf2fa.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.aaaf2fa.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.aaaf2fa.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.aaaf2fa.0","fusion-plugin-react-redux":"0.0.0-canary.aaaf2fa.0","fusion-plugin-universal-events":"0.0.0-canary.aaaf2fa.0","fusion-test-utils":"0.0.0-canary.aaaf2fa.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.aaaf2fa.0","fusion-plugin-universal-events":"0.0.0-canary.aaaf2fa.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.aaaf2fa.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.aaaf2fa.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Y/mNRwwLfrENdfwMOLCZde8Y54NmNZemH4FoN2Ys8woSXh9AvBEdNahwvAOQcU7mHv4GlWSWNH9Im3xCAJ8SfQ==","shasum":"8a951c44b6cc4346b3d892f1b0e2f5e5f0473f0b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.aaaf2fa.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeL5x1CRA9TVsSAnZWagAAS3kP/jos0JFDJxfbT7vApF63\nvGHNviByByEQpa/E+UwOcgQEPb7qNk1BveiGHCtTQlg1l5d/G6o8VRVg6eaB\nCby6L8mT1kEslocz+zvFrvEr5K6qu2Qqejnnl43tIoNZIFKiBKsJyvczMHPW\n4lENgiFwidj1Kd0ok6ptapFOnpGA2iPm0gtR6DKYaMhOvS9WWfD2fdh04LU7\nkmX5VjakLXY0aCousKF3sOVGX9WDf2MUZKV7lg7x/swrjeC484qbI/mwd6yH\ntWfmfFniLRQpSLVD7h42cyLqdan3W3vPBT2kUaA6vs1thrWnYV29bE+WZTWH\n9VTUMXvjsq0lWPienozvtNoJWYLgEt81cDc8UEBxe+UNGRY8JUnXI0pymmcG\n53BpsDDFs9Du0xsMpqvbJb+pywax2HorYBpx9zDS1w0pReOX6drNtlvpBTQi\neTYEaSo7dYEuc5EEDnPHhDjNcB48xjWVWEoH9TpYwHmtF55iFaZ3F0IerUj6\nDe/rh7X1hsibRNES24q9MKnIPCcWLeqkNS95cjyTaRqDNATAgnWUcr36lYKV\nvg65OOHeMGH4tlVgIpXg5uQXLx67kizOwLiHf41kKRYR6MjKeW8dnuuzcRpt\nyvZs3QW82nIXnkZ3/361SR1ug3X2yu0oHq0is42Q6Bb1xO/eI00wnvahdltx\nnTpq\r\n=IRUB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsKnyzN6TRTdKPVWQzaFYuSgONkSHeZ1JR1lF+I+aVjAiEAlP9CDQ7piZ5U0DGU7M97Ae231kEOBX3b19W83ZwT87o="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.aaaf2fa.0_1580178549452_0.12083227369822191"},"_hasShrinkwrap":false},"0.0.0-canary.fed6152.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fed6152.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.fed6152.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.fed6152.0","fusion-plugin-react-redux":"0.0.0-canary.fed6152.0","fusion-plugin-universal-events":"0.0.0-canary.fed6152.0","fusion-test-utils":"0.0.0-canary.fed6152.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.fed6152.0","fusion-plugin-universal-events":"0.0.0-canary.fed6152.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fed6152.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fed6152.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-0SBExMZ8H22NeHY/xwPsSQbeQZhEmCISQt+DqFtzHqIDxSjQ8tyf27HCwK6hqppAIDonsabb4BBbwbTnFe5+oA==","shasum":"d63fad38e9efa7b3bfbe792a9a427a4be8cdb78a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fed6152.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeL+dSCRA9TVsSAnZWagAAV0YP/Aj7bEGYMCkJGPY5PEA4\njB37qhVcqappsGOkHHxi6DXd/hvYDM+YRMROaR92gpBwRhgiJw6YVi28MpcW\nLlvkX8CifKE3XtusLf7B028N9zX5hxrnGkEEv9hgWAgk+l3d/gdrUQxoEO2w\nJiwufurrje879Xh6RQVr5ParDuGqSScDjN4jLtdBoGAAGlcTx/Y8BXHh4xYY\nK1s/2b2ePydJPm9+cnDsUyVRK27t+QOKAjDLRMp7VZ4HFxUBUr1NQKFhU5ls\nTtPLEODrriiIk8M9d48ucCwrKnwkF2zedvusqa/CcDmY6b647MpYexac7ufA\n61k4DqZ6M8L3ltjEut2IBED19TmzxPM3QTmUB2HXmU4sFZgdlgrfoeslHS91\nbE1oUjscreHIbonBE4h6p8WOGYxszr8Tdmf539BUAHVgfuTw2XPVD4Bb2286\n+zc4/06+RIxnpAiDfr4Por97cm9cxmM3hISg7BhJAW9McS9VI5OQtQ99T0GO\npZvAuuBX6I8VUUO7THiEaP3giBO3J4D+4ZsHWqxNw//lJ/KdFRT3+KW1c8GA\nlhoh+KtwviNZaPflWR8DDi1xYMt6/vbiqo7ou4/E0cWGmIVSV9rX2FTvzbcx\nJ10W4vNx/UJYHI0edV+GfxUQMi2Dr8MNklTsR/h9iYLdduurPLn9YYwgQtgt\nGgRo\r\n=mVrz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFAJGBY2zHGVIEp4WPlCAvvKVRIhYFziFnlnTM6DpBB0AiEAyYDYixus9+IVEjVlOKuJcuk6vsn1Mrd6ZLOt+W7KG7I="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fed6152.0_1580197713745_0.598908281190444"},"_hasShrinkwrap":false},"0.0.0-canary.971253d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.971253d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.971253d.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.971253d.0","fusion-plugin-react-redux":"0.0.0-canary.971253d.0","fusion-plugin-universal-events":"0.0.0-canary.971253d.0","fusion-test-utils":"0.0.0-canary.971253d.0","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.971253d.0","fusion-plugin-universal-events":"0.0.0-canary.971253d.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.971253d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.971253d.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-/802tM1tUGBzPUTq2aePzvbZfihx7eJ9srPYfbe2SP83RoF/0X5U6XpTq9u1D4gedxhVk2H8iJgKXR8yJj3rgw==","shasum":"cce35c4d95dc109f87a2ffda7f6b4b78400cf2f9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.971253d.0.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeL+tmCRA9TVsSAnZWagAAh/sP/3lLyB0Qz5dL+x3swHXy\nM4yDcGZi0UIeTj1/K5+IzW0qWnlqFA5SueiXB46pPe3mvtq+Rza7183BYm0O\nwcb32+Md2VAYQXPvFoj2yp2+sUChdgZa4Pe5XbipkNaVRHbuO5iNBel58mQ1\nNjgV8WgEvlmuSD5WuhIQbguEuXPpqarV551DrelD+7Wqrz73MpqmqU7pbKCm\nRvoNyD5/J4z1nOW4/JzESV3SnFEC9xhiUuxrZ/szLlOHU6d+WIdsHp07VoTH\n5iU43wzxCBnQfIQnEWQMfpPDCBIVKRw/7jsu5OtZ7IekvUyaXehr6SynDYVp\neha7BqbwHruIxYfvL7acM9LacYiqtkyTzZosCLVuvszVVGHv5INrUqxzldJG\nV2GCx3rE6Bu6YszZbobHzXjoJ3fd/saEdRZGRkSeSQ87MIK9IVmHLaeav6jD\nKB4HnorHYmEscO3K4k2aP6wteN1DvZmH1qqPFdXGPveXMJc8jhjJ+/gpDUtd\nrQKj9XO5ukaVatnFm7QYybpVzyKXDZyJX+tIXbT8BqsvPNnRcBF/m1DB2Tpn\nv1++qu0QHUgg1BURTieE8Gr+Z95F4tM0E7E0mgYX010bFPDMqvy33xi2Vfyo\nviJEtKV3DbHq1PCuPZrbeLfNgMCND+24R2aSDL2DGJw7enhbelPbGeDs2e87\nssk4\r\n=yx6O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvAIqsNPv2L5Crbvt3QI07Pxw9K/9vjgTzQ+4Y9uPbdAIhAPegWU7ldJBlUqEQk16rw0Nc2uhEmx8OKjhvybfPQ68M"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.971253d.0_1580198757556_0.07533113079770759"},"_hasShrinkwrap":false},"0.0.0-canary.659c743.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.659c743.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist/index.js","module":"./dist/index.es.js","browser":{"./dist/index.js":"./dist/browser.es5.js","./dist/index.es.js":"./dist/browser.es5.es.js"},"es2015":{"./dist/browser.es5.es.js":"./dist/browser.es2015.es.js"},"es2017":{"./dist/browser.es5.es.js":"./dist/browser.es2017.es.js","./dist/browser.es2015.es.js":"./dist/browser.es2017.es.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^3.4.7","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.659c743.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.659c743.1","fusion-plugin-react-redux":"0.0.0-canary.659c743.1","fusion-plugin-universal-events":"0.0.0-canary.659c743.1","fusion-test-utils":"0.0.0-canary.659c743.1","nyc":"^14.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","tape-cup":"^4.7.1","unitest":"^2.1.1","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"rm -rf dist","lint":"eslint .","build-test":"rm -rf dist-tests && cup build-tests","just-test":"unitest --browser=dist-tests/browser.js --node=dist-tests/node.js","test":"npm run build-test && npm run just-test","prepublish":"npm run build","build":"npm run clean && cup build","flow":"flow check"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.659c743.1","fusion-plugin-universal-events":"0.0.0-canary.659c743.1"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.659c743.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.659c743.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-H6FkfNNhokx/UkvnsV1Q5GNlx9smk2U3HJaQEb2MDyA8UZxkqKGSVyOkqJKptHRFBo3wOA4AdPTAVtUgnCYazg==","shasum":"7f0eb06199edae9f2c1c35d9eb3f94eb4d1515b2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.659c743.1.tgz","fileCount":17,"unpackedSize":42210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeL/aZCRA9TVsSAnZWagAAyi4QAJEg4va03XCM4zknWvPo\ncKohhbdzxrgmePdMCey5Iwf48NvKktxXS5ZLy0lbvZhKabVGhcoaR58+kjrB\nbg2+1ToOMLAbVJatK3pcO9J84HWI0vnvBcmuINixLYZV1W7fSy30n/NxGLfx\nEumOKuv/r5WLwysGJg+qmLR8kO8lEOGTWxwey70DPoazSE2kin0baJy6O/Oi\nnJqfStufca2KyHpybt4lprlA5UlD1g5HabRTQ0LDtrm4/B200mzeCyUG/RfV\nsfrXj3A/Z76cwboKC4TGU2RGTHQoEmI6vzVP0UCQqx7zg/JplzQ530XSnD8d\n7Am2diSWY11967YEJ+7G1yiABQHxRncbBPmDbxzQNBkVTUlWWosmjkvGORFp\nNIH2xjTgeEZlEWre+Q9hH2nrrPRuRBisIQ9e/4hjLJ2Kst6oMkOKJcl7/kmQ\nXLiZq2I0ezT8R3C5vjLIVdUyw4zm/IF3CfCyOjegKeXDtaU63zhKQYiBePW9\nHWGxoV94NU6G9VjjxIbCUmGRyEljFQZ9iIrci2UrFd5UitvvKr/qNC4sVepg\nm44WHyQJ1bVUWVmYEkpAVS43E30oCOvhfWTAGALn/lIliGdc8TdKPGbAdHuw\nnSMsGW3UKz0815NeQrqkq8KDN++gKI1TL8jowgI/SjEa5YEFX7CpikN32/G0\nfUgM\r\n=VZy+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNKddxujOrtivbwgTpyvz50f99biPFG7Kof0nEQq23xQIgaWXEAgJF9PMoeypvayAZdYrY2Binb6Bh0c9YL1QzZjs="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.659c743.1_1580201625020_0.6380691147501389"},"_hasShrinkwrap":false},"0.0.0-canary.dcf8c03.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.dcf8c03.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.dcf8c03.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.dcf8c03.1","fusion-plugin-react-redux":"0.0.0-canary.dcf8c03.1","fusion-plugin-universal-events":"0.0.0-canary.dcf8c03.1","fusion-test-utils":"0.0.0-canary.dcf8c03.1","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.dcf8c03.1","fusion-plugin-universal-events":"0.0.0-canary.dcf8c03.1"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.dcf8c03.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.dcf8c03.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-uZ5Dk1N97f+IcO6dCrs4ZO7Iv1UQMUPuIC6v/ZpvDoJe1ygso7ZazOV/eDKSiT0aM4J5Xea32IN+MdYwe1ZYGw==","shasum":"d2eb77f356700a6b72e4f6800c176db2b96c3be1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.dcf8c03.1.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeML35CRA9TVsSAnZWagAAIdAP/2uIB0Z/cliVTPk4l7lN\nCtFMxoC8LMPLZzSN/3nAPsjEt6EscyR+Dm3QTsADLk420JfM0LtFBg959oPI\n/ecGBxLKThQ7c/kKm4tU6SKIqncLlAKepXIyoSVUUqyM5d0VIxdpjvbVIGrU\n22pYx4S1MdDnB7Xaj3gq82mIT8rmAXdjmfPOFUrwSDg+TUZKMSjjOGDsEjz/\nEJWfKSbO2A/mCFm06HtZ05/S/tIhmiM9FhoOmHzdSI5dfOquyKqvrpQdPg4m\npWGfbdI8uZH+TcufYc+C5mffqUCpcDRE0oVlicS9jvCW8h5alwq2B2p7xa+p\nJFSUdVfkWyTgP61+d7D11dnBqJ4+i3CIPwvgYiwc8RH98poAuvxTktMgraiY\nipjrs2GbPjMbGJjTXrMsW2cOfq800LVN1T7dLYk93fdIf1CzvGZIMJWlI/95\nOlWjU3wjq5pY7U2Lhgi4lOWVx63yKoQiE6HKZEPtcK3v+YjyPlDPoSwGAzjT\nevuLx+mNwOG/p9mmDuWXF5iia9idrJBzl4LNoqAlBe+pGOkTQtqJR53+lFtE\ngpbixH/h+dP3jhXs+UL29BG8weO/peXL7KlAaLpKb2g9vF9LzVFMUvUClcvx\nfFjAX8ZQKSNfe23NqDGyBSCntsT594VBLCmjnfrinQ/XCGm/PLNwJUl7udPM\n1xv8\r\n=2/Kl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHm1B0AjrbkEpRLkIWU4aJhCPY+V5FHQRgXQyU6KsYl4AiEA+iLkL0VR/Ejcsw3LUOiscxLK6dLlP0ZqvN+bmIx8ITU="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.dcf8c03.1_1580252664499_0.5202591122780318"},"_hasShrinkwrap":false},"0.0.0-canary.4fc2099.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4fc2099.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.4fc2099.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4fc2099.0","fusion-plugin-react-redux":"0.0.0-canary.4fc2099.0","fusion-plugin-universal-events":"0.0.0-canary.4fc2099.0","fusion-test-utils":"0.0.0-canary.4fc2099.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.4fc2099.0","fusion-plugin-universal-events":"0.0.0-canary.4fc2099.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4fc2099.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4fc2099.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Gqu1ZXA7HnbeYAheyqdJtYYwU7DchvXhki3BTnrYReYxN6I/7Jm1zp/FkbA/jSom51l02p8anCeWK/rEoJs44Q==","shasum":"574a24ac6957800e0bca72d0c93338dfdcb87335","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4fc2099.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMSTrCRA9TVsSAnZWagAAd0wP/iCPvjY8UUmLlFFEjk/s\nS1sfpdVowx4Mbh0YCvhjTU8K42Cj5vKFpCiHnZ3hT6uvqjP0H4pAnHbxRbgU\nGr6TaCh8cQeyxl4DHu21n3e3npcdjD7nNWT9CjzzPSKDAaj4+LPMHFqxAmdC\npvE8dVq4fg0zZlhybYFYApyfNBlMIn++VT6dGOH7hC6oilDXX6wlil5xkbF1\nukZRnOGSwrJ0ctPVpLKMJayNO9ZFZOnSv7lXV+Np3w6NhaYHS6yh6emo6lEX\n9lG44gB9t4f50B71sGczCAbqDb8XHlrq2qnPKfN8EmLJoxozLpA+vQyrZfC+\nt0syn+6jEdJ+VwbPrl7Pl3xBrIcGJYfWrXixdZQtQe61fFQIyvwnkV3WyEeS\nHiBsbcm9xyUJWGi9cPNn+XMay05R4hzZcFu0LbcHmFt6AkAiZkZLJkk7Qh/e\nKNvqCAoqfquuybx5hqdWqcyVUbU9xFDoweJePuu0o1CSVDUjCw+NIpzF9PP0\nA+J1KkZc3WnpITzmFcfa6ieHFYN8pyv2lSHw2gIFBW2Jl/lZr8+Ze/TEOZoD\nkbbMbb7HqDjuhXxo7K9KIQGgiIM12BND5OIpXOohspLQZRY3ctCn1QKydqha\nR4VDEJgoK8Wh2EOiC4ahzuaCOQbLRBE+WLCyet8Hyn2t65Kjs3/RKOLl7Uy4\nnNE3\r\n=guw1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFK2q4xigrD3UGBb8q6dvWifUArhyObIzFXgB+8Scq+AIhANztgPRuS8MBhhzCXgLJLM76rfBvJYGN7LZ6YrroC3La"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4fc2099.0_1580279019325_0.14407028190052107"},"_hasShrinkwrap":false},"0.0.0-canary.2917daa.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2917daa.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.2917daa.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2917daa.0","fusion-plugin-react-redux":"0.0.0-canary.2917daa.0","fusion-plugin-universal-events":"0.0.0-canary.2917daa.0","fusion-test-utils":"0.0.0-canary.2917daa.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2917daa.0","fusion-plugin-universal-events":"0.0.0-canary.2917daa.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2917daa.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2917daa.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-ApxCOxaCYWf2mgnlKvYZX9LIDDK8HZ0ipV2nAEi7WyIEIGdwmTUSYfuL7bV7+zIyN9rZbrCmVj6roK8w0BFQ/g==","shasum":"4025cb44d81b66c990d297ed4f058d9733a571bb","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2917daa.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMcdRCRA9TVsSAnZWagAAo3IP+QD4biznE4LNNhyHxLFa\nhxT8/mTB/S2C2PX4FUhXbycINLgAAnoCH91ya/vNyn/+RAZzRDiu7D06ScLQ\nDco4Bu8eQDPJXWBe2hmyO6Kmn72X0IVQ75M8ZWqdWNHXaMpPF86Ya+V7kpcH\nxGYot1sbb85+WgqDug2xuGGezgrlAwzKwr1AnsMEz7WBAKnjxxW37VKVHTM4\ntWFzy7wamLiJviSd7hvj0RCbylf08oE1ceEFroJDfA/LMhsotvP5wGF5X300\nOw7I4YefAsLL/tUxFcGkePWjv8d8nPy+VKBP9LhSUzc8SX/TmxuZ1OfglEH6\nYCbRUYVPvUQSaL4AY33SB8YuA7toUYMQzeSSuF7pufwCjy7Xja95hLaLtbjs\nzXY2YDQSCXQKZxZqPa97mdKY/1HlkTcuaochQwttwicAW6VrgYb6KpBLpbW1\ndbv1PFkBPYKm+40jK97CDGlWoG0g7ogauko9oI8cMgg6vZX9pM/1fXH1CWDj\nTo0w5u6LuaOi9RwwAMa6vrgr0nlCvUwbTAJ1W/Rhj+gO0scvPmvT79Ts8Ubx\nSIX+RfZh916+lZ+o32+5LnPh82fn17W3xiCEzyLcc5HC4orEPUpUddQlQ47e\nzOt62V3AlbNPgBNHJEa0gJpHzPa1WZYwMsl6jd0QEZyE9tY71E/t3MP5h2JS\noCNp\r\n=lUmF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAXBg/8m1gdp3pRHL2ypQu1lu0yFSCv89Ub8k6v9ik8kAiEAsimmj+vwWan6gwedn7tMasxZsZkT235zfwSzOeYKSQk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2917daa.0_1580320593179_0.1087452258843995"},"_hasShrinkwrap":false},"3.1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"6.1.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"2.1.0","fusion-plugin-react-redux":"2.1.0","fusion-plugin-universal-events":"2.1.0","fusion-test-utils":"2.1.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.1.0","fusion-plugin-universal-events":"2.1.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.0.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-NMWhBUJsWTsplIBOGWhZn93OsUz3/pv6r4C5+H7nHKrnXErUmVqFFNYns+nB4Q/GXMeWFHDntqQ8I9STXGneKA==","shasum":"ecbe5725afa901680fa542c01024b11a62631b06","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.0.tgz","fileCount":26,"unpackedSize":140932,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMeKTCRA9TVsSAnZWagAAlfAQAKOlWP6FJNK0+JaNZLGs\nTsoK0FDzWGEASlaCC7NRbigLichcgGGLhSiZKYzUD7c23AAqT2lxzYR5Sjtr\nxunTMxbtJQYCBp6EZgxQK+ZNLhGnJ6Jw7rnlU3KkE7lXE8epmfnsqaYRgr/U\nwJ4G+n+Td2SvvdM4KaX3oBsj72/NfhTejyqbAWJ2SYEU8wtqKcAOHo+9McDV\nG2lQX24jgKuDTxVuTJnKfHlbXf0U01h7Ye0Db3QhAJmffro28J/Ib9qLZacy\nwu/0Nwlk7/WvCuxPVoHq0x+o6gSR8FhpVP4iOHhml2fSa6ZKTNwIC8hkj6ww\nyrtSTHdECQUx29qFOojlngDDqdRDBEMO1CApnsjXHeTWyp10Ic49iwwN6Yro\n83ddKQ+gCpr7fy7EmxZP5TpZKoILarOqgF3yKowe740MTIbp09jhF8ZL/f0a\nedCQ09NtIsxIcnR1L1mGvUB5ytD7T7ryyWY/ME1YWYYx6AQdhAan3Ic1SGqH\nA2V/LTl3Y+U7VgbD9V8dzWimbhWPWtlqDcgxc87Li1TtH1FqRgm+DgmzbmWt\nwzOwBKf/rdCR70dVYb9ZjqXwQxPvNXvYHWpDaGB29DEvlmMZRFC0niiyEC1j\n8BdIFcpZYJtA7AZ0PiuZ/VsKebvBRSGsYG5VOSoBq1lyT7EWfZiG4Wc5Lo4W\n1EB/\r\n=CvSD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG1aWmbuUM7TJ2GnwSRalS7VC60oDzfUIWjTzapTO9v1AiEAjUeZf7isMu2P+5wrk+C03Uqpss19T3/3XhusN8TF0wY="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.0_1580327570449_0.06761685599817513"},"_hasShrinkwrap":false},"0.0.0-canary.97698d3.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.97698d3.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.97698d3.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.97698d3.0","fusion-plugin-react-redux":"0.0.0-canary.97698d3.0","fusion-plugin-universal-events":"0.0.0-canary.97698d3.0","fusion-test-utils":"0.0.0-canary.97698d3.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.97698d3.0","fusion-plugin-universal-events":"0.0.0-canary.97698d3.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.97698d3.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.97698d3.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-e9cl02sf6o7Xiu4q3iEcWZOVC0BfJpIe2/2l+8SuhVM66Z8aJXsfn+vl+M7l0Qk8Fx4Czl9Z0+WxkNbkLKKJPA==","shasum":"8a2fa5bef282bd4f1a85a64c9cb88e4f26d6121a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.97698d3.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMgYXCRA9TVsSAnZWagAAfXAQAJ/xOTUhPvTMZfluc8Xd\ncW28S20ya7fBXp77b9OEVdHHwlejFjfDxvc4yU1s/G/iRy+gFjVtVX1oqfqa\nr2LiFIbipU7zcAPI3mwdMYzkNb3gx/yH5vlbK0mgjZ/Be5wCXVI9HlXYQMh+\novNxBZm56ep23T1+WB3HUk6/SdRrhJ4yZyB3+wE2EfeN/ugQNJVpiXkd8aQm\nJxj8o2fqDWe6x9waq0a1kz90vWwcTf8Oy44rdGOLGjU2u9/40Ag7165k+Eia\nuvPdYhBWMUOwLeLwIK4yicUYuCeglkmoZysKTjui96agKuyXiDK4u5WS/5jx\nIjBhoAShTpNz9EfNg4fIrkLcNANBtV15PdSk9VFniwXeL47qm1i/0XbDi3uc\nPbLJ+GjJJt2TGoWLAPo3/hMWSW4gwqumC/n/yvopPZn9AT4FYkEyUUW/u/Kg\n2S4kB3MYo+NX6oQSVAuzRvwQbBdgfxKPP/NE50g1/qDjJn+CUV4G6gyqaHkJ\nprJkwOWdJ0BJe7viIWsE71aut4a96Qol40iEOKZq6lXdcK8aObdnzm92dMsT\nGYAIioPijBDaPcmaK2xLK8z8HltzBpQjLcO4ye2Ju5bNkA4/6wPBjffrOrL7\nC+jSX3JQvQl70vojgfNxcgL9mq3Z7sJOH4x9LGviHxRNS5XUGR/zIw8B65gK\n/GFI\r\n=x1y6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxV+5PGvT1W18aDZQ1lRjdJKQFMqJ9os9a2Sf9ulyY8AIgRNc+BKWQIs6PfyUd3bRZbJQyeeqaJwv7rjRqJedNPuA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.97698d3.0_1580336662565_0.7535862957668702"},"_hasShrinkwrap":false},"0.0.0-canary.69bc71d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.69bc71d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.69bc71d.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.69bc71d.0","fusion-plugin-react-redux":"0.0.0-canary.69bc71d.0","fusion-plugin-universal-events":"0.0.0-canary.69bc71d.0","fusion-test-utils":"0.0.0-canary.69bc71d.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.69bc71d.0","fusion-plugin-universal-events":"0.0.0-canary.69bc71d.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69bc71d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.69bc71d.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-RkBhPNxnfshNcfPjzYbJAxUYTyhu49Lf+IDtKtNKMK6HAzrNUepE+5p3MfDrdtboP/VdsnQxUzzhE4XukKO0iQ==","shasum":"ed67ef46c92dac60cdf52ba41e0960cabb4c7be6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69bc71d.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeM5iMCRA9TVsSAnZWagAAh40P/3tg+F4LWpZMwMrI60D/\nM6v8vz+0kGg8G3dNdwHF4E/RippKXMH70TDkHnOlm0OIRSF8BYdhbeZtog9J\npt7cmuN8flYeVtYreup5TzX5hT5QgYg3gArG5tvmW173YlocO19UATg0LjQj\nN7RbboNnU2NeCyx3IrzSxMl7koHpBqB3+73llsoaj5tbiAKW4D1AzDRCVi6V\nRPnh7MjtlxigpYeyLLRaezyZbLadtiSQ7ZnH3+3gc/qEKnnVzLT0ProuoPZp\nh9E5Ffzf7UV/jL/9rhpl6ujadMdMo2F+yDRtUmEooUclFdcaBOGvfLGnN08B\n3jkeugutPhBls8mlDnH+0qOb9j31kgFeZg8SExSWfUAV2MKex/1yWUUU+kKg\nTai0xBGMfU6KHSqvCPjaeHCCZhgK+v1jgov7VT29/SpKqWdPxyzeMYgfQ/f5\nq4paB7EM3BcAC6LGi30Jf3ZsBt2UMgJbGcMjtfgHm3CMJb2WTnVfozOkl0Co\nYQITE1gAvV3Zq+nItOq8fhXvsXfwgyVL5F4LTNjERLet9i5mtIn0b6cSu4iG\nXrdQ9TCUgFQzy1BWdFPkTtzw/ZcnUx9RI5W6kE6b5yVvX9H10bKLlyiXvHsS\nxFHewCbRlLLhyXtFCTDavjMQcyvhtPjVRYunh4fEAq129TedidHv15rNjbnv\naRQw\r\n=5Cdk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID+quJOxliMKOlCkRNDRrfcA/vi9E6J960521JBUejG/AiAxYQBx/lE6Uekro/pEDkoPVpphyEgfFvXZGLnqLnI1QQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.69bc71d.0_1580439691711_0.36657030205992025"},"_hasShrinkwrap":false},"0.0.0-canary.fa2f39f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fa2f39f.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.fa2f39f.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.fa2f39f.0","fusion-plugin-react-redux":"0.0.0-canary.fa2f39f.0","fusion-plugin-universal-events":"0.0.0-canary.fa2f39f.0","fusion-test-utils":"0.0.0-canary.fa2f39f.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.fa2f39f.0","fusion-plugin-universal-events":"0.0.0-canary.fa2f39f.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fa2f39f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fa2f39f.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-NJxI1AlkVdDzFBeyM3qOorFIGfzGX6DdpZeyxXKZv7iB4W0H8NIiAW6Gld0G8h/WT2V5Z+4FQCvCuxVmwGJHNw==","shasum":"301728a37f2c18ed2d571932d41ca506bf165358","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fa2f39f.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNH47CRA9TVsSAnZWagAANa8QAI2ZMomyx/c2z8IXo+dM\nVdBHVTCa35HGJ8IhnNxxjgo988OO6OG3KH6PNtPUOiX2t47S5ZsdA5PYZ7i1\neR0epWr6Tq+4b9c40ToT/Nw6R7IFmduEah7BXz3/snFUjSzIsiKxTqT5VY8G\n/CKuBCJoXveKCxPKTEbivvIsJ/MybIYxkvq7HDoLY9Kb2VXqlYLxBJS0b/+0\nQW4qJWQvgF535XtdM34sWyoBSP5cU7PB3Nk+VqbPmr2t6dmCUIPC9dtjfoPb\nV96ixR2HsmJqguO4ZFqZPsbwsskqTq3F8wxAhV+1jBisJrFuxTFS7rUXenZS\nnIqDpmv9+I43pCDLJChG7zw57QpN7cQayTw67uJc9nZo07Mq2BwXCkA87/ij\nrp/T6552eKr8UQFXDqa2GiZhS0HwY8S+XZjjxGYXVKXwi42oHpUbLo4JoHqq\nboiAdak2g8wDq+T5XDsm0Kv9/ca5SBOr35rEmix9IPBHTmc69Bhd35AxbKqx\nNQJxS95ohAabfLb2ErMFPyG7av6MhGizAyQ7VfGnUAT2XYO0WzpE/iofTxzl\nBeOCcFtDb7zh+8EdZas4XherUEXn4OeykYJwNKjeHTxKvM+CnJ4qUngTKUe3\n9ki/91A0FA6OqPb/gg/yOFxLeDquz6jXoT8WLtdvEO53mD4GJoHRWipUNIOU\nSWwp\r\n=Y28D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvYsim52fJsg2Y5LkrYCECe94LR95JVoYZXbOwQOw1fgIgU2mWC7AGg4GhtacrBCZhNCeekJfqvm3q2LDRIkOUIo4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fa2f39f.0_1580498490681_0.5621696846560187"},"_hasShrinkwrap":false},"0.0.0-canary.1d3504b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1d3504b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.1d3504b.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.1d3504b.0","fusion-plugin-react-redux":"0.0.0-canary.1d3504b.0","fusion-plugin-universal-events":"0.0.0-canary.1d3504b.0","fusion-test-utils":"0.0.0-canary.1d3504b.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.1d3504b.0","fusion-plugin-universal-events":"0.0.0-canary.1d3504b.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1d3504b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1d3504b.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-a8UO7ONtYoYtNe32e4CqkoGBEafOzI+ApzOojbXXYvtWdi9csAA/gBEwx4od8VDC6kBK96seEQIhzWiEm5Hqhg==","shasum":"0cb5e29cf885b429c3763479d895bd34aaa0d84e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1d3504b.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNKNVCRA9TVsSAnZWagAAB04P/3cPuzLNlNyHUCaU1yJf\nTgtRDKcZdNVNIdMEuRK3DSGUAZUhCTVY/cwgJ3hTU7XiOc3fWMOrv6lqD8Xc\nhD53zx5OJ3ALVt0koq70N4T9ofKp+WiP5/RRt3g1wQVSvg3S1GGhiui6v8ta\nQDHLWJnRu2jap9iogD+pcsV4/ULu7rKei0hwR2hiXlEQjvLzop5IpKn0xKCp\nyD7+iNOdVFrVwRU4nTcOfjIkSiqGRgM9L1xvjDZRGttNvNIpv2oxVF0m7vA/\nkirwEiESrB/bnFJWFVnP3Tz4E/qcXPVJibZWPUA3G22Y5xTt8i4/xYd6HdpM\n9igl3kW3UMvu+pO7/EWxrmbLl8o4XwQaNiaJZt+j17bQuLG/gAjOj+iyhttR\nqeor66ZzSCYXd4c3hirI1qTphXZyXAkOXl5T/5NwWN8AT5M0MUTChJLCh72L\nU4F6wKPur17kxpB2SmVIftEkVs98O+bb4c/g1lAS331wIjImfTxxKizgby7m\nvp2yq4OvK1C4+9R56hwxM92o1l+2uil8Z1HmCylhBh97+anaVB7Clxsves10\n8BirX/wKYRZLKtfzFpcBnrr1QVLuYWx29yNbVZo7Y8O+laRakyco8BjtmZKs\nLrDyIshcI6VXQBznuMqby8b8G96MoC9nV4b43jFWcXX7SHPRSf9r+TJ8c82i\n9dzP\r\n=xc6R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICpqk3E9syrDhdDuoXMqAjTCG9iObssL92nX6ttZYvGAAiEA2HSDsuNNw29CH5UsKbJhBsl8XrdBCGXKTWLA1QnC7mM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1d3504b.0_1580507989447_0.9705444413242759"},"_hasShrinkwrap":false},"0.0.0-canary.2effc34.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2effc34.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.2effc34.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2effc34.0","fusion-plugin-react-redux":"0.0.0-canary.2effc34.0","fusion-plugin-universal-events":"0.0.0-canary.2effc34.0","fusion-test-utils":"0.0.0-canary.2effc34.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2effc34.0","fusion-plugin-universal-events":"0.0.0-canary.2effc34.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2effc34.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2effc34.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-a4A2GWuGW5uzm15Fz8fU3wWXnJS2c0T/vgrBRSsEinYQEEhV216+q1Rga0o2woS2/rpxwQ1JZb50auGQ4wrV6A==","shasum":"18668c6a839f8879f40714a22152371c3563c9ee","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2effc34.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNK2ZCRA9TVsSAnZWagAAmlAP/jXADcotNgGKCEhJ4ZII\n9YQBGGX4LEa118SnBvEBEK7NHscaTIfbRpbdE2w8YNNpO22qIuNbotqe/1IW\nfxfS70n5IqANh6i3g1S/RiyRzDh4sVbwhMxKQ8Vc3dOmlF7y2pxGKFitBlQD\ntIASNHOdgwpcFYsCpM4iRMl955gkmXAuo2F4Zl7Sg/Di36YfyoYM/7UOoGpz\noKTLFCJkFKGf61lg0yKzP1NeSgWpM9xSy0s2FRL/nSirI+1PHacgWO1gA9lE\nswOm6re3kIIfg4WHQQt/PhTf4pyvmbsG6ygSPtDy3crj8ZOIXWrov/6cbWwg\nLsVrFakLWKsIAkv4GgNOTxVhu6xWHjpcP8xuG7Pc/LUqKDnF6f0czM9Kgcx2\nCC9VNzZRKSoojyMcvXW7JC/pHZ0UC0YylgBbyCfAmc3kppsF47MsM9ewFimg\nuis/+dIif029ozhKJ/ao7K8S4PvDaf0NkaepsXvAYs+xDzRSEmWmqfLcloRI\nLBnzJiFrLkwL8RcWJC4HiuaL1/YEyL3KCNvcI2QU4Xp7bwBfikNUKm8nViyf\nwRK3PydpT41ZZRcLZ6hZ3uhp7mYqX57UHgCHCRNZkAivaXoJ4Ol9rzhgtPDP\n6bQI9m1/cre+OldlyUIqoPyWoDN3knA567tEUwL/JvL4kG784ko5ZVnpDwis\nvh7G\r\n=tdkU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEkQzMyM5wJsfxVwBBKpEfZtTAR4Cpzb6+SFlmpnGgq6AiEA0RXdpe6MtOBdX1ITSvbIkgEjAeuDQdmDQ7YCIiwfMmk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2effc34.0_1580510616613_0.07588487091143836"},"_hasShrinkwrap":false},"0.0.0-canary.deed5b0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.deed5b0.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.deed5b0.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.deed5b0.0","fusion-plugin-react-redux":"0.0.0-canary.deed5b0.0","fusion-plugin-universal-events":"0.0.0-canary.deed5b0.0","fusion-test-utils":"0.0.0-canary.deed5b0.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.deed5b0.0","fusion-plugin-universal-events":"0.0.0-canary.deed5b0.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.deed5b0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.deed5b0.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-ml6k0j7ixk/EtukU//3t3XW3O9rje8agodAtxi2QXGY+XnbHDIA1ZdnpREhwG4qWsFNU3TkC2okw29TYlB2qKw==","shasum":"6b19d8192d5a7a472cfe177c3ca64dd935f061a5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.deed5b0.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeNN/MCRA9TVsSAnZWagAA85cQAJ+21dzRLuNfOSUAhylJ\nsFXO1fImi/mZQZxFlwfENQBtT8GvpnUdQ09c3SPbzbeB1xYzdCTmSqCe2OO0\nyOJwkZwwDQSBqd2gjQu1LbjcVv1e1Rd+XIK0l53eda7C2e3uAH/6GVjHfE4A\nQvqiAmciQwSf/VU7NLhweyWMvxjy+TFA+2STAgXv2jKcDOgSOBgfyLaxIp75\n7QFu56wdyV78yKzfabX2wYT4EuagHfpMHHxApvHruXYNcb1uGQt5FM25j1pO\ns5mJtPns1mYmtLhRoNDCRQKm3euZnyvd4mUU2VvlaWhS9x5/WiM3gf8adhuM\nFNfuUNovyQh5lAdaKxqTm6+aXVAAhf5ku6uF80LNy/n2GL99xU93eTNSshPl\noo9A/1P0he62goqZXh9HLKx2EOw5vt5S9iTS2ghFUozLu1XmKXrexd1mVT9r\neL2sF9hF3pdj8l7FaULBs/8uy/K6Qv6l7nK/JPskYRKm0SGfIkKTMu8Wi6hY\nMz9iN+Yb44yfLCMO4WFLTlNMcAF2Mz8LSlt5tsAGMwFRslooApK35FOky2fa\nbtF23ivwN81eSrkZ2YrBKq2kqbgdBUl7NJHV8aMcK1BzWRHjdwTf9CxdnQj0\nXNfoSn7O/LGTTdut5YS4bDyu+TSaNwWjQeWlSZPcG6fByTmDD2mYFy9gsCDJ\n9Vq/\r\n=7L+z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEeRd7Mp9fZzOpIVHdXPIj84RF7OfI/EytmkIR6iKvZ7AiEAhvSX/qECHmZkBA55z6zHVphWo93+soCzBUCOwM7XHz4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.deed5b0.0_1580523467921_0.6248925400727592"},"_hasShrinkwrap":false},"0.0.0-canary.3088ca8.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3088ca8.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.3088ca8.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.3088ca8.0","fusion-plugin-react-redux":"0.0.0-canary.3088ca8.0","fusion-plugin-universal-events":"0.0.0-canary.3088ca8.0","fusion-test-utils":"0.0.0-canary.3088ca8.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3088ca8.0","fusion-plugin-universal-events":"0.0.0-canary.3088ca8.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3088ca8.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3088ca8.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-PSATdEViu7W239p98laV1hLJYUS9+qIjLIDH1Ugbl6o9uQLPFvJSV/EfBreXqAO9OokyWOYEIKzfr9I6J4bxRg==","shasum":"7b7de67d8d6efb40bcbd6195337f0a08f193c965","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3088ca8.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOIzMCRA9TVsSAnZWagAAXGIP+QAEnkGvekQKXYRSTors\ncJjqp2tg6b1ZzocO2RhG0hX83EByCgIQCkOZvZQ+D0tcHGPxfKjVGWaW0Oz9\nGuiwingXEr322lxhE/UpVmG1tg+fEqPYv+TTp5te8nyqJJEjtsxCtrxLigJ1\nPMLnrr185Wkw9oscFs504kQX81Z8LBtpnrXWsx9f5PY78YI+21HTNNWrlEAV\nizjTBzo5GbF8ZEuFRFuIyKJON5zZch/2FnGaZ/3cMQy5Th7shnJgPrIxs6xZ\nm78OHVMD6ifuGcVIB8feWv0jSfaSEVSP1tjYffPprI1WkeIcjI2867Xx/e4U\naMGzVyRUuRYVq8raIIOFilDABpZNL1E+Usm6aZ3kAAIps0PttW2qs6Ei+znl\nFNwjwyd6Gk26Du0p1p8wOfLwVAdr2u5zNRJfMAIRrs1wuF5QAdWSy3R88HZu\nURr3t6qkl/9c6ZaTnlH4NvcQwZnrW122Oiiz2nUe7WDCphvkDUsdkjTaw9db\nVn3rQP4Euww4cOFxrxarsj9rAkTHP7sdOp6X+m1Z7Mjm8Zv8ypPy9uY5f6y7\n5L9mKj4KOUbQx/4LLBN9HuqPkdznrqxLsaqkAzmyuCzuliTg6gsFfzPJORHy\ncB9c5Yxs/eLBw49TS3hRqoTlSHI4qPnPRuikzyezvlGZrbNJEAxIsM5qgrqV\nfVS8\r\n=uKTB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBCzfdfIpGCkvFwoyxHxhK9+uz9cUCkKkUM4QlsdqMqAiAkNyoVcrhtGIgDtPTRdZ2hOQ9UEXXer92yLV6VoBiLpQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3088ca8.0_1580764364261_0.3523945224771794"},"_hasShrinkwrap":false},"0.0.0-canary.9a71266.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9a71266.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.9a71266.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9a71266.0","fusion-plugin-react-redux":"0.0.0-canary.9a71266.0","fusion-plugin-universal-events":"0.0.0-canary.9a71266.0","fusion-test-utils":"0.0.0-canary.9a71266.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9a71266.0","fusion-plugin-universal-events":"0.0.0-canary.9a71266.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9a71266.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9a71266.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-0iC5OlIAawKlB8QE5RD6L2ovXsc7lbdMkCbWE8HAMV6zq++GldtH1VDBUj0K2ut1sN6YyOo26DOLIHp8vYB6fg==","shasum":"94f18fc8b1490305344dc4f0ca681054e859f82f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9a71266.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOI6RCRA9TVsSAnZWagAAlcgP/2Iswg6bFofOBIIvS8ve\n5KEGX+BXQ3862WfiAinJ+ESbjzPxFyBVdPq96oSBSYkEeDBT5vuPmeg3DhzU\n0TBNTg3niMcRzcT5aDI3yoEYvwJO5v96GGh+mtV5IzDbOYko8PGZPgpAJl6E\nNSSh8q+bmxNawLpLYFKoLhGiqzFQfKAVsRtDtV0diuxXnQ6vpQbvdW9TGJdO\ngG3rGwRXeOLwyQThoNsjmYoX/bhO3TJrUUoQOC37DDiJHlHNeEqoRbLtgssw\nGf+R6n2HpH0hk4Y9nFNsHyLhwqJta0xeznq21nHfPsCBm9+IoIuw7cFk6SPp\ng8dS6HLl1v5kmbhrlQSCrC24gPMW4ysD0wQaHeYfTJiTG2d32fbu4azZHtIu\nEsnqqIto/hGecELw5zlli0g+fRvOrb/mhVy1ztpFiXKyNmyyztEgWtpIz0dV\n4inhvM8N4rfVQGic6T3H2fHKN10JOwcR1bvAlLTxH+VjM2FDryyklUqHO9gb\nHFVGhjkA4YL5Gfx1zVSeYmkhqdhVhCpMRttULCWWibeHGsKbaO0XQpUT+hhO\n3vY138CASb9XG0K+Dkf//USvaHkvgH8fZhznKQdK7lsa4MqqE0MFFZ6XP01X\ns8hm/ncQq2+padzXiy0c9yeyDIEF0ZJmP+yz+k0JLe8I5flrNy8z9jjoJhs6\nDD+H\r\n=A6OC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJns7+1a5ETltwSLq9siOHbtJ++TTm9ivsbUBScZrHLwIgZH3nITakA1Nzy7cAcxKk6/iEqx334Hja/sKsqy9Y2dA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9a71266.0_1580764817357_0.4499218331590018"},"_hasShrinkwrap":false},"0.0.0-canary.9a71266.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9a71266.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.9a71266.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9a71266.1","fusion-plugin-react-redux":"0.0.0-canary.9a71266.1","fusion-plugin-universal-events":"0.0.0-canary.9a71266.1","fusion-test-utils":"0.0.0-canary.9a71266.1","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9a71266.1","fusion-plugin-universal-events":"0.0.0-canary.9a71266.1"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9a71266.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9a71266.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-AaWgLeXmfMqggfkKwNPReOfJJNjOI7q0E4Iq+StAYNCi3egendbjvVZk+Cxk/HUGqltd80qA4LFUkKGD9ls42A==","shasum":"3b8c531f2453b969483c0b6cc9643e389cbb48d3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9a71266.1.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOJOZCRA9TVsSAnZWagAAGuAP/Arh7z9hLBybNSQHkhjq\nym/kHrV1Hku+jqO5lqR6+tjeG/CAFbz86pswnVvqFOp7DQHtXrm2e1+ZxhcC\nUaN7QXOgQbGkL4IXMh8hWmCFpSknH76KFZNCmfoBbNqY5hmvpI+rPwzeFM74\ntWQQTFJUos/ZwK+Iio/6WQiZ2jfMC/bcypW6TlPLanXwRV9B9+ygXnc9ZUrm\n2Oj1S6g3jKisksFgc96GlX4hRQkvOuSlT+jxiFd6H27rtfuz+3bTqb6uox0K\n6sYsX+CtJdU/L0Urf0acnV0ou4++pYSRy7qG5lZfzfB/RsfkEUfKFdU4qM9v\nf3W6daCyjiUiEdXo7T+Nq6hbSx8JQSYbzO5R9YtQYYNU6t0GWae49xP72IN5\nayTTv2jgmejjmuO9CbIzO89KKZ4ShgB3NIKxWdP+HBoaUt3w8iCmIhSsHhxR\npBcn2y3pPLSII9ysbOjCMotPNKwFPZffLCw9mPJ83qHmWzW4uhTmEcamKokN\n7d2ihgcfkdcInaM4bYVVzOi5OSrj97RB6G7ioyWqcP5AIiAz2xvlIJBvCjL0\njm4pWthdI80jYAZkk+knP7IKL9kqt9DtgG0DC2G0l/OxRjfCGlS3HpxcoUMq\njrFMDuy3gABhpQBfio7YEI+hFsj9M5rVqV2x9pESkJYdysx4c/wzQa+Wv22Z\nh2t3\r\n=EW9E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2+pTrGAReaddrDL02sOAdOzsIXHEXBhGPhXz0ZVzleAIgPcA2azgy7lKoUtU93eiZ8Ep0CoOQk9n7xxpzC7u+DHk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9a71266.1_1580766105310_0.6478843827153267"},"_hasShrinkwrap":false},"0.0.0-canary.9a71266.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9a71266.2","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.9a71266.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9a71266.2","fusion-plugin-react-redux":"0.0.0-canary.9a71266.2","fusion-plugin-universal-events":"0.0.0-canary.9a71266.2","fusion-test-utils":"0.0.0-canary.9a71266.2","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9a71266.2","fusion-plugin-universal-events":"0.0.0-canary.9a71266.2"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9a71266.2.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9a71266.2","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-T6o2caUyJuMmsxWVva84JAWSHBBwHJCpiq+Dx9ehg20bwVxJ6pwdt8QGNSRaLxNGrZ0k5mQVFLHta/0gWNOI6w==","shasum":"d247760c904bcdfe4f4a65ce04f2a672e7da090e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9a71266.2.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOJleCRA9TVsSAnZWagAABa0QAJ5EylY1WuAK0Mfngr1U\n8iOz/NByMSoGDVe4NF8dRwL1UZxDFUfmUFeJiE6HC3ZfU+bKggu3M6GeDCaT\nnprBAJJI62fMyQ37HdSFn2sxKYjPM3l/M2eQAsl/LFAieu1QZFf2YONVUPP1\nFInXxb4vQ4SyTnd+2kSONvhPuoQm+WbLxMcISHvvaDBo0pXAV6isL8QY3nh6\n5DjlwJXX1SwyA8mfBSIomHMIwvTcfGIcZMi0xZuuW5FCYXZNek1i6ZJiZ1zH\nbo/Vyatf7qKoXFUSRQ1sWSkbhZqpdIOg8/oPr0lmKTaOK05WYGUb6wb8T7az\nudUmDKQxTjSXw0Ji8XpyXVwZkJZh9OyqxikLTugktbuR+5MvDuasu1c26yBY\nD3numTvi09FqzpcxY7pOSWjdqanamIJQi7L7A2kfZ4d5G3nQg7fntAnaNOxX\n6KKgUcBWqN47F2h8+kdyh+xnZGGFxkBYK1tnyw96CxvrkdhMrMv8aGa1Urcn\nXpJAO31CejW+qn9ujTP5HjlNarCBQtvXskXVJxGSJXQsELcjhq9r0qsP8HYh\nHjKkRJIC2vIVlxAOf7VgcURjFrpeBJNl+POm3sYptU09W2u8Lrqmoras/C7A\n7RinTnTpRPkG2YXBa0Nd0wwRP4xPV++or6YBXEH4uJjfUvI3cqU68tIgrrVW\nOiPe\r\n=10lF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWhiec3JBQW8zAbqYGgCVHmE1UAi2rfy7aJYsR8e1xBAIgH43okYu8gF0+aAZMLUPdJG/kDIHu7wSMemlkckqvkO0="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9a71266.2_1580767581751_0.4691544299991912"},"_hasShrinkwrap":false},"0.0.0-canary.d07e1e4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d07e1e4.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.d07e1e4.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.d07e1e4.0","fusion-plugin-react-redux":"0.0.0-canary.d07e1e4.0","fusion-plugin-universal-events":"0.0.0-canary.d07e1e4.0","fusion-test-utils":"0.0.0-canary.d07e1e4.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d07e1e4.0","fusion-plugin-universal-events":"0.0.0-canary.d07e1e4.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d07e1e4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d07e1e4.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-LsJHD7arOP0Dhd23kYoMeBErjIST10g5881/QxBdm6yWczw1qft55Vgrk5CJUWUcFGkpxMNj8/FoHL+G7w/YGw==","shasum":"96f3a89867be13ead42a7cbcb1986f0b304e277d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d07e1e4.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeObwtCRA9TVsSAnZWagAA6FAQAJYIEAJS1ahPRpzSM0QA\nagGuRavDrsBw86O92n0LqENtR9j6ogcsCXYIRguD7XmIxFu5X0TtdiMMOhAX\nkvsdSDJES9ViSeUVKZ7vor5/UQl6vM8mdjVdvzkPHi2jlYI+FqMhdtgweU+m\nNE2iF+wvDBe6VOjWka+7bO8y5JnM8tNgrInmXMvIV3OQLfrkbEKsSiaKZIeb\nshjO+/O8ojk4+383XdexYDgzE40UKeRfq9CzMmJ9iapfqm1spcuJHsVk7A5h\nQjMEZbobiVXSMtbmAM7aGnH2WBzKMg1wGbgpR0rYmvlYi7B887TTgKMKxa8Q\nioeOCrMb7/l9eusyvUTPCT1MjcvjP+RFFR1gvi0EZv7fTvJcbQptuCo+aWr1\n3p4yjQT5joqm3GP7c4Z6jyC+xskFJWabJpHBQTsXKXY+Nn+l+QHejZCtfBX/\ncTInTGqcekWFgs5FVtUToA0G1klI+LY/zxC0golB+4clpUdzihp8P+OtAc84\n650Rxv3UM9lsxASamURcW7enwqfvKh5Uo+YHlMeziOK1pGbgS9E+EPOhqIoo\nbzEbISN9rT9InCs3w2K5cZiUN3IYFQEGOJw4JpfwFihBfGoEwOUfCdETnTRM\na89hCHunb/DS3yhs8T1cCpzLY8IYZ6KvmOp5Jir/4yac2GPgVKRXfPjAOaDG\nrFE6\r\n=6TKp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH7pDCRrEzxSPr1aVlQWXtlTX9cWEi7Sk14WrVuHk/LJAiAmmOzh0C9NbGFUl1AyLjxMG2mkwSPqicE/ZGR5ZWDYOA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d07e1e4.0_1580842029394_0.5132009306809209"},"_hasShrinkwrap":false},"0.0.0-canary.05b1cf5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.05b1cf5.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.05b1cf5.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.05b1cf5.0","fusion-plugin-react-redux":"0.0.0-canary.05b1cf5.0","fusion-plugin-universal-events":"0.0.0-canary.05b1cf5.0","fusion-test-utils":"0.0.0-canary.05b1cf5.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.05b1cf5.0","fusion-plugin-universal-events":"0.0.0-canary.05b1cf5.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.05b1cf5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.05b1cf5.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-WSOoeh73CbU+hhVPus2W4HP5zhBzWat0wVG1YQvN9GQZPBEIMfsssNKPHOgjcKwbjwPxtJQts969miiu5re7pw==","shasum":"6bdff1a83013324f649d28646331a68d8de7b680","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.05b1cf5.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOb5FCRA9TVsSAnZWagAACFEP/1JxTWnjy08t5AVS2Dlv\nX2WOVN70xm83UNNjCcSDyHF03EANIEwSlf+rkuHY2EHlFCBKjgPcUUbAiYiX\nNaYfCRhRrQ1dlsqReqhLQtVYyShrwObtqlhiop9/zzJc8R6zu0WEbqsyb1PU\nyVe27pbxgZOQ0oWoOMipy63c5SX0bjPuk7arIRSzR5sgbP6lAV2/IOE/VWOq\nMlREjTssCwADf9yO0/2P+CsEFVEAAfxxnvM0qVLhI/e2GaDe3yRRfdAmPO14\nOjFSkJ4wCRZz+v+cCJb5cmXFAralwLV7S98hDS9ZikmcMTXF4PTkkN93q73r\nhhOawgnVeigIh0d6pAG06ai6maxQ0oJBjP7P9jh0IkKbnnn5Vz2vuJ0ZIsq5\nIJWD8HfckYI1a0H/kepfmpd9CEkmHavqm1uvARxODElg3MXKyKHEYOfEzhvb\nIegGcWDWGNeeYaKa8FsxZJambORjnNK+UAbcSP9hQl5gofYTZB33FudhL8BC\n4RYlD2Y9nshk3eXTustEK1+QUna3ehqYPaIZ7ffBZOF4bTekzCYbO2W2cxPT\n+aM7asHYIaRjUmC/2AaXJa2L1BRAdE2pYuSRoLlYNc9pbbK6ZpGe0SiVy7uD\n9w1tUe9zkVISh3zY9k552YEJR8WsZJHhivr39UUVwAmwmc0jvJJKZdgf/OF5\nm7O+\r\n=/d1R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXncDePEBAzvbZf6X83vlSGn9B7utRx3SPnd9K5o5L9AiB75AW+5llgqMK3KedctqpWjE49AYuSFG1fOsEbaUVV2Q=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.05b1cf5.0_1580842564618_0.1771721261627479"},"_hasShrinkwrap":false},"0.0.0-canary.986cea9.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.986cea9.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.986cea9.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.986cea9.0","fusion-plugin-react-redux":"0.0.0-canary.986cea9.0","fusion-plugin-universal-events":"0.0.0-canary.986cea9.0","fusion-test-utils":"0.0.0-canary.986cea9.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.986cea9.0","fusion-plugin-universal-events":"0.0.0-canary.986cea9.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.986cea9.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.986cea9.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-oS4VKqGcW2RA3zeLeKKvOhgadCh7gYm+4x5q44+oEGZwRtdDpixVkLgZ+J/QB7ISWS7mUU5IyeiVnt6mpaMXjQ==","shasum":"b79c81d0b07774b95f1cc5b23bed50ed52725254","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.986cea9.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOeRpCRA9TVsSAnZWagAAueAP+gJSKPXuhjn2/kK6Uqr3\nu58XIQtYyPM+gSZT0QV8t33lkgVnXUQjbA+59NeFHEQHYIjE4GYkVPvXX0Fy\nDbdCp8WOxxCQBF1B9IVZkh/KI/KdlQkkgHwXbciFflCAvNmrNSIXrdJI0h88\nkWrsTSOrGfYc8Kgf1eCocE2PNqWl+ro7UlNxoY0qsQStAiaIjv+StTwpa2iq\nlStIpcHesUUmpQUyZn4R9ci4uuOWv3+GkSYKePC7ajVcA8vL34TsMokDYWW7\nvVIQRF2J//90w3zm6/hY8LN74r6MaWKPo1U6ku3MJl7L9sL/N8+vfAGFZSd7\nsq/BDMp0fg2aYHrj4mybclSwEGsg8v9lB+GEaYOokDeebT4M47ar0LUy8JF+\n7BPzvND701qf6vMJV+eLUA3yj4GaR/7QgQQKeRwX9j7Ftc7UtGejfWoPmBSW\n9fKddfUCXI/nWoh7gtTgAG/9ZIyORmmyNVQAFeeAboq+Ufz82A6SnRc3D3FT\n2GHAJj/AOGe2w4pqsX2Mba+FqkmN1nG6nlGbbMl154iqdHH0evUSq7OC8yNy\njhBFH8u6PgPrPxRyyXXnKSC/GHx0zQTmavQao8UWLfB7l07Yze+plMpulMfD\nGOLlCH7r0dc2BxNCRf6KJBLteZyukLTpoTRqWqv6OwANhWA6Iv2QE6Oq2xWl\nYm+U\r\n=i1fH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3+h3OxMbdlXiXqy1nBbk0g+yI2q2uIyGF5UW3Idsb8QIgTOUCsZ8fAXCVdiowzYqupf58twTwOG+8u/1iYJOBAVw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.986cea9.0_1580852329028_0.4703758582721631"},"_hasShrinkwrap":false},"0.0.0-canary.b8a6237.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b8a6237.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.b8a6237.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b8a6237.0","fusion-plugin-react-redux":"0.0.0-canary.b8a6237.0","fusion-plugin-universal-events":"0.0.0-canary.b8a6237.0","fusion-test-utils":"0.0.0-canary.b8a6237.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b8a6237.0","fusion-plugin-universal-events":"0.0.0-canary.b8a6237.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b8a6237.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b8a6237.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-1SOE1LxIGYvYpvE3Nw1CWRLVw3y21WuN++5R2xtbLA81wSNs283fZHxqboP4vrqoASOwH2yC3DCyrQGo1zg8yg==","shasum":"f85ce24352d0b35b91557217e09fad710a1c76ad","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b8a6237.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOwlJCRA9TVsSAnZWagAAwP8P/3d4S8+IMyUkfoPp1dMU\ndxyJJB8VXYkrVWaeRnqrZKAuULHjIQi+FJLFTytUDI29QOF6K5GEHGhuUzTA\n9NV7z+dtD2st0UxQNUQvtvB3XaADh3n1IguL21GKVmeX7N54t5JH2sCPefTi\nn94C33JPO0z82I+jLv0aRyFMAgRtJvIIDCXmnXw907rP9Kt9dTCx6vP1b+XW\n4zUlNwijcFaOhBhwSPC09tQJlHziQ7Umqwi2YFh5gtOqpzcSxStLkCeCryMA\nvF0s4uHtHwk9HfyapGkUuwUf5vA3RtYAcFyUOkXLpAlNe//e1B3uyNO8xDTH\nhltc3gCuttT0eHMNnku+eGMj/9VR7NYwVCHnc9N4NYO3Ln0ThrlEBSRXJipH\n8JTe94blBBAInowZWSjmft5UgxqlOnRjc0XCOYEzpe0DffH+Xghp+S+pH70X\nmHIGYd5uIj+aDaCYph9gObzXJYUEdhMnbAxJlfRxUq/cnOP0Vi9kiIaX2BQ/\nMZuZmeCJrADPWqVmdt3d3+P40MtMuE+PtckYJ+3krrcWR7Avcx5dIj4+HU/9\n+MeT19vIYMzFtU7atCImRUVop/X3JDhTq7MA59xR3SzPMlORhRfb/GTVSGgt\n2umD02s/sm2sdZ4wCU0lSQKczAL64TA/mOqhOaKppFPacTubxxMuUuPT+Npx\ngJZ5\r\n=e02l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCIrK0J5JAZzWy3EojEUclUd+LsJJx9+wHfHHYPNpy2gIgNZjU4rXLXvN7EnMllAKVbmbiMW39BXi/QsJ5AOjtDtU="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b8a6237.0_1580927304774_0.3711789606441722"},"_hasShrinkwrap":false},"0.0.0-canary.2c705b4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2c705b4.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.2c705b4.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2c705b4.0","fusion-plugin-react-redux":"0.0.0-canary.2c705b4.0","fusion-plugin-universal-events":"0.0.0-canary.2c705b4.0","fusion-test-utils":"0.0.0-canary.2c705b4.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2c705b4.0","fusion-plugin-universal-events":"0.0.0-canary.2c705b4.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2c705b4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2c705b4.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-8fZqbhgsBYVXeTUUEAbCtdhdjyKXpyMthOvQmBWeP1Eg5iVzCZVFQyZ3uhFtfsSyLZK4u0eox/HoBe4aoqvVww==","shasum":"17a7b7f38813d8ccde3c35411fce8045198989a3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2c705b4.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOyyHCRA9TVsSAnZWagAAmvAP/AoMzqCjtHTPb+wSc0St\nOeNcAYTbw3dD41iaHi0MJLtH6syuawpKZlEhYaAx52wxrk0Ht4vQjaIMl3U3\nopnmaMy7pUrAorwGIihGnf4TFp9Gg6xpBYJreqB48QgSubut0PyiV4z1IdeR\nJrPP++i72r9znSXolZrugsjqcjQf+83bHViHeAdJOesr8Yft03XH2gsx5VLD\nRLCllO7nMiFz4jlNL350tdK40uQbp0ZahttfW/646SZe9ccL3AnHRnv+hXhF\nvTIZrTgBom798vTqvUyKo+xNJ54H+Gvr0kiX1GQmjA2ahm5kHqdwRzH9U3eB\nVNvDd9GXar3jUwOnNgzr3bYVmET2HWig5XHXqm4MInioxzxTSxAmvXfd61we\nmgqEvB88RdqNXtbb7V9GgvrF25bK0RQ6R9SFkDxiJUus9NHYr6xD5llgb9Bx\nRm6AxV8xFkFbzyn71bvt6pqcoI7UGCEH1o6NhkE7YhF2uUJDPJTw6BGPMzqA\nTEcsn7mObaOqfnJlZQmKqABjE8tHsmgOWp0xsyHEmrGpXMORQw6ZCSGddzxD\nDdnvx7pnf4wC9LAht9S4uw6Ubw0/z7oe+p+J1Q9gj4ZOF+hnqfCX4I451kB4\n16MQpVGsKjubgm02Nln/d5bU4o2rIYQKbc9WdYMRftbHNOJn6s92FZaM/AwG\ndqFR\r\n=dHSi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPvyINlMFhiE6R+cFQ7Tkspqx7Fy6gvGiSIJeoiJ72+QIgNiXNxzfZY6o3s1FV4FYgU9v3HX8Ln27mkYTcDg6Ag4k="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2c705b4.0_1580936327417_0.12457320294417862"},"_hasShrinkwrap":false},"0.0.0-canary.4b659af.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4b659af.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.4b659af.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4b659af.0","fusion-plugin-react-redux":"0.0.0-canary.4b659af.0","fusion-plugin-universal-events":"0.0.0-canary.4b659af.0","fusion-test-utils":"0.0.0-canary.4b659af.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.4b659af.0","fusion-plugin-universal-events":"0.0.0-canary.4b659af.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4b659af.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4b659af.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-jmUcFJGF9Pjsb89igwOyG4BjrAT96cvvKola/zMpYQ9gCa7HBXsAOg+GeZOBp6By+i+/opBP/qbd/hr/Ock7EA==","shasum":"bbe5c76647bb0dd2c43b5450783f865cb59d0623","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4b659af.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOzCWCRA9TVsSAnZWagAATxkP/il8CtaBXCtPvQCnBFFl\nHOM1N5K2XmuwIY4gwqic5liwDllc2zhWUT6L6VJdYfYEJRsmzBNXQJ5Hkl4n\nwL4IOIoOjTy3VJpkFW4imk4TCgZXGCiQ9FRZYlowTmACet3FuCXLqhVACOvB\nQGcQ8/r/M2lh9EXB7azxHeN6fsVYQZDeq1nfjZVi0Z3PrlNgD3W0indZzqkI\nhcMWQb62OE7VzkWdIFt8YEwzYevtt+4WxTH5ywrnJA3aRvMvjay32OeM8ZPP\nk2MZtzy+fZHp6IV9585FSAPp4sub034V7GD3AwWm4C0HkKdn0t6YDC+fUHde\ncXY+b1mNmIym7Jf+c2mnze1SxXN0JnUJjzH4UTtUwAAh5km2LaNzs5/+mZdL\nO7ZHHfObR74aVy39CGm+zgVR1B151oAi5ygpnVUdSECGuj9hOydo1OyXaIVX\nx6bt3Hnv5uj3rGZdLr29v2mW/hBGxrFSj9FxI6CqPcUxYnMKP/hyhPC9emT+\nZ5tzC204HMdtvmx3qs9p1C4tVQrMAHo+SFTx43avZ5XAh7nLpbNc/jcaIB99\nzRwr4EP2r+YYdHD+gVAOFYc8jFc0encB7/0SzBAC+0WXhEshFG9BPytSEcVo\ntmlB7mtWZCCdTNRkcOkT0x4uVrGcNPZ/sf+EEP5Myo7zoBBByYO2+pqgjshN\nUb3A\r\n=4pi+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDo+fw8XVcTew5lNbueOy0co0y9kootISJD1OvQbB1YbwIhALqG9WqO5N0fm6FgtkNE4G6lOqBdmZ83EBluvnx5smFl"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4b659af.0_1580937366102_0.29613655831711316"},"_hasShrinkwrap":false},"0.0.0-canary.96e8674.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.96e8674.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.96e8674.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.96e8674.0","fusion-plugin-react-redux":"0.0.0-canary.96e8674.0","fusion-plugin-universal-events":"0.0.0-canary.96e8674.0","fusion-test-utils":"0.0.0-canary.96e8674.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.96e8674.0","fusion-plugin-universal-events":"0.0.0-canary.96e8674.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.96e8674.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.96e8674.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Jh3yfHkkLhk8RyY9qgkqDjl2CkfYwGBIFzBaghw5LN3YB8dJOCKjiYxjb6PVVa0mqI1rRZlAUvQ/H+57H3ZYJw==","shasum":"c49f5d11853c61f1adc9c15170b031d071fd9303","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.96e8674.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOzLYCRA9TVsSAnZWagAAKdAP/RenwXIfnjg9TysWK/e4\nMg1cX4M+BjacPu1HDWzQd/ZSV0o941jnkNE0WjqMQTp40qtGwcnxcSPGa0Ms\ndg/pJx3nUxLI2HeDOPO4+Mtyx5JkIOoDJn8G/HeGdvxaP5YOu4mzdyOSR6po\nWWkwhiRFFQRnLtA/6O8YycGGa0ZeA7JtrGKY7G+AGttaOsbvtu3rLHTbi8eq\nBplAOvFJcv1gu5NXw+4U4pO+kgIdb+5SQEDzx7k1HjqknpVy4Izdr70uebel\nnNZrbTTESn2WakoOU9IMEK7yEM8GiWKPwcRsVRbS6pGzckazKDLqkXJ/f/bz\nDYijNK+NRG0TxgH915R4JBTBMg9ZPzUX4hjBRjZFfsUV/ulX7e/mfvyTHYNW\nfqXK/lXANAVegYkYvBxNLGBqLU9kO72H+ngqgpA+6PFNu+io5nm/4zT2/e4A\nifWbz30D+MTjon1GOBt6rgbpVzsAqH03vGTl2iFR0Iq8M3SOlISz/V/lF55b\neXf1huctAzqNcUsgLuPFHpOCpxOJ2EsIll67Vl/29W29znigAjzGqIZDSQAL\nNygyEVq+At9yjOCNgJGqI4Nbpaw08N83obWXVotxv7uMKBr7xn5patseYtAW\nH74xeB9FLc3svygi5Sot2/x5c61QcBzprlFa2V0rQcwmbv9VkHK70AIEgPht\nmdGZ\r\n=WXQw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcxc7j43SE4FtZ127Bd7QJESFHqUzp+tjv0eTO38NZGwIgITwwTcvWok9JqoFwgg7wGv9suIGbHxRGE7KUrAvidaQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.96e8674.0_1580937944517_0.30615447244074856"},"_hasShrinkwrap":false},"0.0.0-canary.96e8674.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.96e8674.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.96e8674.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.96e8674.1","fusion-plugin-react-redux":"0.0.0-canary.96e8674.1","fusion-plugin-universal-events":"0.0.0-canary.96e8674.1","fusion-test-utils":"0.0.0-canary.96e8674.1","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.96e8674.1","fusion-plugin-universal-events":"0.0.0-canary.96e8674.1"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.96e8674.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.96e8674.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-eqQ82632xEbK77LUT35oQFE4PPjb8J3HHRuS8WaEyqOLQAY5Ok2B9KQlQSy9SXkP9roKsVukohPWUtgelPY2Ng==","shasum":"c5afc5d140a8da20a47e18e2009fae92aef3fbd5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.96e8674.1.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOzU1CRA9TVsSAnZWagAAGj0P+wUfWzWhscBmGBLAoV0N\nz2i2U/9yIVM/SMBeHJWsAEBbzVum6k162GWe+NCUz92fxAA57jicC/AnF+FJ\navyPe5yvifGvKCY4vqpGOivAc0YqefzmKRXHvbVERX20WoIORukt/n03NFaS\nN4aVObxSvFqeduwcbTbqB70oMePbExU3Pe9jWHmcyv43fwDLiSWoC1Ah9Sc2\nsGqJ2FrumMx4ABenjVMr6o2Klqtcv4ld7PJbNqIBy4PxQetAeZPTMDlRV5+E\n8AHCzASBfiCCXBJMhDlPdy63TrtJL099Lw8tdQRleWvgE1cE5jd/y45WqAlh\nyomPYGQzfNWB6d9cgEdBJxgjEyBrOoudv8qy0b4khwWrwIsN1iYgUBHazI+3\nz/UMuRKz1DONDH/870FO1R0TamNF9lfwhQI4PVDnPmK0Y2svzv0PPy0Zc/PL\n81oY76E5z0W26r5e1VeUZuItStYbYH6X2B3jC23aoYJOSBZnYS1++hWt/XXl\nHpr5CP2DyKuBOQIFM4QVbG1+FCfemiX9/GytptE5969N0ydTX3WXNecgAGA/\nBVDfVSfRb9RIxKalBy+K3Y4GUBv9EccDKK+LNXlWUBVf2L5CmMaOxBl9hTw9\nlMvC5rWVRw28G3C9o4UtIBgHzrfLQrC0GIitFEpMlaleRezGmEOgYoyqwIuf\nCR9z\r\n=EmEW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICLEmAN84RRB9ZvEP1RMwGVukLlyBz9EApMJ4CMLrVx6AiEA9akYtC5EpnYs3wPZVubrXWG3NjdqJrV0kLLFSMtMYiw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.96e8674.1_1580938548643_0.41101416868056395"},"_hasShrinkwrap":false},"0.0.0-canary.96e8674.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.96e8674.2","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.96e8674.2","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.96e8674.2","fusion-plugin-react-redux":"0.0.0-canary.96e8674.2","fusion-plugin-universal-events":"0.0.0-canary.96e8674.2","fusion-test-utils":"0.0.0-canary.96e8674.2","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.96e8674.2","fusion-plugin-universal-events":"0.0.0-canary.96e8674.2"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.96e8674.2.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.96e8674.2","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-3yxVa8uCVGsYmz+tkFkAQr3F0/stVzW7qw7VaJsn0FL/17wdvdcf/L2aW5tBGsMqmmIA+wGLNLVhih/hzr0ZfQ==","shasum":"71594deca4b40ea69a30a9c4be50b840e48be491","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.96e8674.2.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOzfnCRA9TVsSAnZWagAAoPoP/26Oxzc9ksl0dX6QS0I5\noADau0fkug0Hp6IHhBgSJ04EYmttcMOmSUk3VZdCxMyszusjw5xLCalvSiGm\n5YUNsHL1wii740AkxRRsrIYgUKOzKAqeq+CgxvZlJu2keFLWRyGdehmeFQES\nxi4C8ANTqwjPjbAe1xqj2X/xZLGUL8bQg/IIHQC0h9BRzfvEY5XJ3mTgS+EW\n8jv0aLZccF6+bL2KeZyPNlBYxTh6tOB05Rf290zu5KBnI6FqJFwzmu4EVnvm\nFaYDMtKcrmjb6pECxtsm+NwYoepW00xl8KHCOitIrurbKhRS7yZ4aCTH1Ij9\nYSzw41REjNWDp6EOnWGkT/gzPm4XZt6CfFA/ND1YMgqlzYLCVsA2pg7VP5/t\nxrvXcoSX0UVn5UviIim1w/a7JL5FCVmYfODwIuQYGtPJsIKOl4HI/yNtrYlM\nkwWODDXalNPHLlgbJHtrKhI112xqIkOp+xB5O1a9qJk4/U6jMt2h4YTY2kzF\nponp3G2tbcGH9h5fLQD2OYwZVpsoAz+KJTV2vJSbj0XaODSM0H+6baa9n8j8\nFJgsDLSEdsmBrWSnieiotu6ow8/jzTtwaMLsxHtM255TG3XSGwmKb0XtG5rj\n5odDPk8u+/rTeFpamBXQXe/0junrv6IOc5GIqSLJMYdD8Gs0Cdo/+EAjTsdK\nOoB8\r\n=1/I6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsNFffn678j0YLHPGCPEd4zX4JLmpMNptE+xLKEh0WHwIgKzy4LVGJ8I/fWXeY3TlUqnW1pzH0PT/7QJ90NeVKANo="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.96e8674.2_1580939239291_0.35737315891752686"},"_hasShrinkwrap":false},"0.0.0-canary.b640602.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b640602.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.b640602.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b640602.0","fusion-plugin-react-redux":"0.0.0-canary.b640602.0","fusion-plugin-universal-events":"0.0.0-canary.b640602.0","fusion-test-utils":"0.0.0-canary.b640602.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b640602.0","fusion-plugin-universal-events":"0.0.0-canary.b640602.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b640602.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b640602.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-1TM/OBDoE59QGFtX9Ns9vBke8yemJ10d/lcWzTrdtof5y0mTnSplWY1MK6F2sk8zZCIqicet6ACIu38nv0wPSg==","shasum":"4bc2e1d8f6b947bf0e9454b93f676de4cca05a4a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b640602.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeO03FCRA9TVsSAnZWagAAFlUP+gLPimrabmD28CYDa6LZ\nWJB7zZTNiGByaHXC31lowhZFGxPmYVDDHkbAwwwn/O9No3xTc57LgEQiZ3AL\n4I4egdoZxpbEsRYjwMbpuyedIY6JvhtzVQb9Zaw/RsiDZTm4dY7oa1KnK278\nyBs8M6i0RvpZJBc3riVRauvt5UOGNjfIMbRQ8sL0gi9wOgdkhaXr1gWwlaL8\n+OHS/zYbfeGZCPSErLZb8aZm/Wd6aopiUNsllQl4nRQUfZZNXEZQjdIW7VLF\n7bYhCqv1fSvgvWjFqa+emUhpu43yfVjh96B6ZOMzUFS/1oGPP99luq5eprPi\nfNP+6ystdHhgG+BDKq54XLm6uSyWHbmY4t2hbTeVxwxayg5XmUlV1USwQO36\naEQtVeo+OXHq+uVOZKClHKagjem8zjJLISzYuPp7hnH8aXo1SJIftIWKL6Ep\nI/YM/REHSZkyNJHJ3VGzlv6TY/7q9HkQthf2bSsdCUV4makQkbhxw8/qeDoK\n2ACkfE3akAwmPTeul9nuBNZ96tNTB4LrtEY+NptiGkovVTFU1yPlNY4ZaAOz\n0pMLLtYoogF1Yn2A0Ory/rsJS5BohXvJHXWT+vADHo+wBCh49Scuvn+y56jl\ngktXTXtdMSIcq0e+VjBG5Gtw0iZXc8uTIlBIxZdgW14fNRiwUDv8wlWBdXWc\nb8VG\r\n=59Iq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlq1c17uu4Dohrzkqnp1c2bGcKhilsvdHt/+7+0WI5TgIgD7GkT1jSko9vRA214B6o8sIFXQZAetex63hEzcJvWrQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b640602.0_1580944836517_0.30114756403704135"},"_hasShrinkwrap":false},"0.0.0-canary.b640602.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b640602.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.b640602.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b640602.1","fusion-plugin-react-redux":"0.0.0-canary.b640602.1","fusion-plugin-universal-events":"0.0.0-canary.b640602.1","fusion-test-utils":"0.0.0-canary.b640602.1","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b640602.1","fusion-plugin-universal-events":"0.0.0-canary.b640602.1"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b640602.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b640602.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-hq9r76wY8druQSIbYwqJqoXy623s0ihALKqIN+yGx+qKWKxsAT95njjeeMjoWC1bFSk/IuyJoddYTjfsRsQ3uw==","shasum":"36d6a4504f685769fe7076a9598142ddbce4f18c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b640602.1.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeO1DUCRA9TVsSAnZWagAAS9MQAJV5ahxHCV9LHHKdSrmC\nPApyUB7U7OCAGh9jRInuVx2Mh7TQOS0UnKYHn9KPY19AFJ6E9ntOrSjh3gK7\nr1aXINcyhnpeeXXW0g9RNIR6zE5furdnozv+FVQnUusN8ayodYwt2a3viATE\nw8vuTMtmm3Df7uiOumxPZRXpYv7eno1UUDjKm6zmmJ5ldZoU/yu5HY/ilKw7\niyza1YjvlQgMl3ePcm32AAGNzxtz98kQmnQVnBDRg53qN9uFYqIPjZ+F7XUL\nU+bDdnEXxkr2P3KAK1Yu9c0pkDt3vTDWkobW8m7cio9vycqeUTlsSF/CrFCX\nOPqpXMO2gjTyHwFccUwGbXrcDZlR6hzlJXCLHtHwHW48oJ5E7/Jsa0wz9TO7\nasqxpLuahIUe7/e1a3egMSWCPEcCsC+e06KWu9CsOTRpgKvIz0BXmjZBeBl3\nY8ghKAh79JA+/0e1hV9CsITPG629GqqLmMoB8IpccIIsVrqDMeAVAhhB3rTB\nyCmTlt5ZpsuZDrf5XseiNn+Itjn+jz8l2XTWmmlGFKxWeZXtUTMxZXMnYGTA\n0GVsQvwRSzyOm92zPIqGzIz+7XH9akzgQ1GEIkZX8ieyPHtt5icBfNrmFjfa\nBdOOBPT4h19BACXohoHt7KtkkBIoiva+33L9Yje2rtEBpHbwnNhXQDq8ByIE\nRoyn\r\n=OMSa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPKEPRW2tJ3gBZWyZoVE45OhRor8nBIAhEi9rxX3Zg2QIgMJINup1IAIiJAJRRetAuCl6N2Wjt5HMS9QQHTAAeHmk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b640602.1_1580945620152_0.4346514074708119"},"_hasShrinkwrap":false},"0.0.0-canary.2ef1293.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2ef1293.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.2ef1293.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2ef1293.0","fusion-plugin-react-redux":"0.0.0-canary.2ef1293.0","fusion-plugin-universal-events":"0.0.0-canary.2ef1293.0","fusion-test-utils":"0.0.0-canary.2ef1293.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2ef1293.0","fusion-plugin-universal-events":"0.0.0-canary.2ef1293.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2ef1293.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2ef1293.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-DNoR7k9hx27hmBNnwFhdmhdOYMvRZkJk3+riy5NofJxBQIRI7pX6YwDg96Y3DOS6eOxrX+SRCeuDcsoig+2DNg==","shasum":"4676d6201768c09971b5410fb8b545e8b53f819c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2ef1293.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeO1VzCRA9TVsSAnZWagAALkwQAJTfATpLWXAVyAwHtkv9\nyglt1G1xoSyhXIpwlVfGXEEn3GNyBDfUkAfWUqz7H8ItXXIp0LHFqTsWQk5F\nUaUlSNWNYibCKocJr7gygT3UsIV/ltz/k+I0r7s/0GW+SnxCjVi1cEmPTCFW\nk32oA+bPoKK7SxPzWbdpMJ5JoEqkVNvhOI1YhzXXS1QmA8XkWscK0br5mfpV\n04HF42fVbaa5lZ3VNTHXbOGS34q28H5j9erZtCVF+m1J1gZWfMjr8Hb/WG4T\nd+7qmIF8WLWgdjqSSDcw0rXK92hoxxhzMtGnL11BwN8UeeX1K036GJ6xVCa2\nmy0/OG3+4w3/pDv5O0OvKmR1XCX0td2ik8eFIxXj+ib8YD6AtfhEf3Ufmmgi\nIs7Y6f7pjEOK6kTs1Gb/pmSjtB9Y/KTCxE4PJiZZSu/yQCEHVdJTr38vlKfa\nBOPSjHAVHIXRUBQGxXOrKs24keS/cfieQud83JAbJ80BgC4yOuNKcJmQ4Hi/\nLhErsg5HcrLTVLFuQaxXC5NMLxcCv7jSz5Kl1k9hbt2ZFw8Ck0+U8WiruZlS\n/h1liXmqGjSdLPuCE6/UanL8fAQzwdhvpZgs67nRG3iN6erNA/ZRPrcl/gp2\n9TUKze3rDkShwYea9KOYKyd48tZ/8R5RmSzf5WfzBXYORTMf2J8E+tkBjzha\nZCmK\r\n=HwBX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEFd0kjbzs10SfSCNE6Za1kWO/hEQFVLyNBd8enLsixuAiAeTljPnbdw1CEQ++dFHmKCsi/9LX5rjBg6O3LnpjG7mQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2ef1293.0_1580946802636_0.06753762125473184"},"_hasShrinkwrap":false},"0.0.0-canary.2ef1293.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2ef1293.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.2ef1293.1","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2ef1293.1","fusion-plugin-react-redux":"0.0.0-canary.2ef1293.1","fusion-plugin-universal-events":"0.0.0-canary.2ef1293.1","fusion-test-utils":"0.0.0-canary.2ef1293.1","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2ef1293.1","fusion-plugin-universal-events":"0.0.0-canary.2ef1293.1"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2ef1293.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2ef1293.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Thd6SWlCDwQI2ZlFEWGbj4ujU3NAokX5Db4bDLhhnV/PHYGXmwaAoC3bpp4MKhYTtAc7duWBfHdluoeY8Hj3cA==","shasum":"58715d4f8d4fa9f583fae1c9e8bf27c4b80a3442","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2ef1293.1.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeO2iMCRA9TVsSAnZWagAA26wP/jDV+VKRNLyUj+oIB+qX\nCTo34IKi5q2bUTLuTisKDnx+levDsnp/49PB21VPA+ZUX5f3JfoeV1ZOS7WL\nrCCVT3OasxWM8WK0MOUon3w8l2fw/9SWtN7yvUsNHVx2+5CwafFtixtothWS\nuLszeiNFZ40AurU8CrPRs66zTqYNICLJ8BlITSYEuyrE7svhGZRfGgsOOyXJ\nPConsApFNb1UHmd3tol4Uoimbj1l8/rwW2d4ydYtK+A1IECYc9Br5W9UOZuG\nXITROdGdfFNCtrZTBN5HrcVaf/3H1Km8ggQN7SkO5Wh4FPffCf4bjb5Wwz+a\nP0CwDGyG+LflN5I11YiYWcpdDZzC8DWWaP1cn9GBlff0gFhMYmyvSIaHAgm0\nIQqusX0VMDx1CvuQZo2N67tIJR2IMJagDtWwvqtzzP2OIvsF9gaR4IoOMthG\nEHRwcq++1fd10x19fvLWF508qrzzw8LkHU+uIV5kYDMy/V4x60VCfeWjdXat\nkxfNaWW3my8hP+/vtM3uXoHPsz/79yN8qAWh4CIE0zW/WZYogmf2pXl+3uVS\nRR7nWqUChoLxSPRkd/l5tTlSb/CEHmawSjKgTYzaN5BfyKlejflY8DzbnV1M\nDQrgv1zwvEQWuo2tXjfb+drpqEyUiKbMOZalaJhVtQJCOxD4RD9uLNh0fWl/\ne9bD\r\n=AC+z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuj5vyBqynpNsqYugdFYLg/swiOa0WUlPddDzXwSJfegIgJ38/WCryi9GLygnDBdT2xLJNH6Wdf/YEKHk5OTpxw5Y="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2ef1293.1_1580951692147_0.7531620704854207"},"_hasShrinkwrap":false},"0.0.0-canary.2467727.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2467727.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.2467727.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2467727.0","fusion-plugin-react-redux":"0.0.0-canary.2467727.0","fusion-plugin-universal-events":"0.0.0-canary.2467727.0","fusion-test-utils":"0.0.0-canary.2467727.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2467727.0","fusion-plugin-universal-events":"0.0.0-canary.2467727.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2467727.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2467727.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-szzXWgLpTDbiACHSbw0sJVAiCxo+iKdwcyGEtsLEfzC22a/4LlvjN+AeIF3E6pyEv/gDm4OY2PNR7AbSdq7QSg==","shasum":"76fecfa4541480c4116a4503f4b8699222352398","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2467727.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePGVECRA9TVsSAnZWagAAjlYP/1lNp3KfwRpZlcDs37bR\n2muv7QpIx4ppZgFNaRvUGGQeWfFcbZ8PEbkDg8JIRXLQYcNRNCWn1PNNikDe\nRumYh5Xr+Nzo9DwOybW5mcEcl1sR7/hQEC52kQYn/86j073jow/hLBeiM36p\nsMd05jlAwH+kVUcU9dpi3eTytQwMHsSxLCEzouxO1YIzjlBOi4iDEqxvV5Zi\nXWSGhMcjDQmZrQHzK/OJf35OaFw9GFCSwIx4cXkbYtZ5v1aFHHzFii0o5ZG/\niADY5DalClWCACXX0A3LTJAtP+BFdsCgrS8/puylU+oQ8YcGoWQE3KQqC++z\nCAhIYcOQBsoQ9KqKi5oyPu5thIEb7txlnZZ6rmBrHY6oh+wi3nOMzYxqwMQQ\n3XPTJtnAUTxQzyYPOSNfiIlTn3Og1PsAVf4VkJ4ZRxZnEEVKr5OtxWHigb9H\nUP6T+6xoUYndia99U6xvZagJ6WkOygCjejvFOOa2G8oPYK+xCL6DoOgfMky4\ny7EZCzxTqKpGbLFhxcsKFQ4rflCVy3nG8iIHCEC2/F6mQSaII1uKCoNTRplD\n0CedEyARbDKO2h1Hr9MnDsGUTm5cBGrlSvjSuGAZiJ5LLH2juAvOokqA1iZx\na+/RJp2S08NCGFiUsjzyWXfqNysadjTiKbIK8vLxhv8xMH9m/ZCrtI6og4T+\nnYKi\r\n=J2w1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCz++OmdXdkjhPUgmCmUbb9+nVweboN9Xo0+GL9aN2AEgIhANuo0VAudF2sL82rJ/LXeRp5vb8FP1LATz+PjvWEgn3q"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2467727.0_1581016387591_0.2540531269723485"},"_hasShrinkwrap":false},"0.0.0-canary.ccad833.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ccad833.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.ccad833.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.ccad833.0","fusion-plugin-react-redux":"0.0.0-canary.ccad833.0","fusion-plugin-universal-events":"0.0.0-canary.ccad833.0","fusion-test-utils":"0.0.0-canary.ccad833.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.ccad833.0","fusion-plugin-universal-events":"0.0.0-canary.ccad833.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ccad833.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ccad833.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-W/E4vIhnN93T+zi3M/UXayxhE2DsN438mS/3Rt8DqKm1o5TZk+bFcwHfbZycvUEPUc6Gi3yfFsOkKdsl0Uer5w==","shasum":"c4ed1d5b6fbb7ca3970e3797ec64cb69e3d8c9b8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ccad833.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePG5dCRA9TVsSAnZWagAAIuIP/j3thb7MZAn2ZzYwHqR7\ncVojnJuo19hRW7hICah+FAQlSuLslJxwO8wEyDmdHff9XRGropL0VeXKPoHS\niPYPMCFnZB4jTzvXVbnyP9/PRZiACmx79gXCRnZwHa2RyEJhWVQfHQwowPzb\nJQAS8wWeFdE5O/sQEJmXTPNL1COb8Ku8GgL04im67U3fehZh7Y5j5bLwAGGj\nWkqb2dbuCDfRbMMBOUGHhPIciM6+dM+aa8CM1N7Re1yju1tQVOkHyrjGF0PO\n2yOTW+Db2lxlKPCZYpHYN3Wu4k06j62LVhi1KhmLsuLR/p6H49HDTsZcbTMD\nAIMrMgRmwFE3Vw4tPzA/Ngmtor3fHiPIXRTg6WMy1g+oPNVZxm86U6ADObxM\nSzWOQRU0wBIGmpi7JqPgEgg7O0zY/9rIqsLJnfgwOOlu2URVOPEBu0C7k34n\nYWG0imRCT1BFU0S7YxlvH1SHSvWfTaXxwVXPLjgEHU42wtWzdIRI1VbjxFHA\nM61/5DIla4Ue+tb4/xdVygKr0eXMcTklueQPc6txKFAzlf8U2bcVvU9w9SDj\nVVWnDIodHCShCt5HwR//WaeEZLvgHWjQcnKGjvgbTtmtPV/sba2LItvnbuTF\nIGUavgFfZMQsLKlkXnv5xB68UHmRaPEFAwLdFFq8VNT3564HCYlTVA50rftE\nISB3\r\n=kZtB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFx3qwDDiWzJ0KlQ4Do6HK4ym1j8Bq1TqQY/g2Y4NJOgIhAI/jSP+LAJXRwmLHI6PAE2jRgYs76stqmD3EkSpzRjer"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ccad833.0_1581018716594_0.8382231278963206"},"_hasShrinkwrap":false},"0.0.0-canary.e70cabc.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e70cabc.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.e70cabc.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.e70cabc.0","fusion-plugin-react-redux":"0.0.0-canary.e70cabc.0","fusion-plugin-universal-events":"0.0.0-canary.e70cabc.0","fusion-test-utils":"0.0.0-canary.e70cabc.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.e70cabc.0","fusion-plugin-universal-events":"0.0.0-canary.e70cabc.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e70cabc.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e70cabc.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-nin+rFNQ3SThmyH8vr52ehknc26J+/kYWfYsIHcvXTCy1ZVWX6gGRxVThGKGtGsqf1ooqY8qud0+bEzuLvC8ng==","shasum":"d243b8cb96909b48b7130300582095e455d5dc06","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e70cabc.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePeXwCRA9TVsSAnZWagAAON8P/REX3F1aIZi7wf6NvDhK\nXfrSpOmmCqSwO00FOgkeijda0vZZ/3IF68rHH9giWiGDR0sEke0MfaYTerfi\nPQ+0lmazaKxD5G5FJH8JPkUqOzdBbpjptbp3SkllomlcRVMc0YOZZD1plgVX\nipeXoF06kB6dAvLYUjwwkjAqH1nI6oJ806VT4vtEe9r13ShJHZlZO789KKQy\nkB7M+8541m21mo0ziKdYGkmkd0rVBGgnua6blOrQkde/YkbjsDUPoqcMRXY7\nwHMcfcxk5s/ghRxpaIfHfq2rcUGNiF3sz2oDqLlv7Zu9Ko+8UkYl36TFG5ZM\nSX/ITfKKnXXgQHhD12RKbPdwwBqKPnaYUAcgmIdP05dmgTAuKR8mTHAHbPIg\nCg+UH4NwTJElRHsVAeuEyLfuAcGM+tA0r7896ZPAwssSopva+Cz1vfgWwYX0\nSTZxgMzOIP5FMgsQAsN7hmcU8onYOOHaZ+f9UyBijbm3XSL4vSVh5TAKnDkb\nUjbPZk87vwQZHR7X4accyOopg+kXL5PzuoaA6tEIaxc+A85y+qoz5xSzWEX1\nsl/X5UzntR50AoGbSeLw/twxEr8JQ+5c46M4TAyFm0bJb8gUxCcYUt/JtGcr\nr3MLgmVqlppCU2GvlDwRScn9X1taXofXMI/oJteHqwRSLYSrY5GLr9D004J2\nzNOs\r\n=4lXH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICTJrnBg0jXTHOO888DM7BxXclopk3zchm8n/uzvi/ABAiByut2aSxj/ykKxiJwvJ+yhzkS8vsvNNm708GJVD17BfQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e70cabc.0_1581114863780_0.029410142752233748"},"_hasShrinkwrap":false},"0.0.0-canary.ed74fa2.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ed74fa2.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.ed74fa2.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.ed74fa2.0","fusion-plugin-react-redux":"0.0.0-canary.ed74fa2.0","fusion-plugin-universal-events":"0.0.0-canary.ed74fa2.0","fusion-test-utils":"0.0.0-canary.ed74fa2.0","prettier":"^1.18.2","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.4","jest":"^24.9.0","eslint-plugin-jest":"^23.0.4","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.ed74fa2.0","fusion-plugin-universal-events":"0.0.0-canary.ed74fa2.0"},"dependencies":{"eslint-plugin-jest":"^23.0.4"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ed74fa2.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ed74fa2.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Ypd081R8QqqalSHGsF+tD0LweH0P3ZYUcY+5fv3IyFyv8uaZV2KxWzrZXSBnxvRIlDl58nKqhgCZ2QULr6XdEA==","shasum":"40c12631cdcde5616320b3d30904efe49e0c14b0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ed74fa2.0.tgz","fileCount":26,"unpackedSize":141069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJePfxECRA9TVsSAnZWagAACmgP/iWJ3LkSbhZgtGVu/8YF\nySQh++rd2HXVSPU9rYHDzsjF/jE3lp713HVPNhT7GEvTumrR6olBRhnQUjF/\nqmTx4ntkvgddFfVIjQoO1sx4PrD4/WQNbCt5rqSGefJ2bZa7ZWrxoeUvIcG6\nbr+YZ1VCM1qiUlFOuR8IGsQ81J2PemKz1ZnyQ3LAdNRjWu4/TVAHBrP2lLNQ\nQ3JZN28lOusLugZRfum7/NvIdukDxOvUv3tK+4K234izLZMlezitsRfdLsnI\nYo/xx5Z1y9CVDmwB2mBTRZS/vvbLKjOR4BfvagZb2CvJyxxm6hYsjzchUGUg\nFcPhL/5B9bs8bY88kjTsC1g7BhtXwlYDbVnWLno+j0Gg2TRm2EBs+et7xPNv\n6nEpfOFDRetpS5S0kAK/1ZlLIONOYOOsiKatqDqVPxA5PAp80u+vCkUWDGhL\nKSd6hRpTW58cbJMIsiAbdiZpjIQFBdhqT2kiQ6DLZyQHnM9aKcc6wlDz3hnu\n6VMu2PoMBAMaD7IUblRcWP68254BiyVRZOJCYg5ETWVCA/PxeyfApsweGXat\neeNDGmhylxbAmCHImRzNcW+ROI6ol0tPO0bQubSN+4MIb/P79lLBW9M96eXB\nXA4DsdRLylBwFiEARxTcRavmhqb4mj/J6K9qDHzQfei5eiHbWpuloJ5ibvpn\nhMBa\r\n=DcnD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIECJr3ZdNaHOmHe4kgYi9Za1+LZQxop7MzK0ZKXdd73jAiEA+3fah8mYw8YRagFXP2fEbK2pW3OUlPEaIQZ06wFrkc4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ed74fa2.0_1581120580502_0.773304787629618"},"_hasShrinkwrap":false},"0.0.0-canary.b127562.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b127562.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.b127562.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b127562.0","fusion-plugin-react-redux":"0.0.0-canary.b127562.0","fusion-plugin-universal-events":"0.0.0-canary.b127562.0","fusion-test-utils":"0.0.0-canary.b127562.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b127562.0","fusion-plugin-universal-events":"0.0.0-canary.b127562.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b127562.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b127562.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-m71//ww/DuzoivuLMHRNUrx13wlPqmsJcScWaXKeWi7OLTJ18HpAnz4uW6lgzjn5Gcn7gpr2HfP8zcyOcmHknw==","shasum":"20b7790c07f8ca6b294837f8360381892bbcbf31","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b127562.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQgEMCRA9TVsSAnZWagAAWk4P/3j05Ap7SAeQXg18c+/L\nSM0hk0UG/YmA+U7PaSx8Q6fcaZAzm0ctnGuuEDykM9NFyA1ZlHjZBk/m3+Eg\nH6nN9G69B2XlA7v4AX96qUC3mNivL2DNj5URpzgXf4t98RbPiWmZRNVkVl4F\nfYTX+nHj+sw/1zUVY/Us5R840rlYJnh0TvH7NxcxaP7dVT41VScBXRFVlzk+\nfaqqYVTnvcIp3v/qCiq14UHW2runK5gA18khAcXHQEEjSzg5OqH0dtR0Lg+s\nuiSTK8KPayc41SPAgK6uH8ZbBCGFf/6iqSXcn4BdRgjOJcS+Bvdc1Em42IvX\ncaVfAVEFwu3xSLangKnx5jppZjD0Wr0fyAz0KDYjUsjzQmxVBq5fBYo+4QQD\nkMXkL4M10iuoFpNyfMKmVWh/TzrEspIP5mTRPz+VEfbueqIDvROfzDb74DPb\nLL+74V05zvkjUovd0sFk8A+SaQG53pmbCA1QbCoWukm55lREjk92JCnAd3P8\nLdWIX/gG/aHoWewnJ//o1gL4CZGaxhvuZpbG04pTe0gu3QXPU3fAW/eXjqV9\nTd1ADBJPRnZszA/Xz/wjrNbH5wRzp6WJiY6jUSqAalDdSdyusfAdJsdAIv1K\nW0N0hbONr7IDcqGO8FpmJSKzAnzWtvNW1cTgaVVHKNVieTdaWUOGI4mt8XUy\nGlqx\r\n=OqXP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL4KUIbSKgMksnQTlSae+p6d67K0CuYAhOd+zXhvB1xAIhANixdWEfkN+NgFhJysof7gNUVzRA/DThqhpLIqxXZN0D"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b127562.0_1581383947532_0.5025150069014814"},"_hasShrinkwrap":false},"0.0.0-canary.fee0408.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fee0408.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.fee0408.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.fee0408.0","fusion-plugin-react-redux":"0.0.0-canary.fee0408.0","fusion-plugin-universal-events":"0.0.0-canary.fee0408.0","fusion-test-utils":"0.0.0-canary.fee0408.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.fee0408.0","fusion-plugin-universal-events":"0.0.0-canary.fee0408.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fee0408.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fee0408.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-ZfyZAvqazHA9/CODYSFI4h1RumtQ4O/0yoZxSDPQ1wr/MAoy/B+5qdhNUh17V63g5poWmYZDEDhv6W7XI9ok7w==","shasum":"b69b331f9f716ffc0bbe658d83bfe99c1107de60","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fee0408.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQxNcCRA9TVsSAnZWagAAmOwP/j7oG5uzO3kyI7/SBy99\nqGS/dN7tQK3STWBJGHWBH/8bbTyiTeaNNNsA4JL/zgokcETNW1tBUWvk0PSU\nbiyCYidPgLpVcH+aLk2Ydea1RyE790RnJeAkeK8CLFw7EW9w/RojFVSVJq3X\n1gS3tMRKzVrQM409PbQ1SE/3Dp4XGWpEAvKNeMPgyRYH1NH20qUXbN2uQu09\nv1jcB5mnlVj7qQDWUqF1Bxp4yBwR1zz9E1hUO8wSyOf+uMp/vpcdVwOKYui2\nAVniskMp+bNYlm86f3vpHMgmIrejQ3URBuCqhPIWNGkKOFiRgaleqW+wP2CL\nxAFPMfnfelwAHsXwkbzZhQmv5LH2pCrk6BhMt+ZCcH/XnLS5BmxMqsezh/n0\noDglI8MYIvjct51kua4xQO9Y0I4n3r3BqmWxzwgha7k9FTmpehunK8TQPC3D\n2d2QbOtH4ALpr9csXkwsgDy2XyHa7xRoM5hBtHH9rs5kDDfHE5c92SCNNXrx\nuaryhHfqPS4kB69Pg+wGaa+dfQejvy1Z3Y0k+O/IJ7rtTyVM8DdqKBaGOLrU\nUcQXni8dwEOkLUY0G8te4PkpLCfVUm0fEJFlDm2+EjGUqHT/zwX66Rawofc6\nm0MU6oT+VLAHAIPrwJ0bPFaGbGRMIPgwi8Li6/pmcigWhq+OSTYN9mSFWyoq\n1iGc\r\n=GX3/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNlh1TiJM4jaZjMei/o20aHWgb+vDT7qeyN+ZiTOqJjgIgZHvK18u2k2XtF0R9aGnQbkPNgjGDLcNkUNhEeizBHZg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fee0408.0_1581454171725_0.9645410510938035"},"_hasShrinkwrap":false},"0.0.0-canary.9dededf.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9dededf.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.9dededf.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9dededf.0","fusion-plugin-react-redux":"0.0.0-canary.9dededf.0","fusion-plugin-universal-events":"0.0.0-canary.9dededf.0","fusion-test-utils":"0.0.0-canary.9dededf.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9dededf.0","fusion-plugin-universal-events":"0.0.0-canary.9dededf.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dededf.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9dededf.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-WBJBoc8k66yKoY++JHA8hKZYkHYr1jixbEDuPOhRsk8rHUYVyM4lAVMElp+c+9U4LtnkG5oKI/OA+oO5QXl3Fw==","shasum":"81313c952a43b87cac93bee58ec805134b7ce8d2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dededf.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQyDpCRA9TVsSAnZWagAAWgIP/Rhsg/NMTz1/kZNJ8PS6\nX8syxQlDEPocbiyeyh3D8BnZxhNlXpoH21kfAU/AJocL0poYYAg0Keukt3iS\niW4s4ATVYtnjCbTsqSNt0cUOCQlfPW17xdXAZIP2Vw6i2KSKYB3+JB/S7h7S\nbRkbCBA1bZnlY7m1amleAA7u/WkGGwJCSgDTdXin1WG3zMMHSwX2GAp8Guiy\nTDxIWQRgtAEMn6oNOdc9e6vbF3LaGakFyTkQMIu/ilzBWeA6xcB3QdH7wbtf\n89ePl2PxPt8ToD2PtooZisaJ9YpQtaNMGct0UH4miiqCSqGLJ8FO1mfUFOlM\nlpKsJMB+dH1zL64zEtbIlsoetwrcUpfXa0OnTvffEWysawhIUp+63U4FEMaf\nJ/3OxdSRy9czXRAgjqQ9AEqf7T1MitJv4TgwYfY3zHJIR3U+mFm4h8/CoJgK\nR8uhKIaVI/zyyT0YJ0PQKq2dND81rQP7r2c7hua4fi83tbEGOKQMOHYAnXwN\n7ab6xXh5llXC7zGbBaC0r57tCtSEHhtRn9mZAxHBEWNLPxjE60MU921+sil4\nAKqzIYddFRz83pzoaV1pfh0DksdAqd8rqf3Nt18RUf8d2BGvNxQq2OeGESIe\nHg7ZdovKCltKBBrshD3m/azkXSkQPiSNqiiKVihC10RnVmZywRzHRvSc6RNJ\nuGm1\r\n=jVUV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxeDJL1J7VqQRXsBtO6GwIM68NswTKFF/chtvwsw6BgAIhAIbALxARgvRzpu0CTnq7yiHWbe4HguZxnXiRwyuuVXA5"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9dededf.0_1581457640701_0.1951318910037234"},"_hasShrinkwrap":false},"0.0.0-canary.9dededf.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9dededf.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.9dededf.1","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9dededf.1","fusion-plugin-react-redux":"0.0.0-canary.9dededf.1","fusion-plugin-universal-events":"0.0.0-canary.9dededf.1","fusion-test-utils":"0.0.0-canary.9dededf.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9dededf.1","fusion-plugin-universal-events":"0.0.0-canary.9dededf.1"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dededf.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9dededf.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-3CtYPNWfCKm2mWTAh7Xpm0ytXBBLnVHUZ7ScTvy1pSLW3eeOoHX26dxn8cYSKx/0VtN33tLS0c2ZceqN+mY/lw==","shasum":"99a93c24b3f3b81f9163304e158064fcd3d70a2e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dededf.1.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQyHwCRA9TVsSAnZWagAAm+UP/3Z05PfZ+r5hPlpKcZld\nqP2+aCrj8l0PfldtC6L9wfHxhOAcYKwbeO9BFDMHFR0xG0dY72NMapFq8eRP\natplPg7JGShY/A/I1C3qVL6lrXo6RhQTM3RiU+AyXuDpt5J+7LEd8FbAs72N\ngsiTkgrsyDb1qbO0PtRrfTQeeDkMevZLA0OuWrmxXCtkujEq/hVwNtx3P1DL\n/znr9gC5fAXSKSOnB0UtFOQVt+f5LocS0qNkwLoiHed6xSkPkSA/rGBXXEbi\nDtYDKLvF4Mr49I+0Uy7Cq1ExvrgfggmnMYXib3+eZdPyzOyeNZ7hQBZ0q6t6\nqrAEYVJIP4ZnK1DjlVLtYExESPo8oVHf3rQ38E4tEQsLAbMHOl13UAI9v1xr\ngGUw1k2OpdAN2zh6Z6QmCysv62mjgTtfYgiJcxO3NYDbHec/TEtSdkkg1OLI\nECmpaSeP1RNkboHXCMt2A9Oqh/PbSB5xGOJw0DzAzFSQbcQWbwwH55bstdSN\nnIMua9spObiJN/LIfJJgF0dlkBRiHa8TI0fs6qG5Tq8cpLvlCwezQtSyOSGy\nfRG+gSzvhpOus4e+o0byjj52zn8icYYBJxg/LA/WRFwLpPdzeANOlDULe8Nx\ncqffI/3reiznoo1XdrQGzb5SqDxIriIUOT9iSAzqxW0gkjWVTFaEC28/7GWT\nAfiI\r\n=Ws58\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBhvnYoHxweGU7Qqpxkzd35PUYxrN7dcmEO8EwAKC0StAiEA7Ufvf9Tn/p9bQ71FWfC4exya2t+xw3icI+28NnBIjxE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9dededf.1_1581457903894_0.219666921198298"},"_hasShrinkwrap":false},"0.0.0-canary.9dededf.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9dededf.2","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.9dededf.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9dededf.2","fusion-plugin-react-redux":"0.0.0-canary.9dededf.2","fusion-plugin-universal-events":"0.0.0-canary.9dededf.2","fusion-test-utils":"0.0.0-canary.9dededf.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9dededf.2","fusion-plugin-universal-events":"0.0.0-canary.9dededf.2"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dededf.2.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9dededf.2","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-6UUtJ0lziB61S6dU6G87THPfNawdGP19BRzzCN0rzNAmPXCWX+yySIlELt0dAipdjmWJc7bIcDGZs4110PkSyQ==","shasum":"ccbf360ffeb8bf238c09ed4bf04c93582ef408b6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dededf.2.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQyOdCRA9TVsSAnZWagAAvYEP+wS/DYf8g3Cz0SQNDKP2\nycncgWzOy0fvfdf2W67kBlBLLlElPyqg8+jsEwsD3JT5JKF99Lx41olMS/z+\nN//Mwwh/YOoRi/VOzTZqooXRjHvNit1wzWFkZVpmnmhUzlRq+3dAy0KmGlEK\n/z4S95xKqe0fbNP1idWoaAdfDU9fHUEQPdzl4TOqnGtR1zWXq6Dyd4nNgnB6\n5ZVJhyL2gsmxKmuWEyF4tge7VFJH0+DZwNjGbXtnICho5cQBO4AqUN5uX9OC\nCbuFk/KPhfGQnYuV3L+gDXnRJdnvQ8+Dp4huTY9DitjvUo73Q2CobnUXypYo\nm194zXQB3mwhdo2n3zcnpeEi26Cdnd07N5/guC7P9qICQSkOnDODaob8XV28\nqMgTQOOXZML8TiohG97/wumV8MlV00c9MzYfMu25Fy0mn///jrZlsGgLVims\nJla+9Kbf6Mr6LrdNG2retWY+Gsf2JEinl8qdyAF841IIrWVZ0P15ZT/ImuH3\nFn9yfFRsiKZGGiZkosj6sONo3uvCTifwKkzOGTZdt48cuBG/8x/m6EpMw2W9\ny3/QatmMglPcxKWfWA7WEsRpdbBMeuu0GXC0+knhmdqvTQmFrC5sUKdTjOPV\ny5kwkuVgMZSJwjzl1y7gi4fF9xlF1mTmp0AyD4N77m53DSPZtaGJBH/cmOGD\nfZAO\r\n=QHa5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxeLkxlpnO39MQq6TrlbQ219VJv/rG+wHLH5PeHOkjoAIhAP6VTnvWhkVoC2hFHAjpXAvfWyhDfZzRnzFOFf7hG7mD"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9dededf.2_1581458332678_0.7502900681509208"},"_hasShrinkwrap":false},"0.0.0-canary.9dededf.3":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9dededf.3","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.9dededf.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9dededf.3","fusion-plugin-react-redux":"0.0.0-canary.9dededf.3","fusion-plugin-universal-events":"0.0.0-canary.9dededf.3","fusion-test-utils":"0.0.0-canary.9dededf.3","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9dededf.3","fusion-plugin-universal-events":"0.0.0-canary.9dededf.3"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dededf.3.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9dededf.3","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-jzLZ4vGL1a7sp62z5LUkRc9bmqHpavPy1HxWwrKzF/54cL+HEEDLHpbQCaFPDsSvPkrTsVjmlyZd2jNxATo+Cg==","shasum":"d3b144fc23938ab1421ac69bc834f27a6d75e71c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9dededf.3.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQyQ8CRA9TVsSAnZWagAAbTgP/0gLCa4LyfdGIacHsxJ9\nm4D3bWeeib7ssuNCkAHzp4zDLeSU3Q/+ocu30JH04J56Twqq68hCePZgF5w9\nrYq9S4Be8R8XF0tpTtfMmy7QTAb3tkGHd+a9JFemtBP9NyVcv+QVqs282+W6\nPc7EqFiN947E5wPTApxMYqJHKHZtbGmDD9MIsRUtZnz8lCQcQM1OKqMVrBN4\nzP5dpEdM2i3pYG9p3RvuoPgxdYHFz+ooqszoucVzV70ua5vMo3nkA0wWQDXx\nA0nzxHDaFIAwqD+5jNlFJQdGDfvnRLU5mW7jouVjlgYnj9pKjHPAxpI2YlK+\nKI8F4VPsoXEaUqBISgfJgtAiklpc4QeLKH8cuH6Ixf3ecffEE5nJjIHRNKN9\n3DHDx1AIuZmGOYIvI4YBtU2xw7szxcbJl/DW5WCOjCmiQnQLvihNFUg4JOVX\nSS3UskaoazQhoB7TyFL4PR1JhHbmo8qQ+MgL4uvdFfl7FlNfIxjDTcESOe+J\nVxvmXKRXx3YmzTIy7CA524Z4/sXJS6duztLe2VXJhMg8rmlMdny3wt0+V3Ha\nVlpFlDMt5htsGyU2EcWow4bFjIozR+vcyqOPsm//OYAtm8PO0Mut/kOA32YR\nnQO1psyzhzVHkJZm2ThEoPhQtmBFfJkRX4KDkiZb44TEMNNy/V5JkdqP4j1A\ns31G\r\n=evBD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDS2kZeXo3y0/CKNa7hC00L17wvqZ20DiJSAbkzf7dkVQIgBJKH7rdd/ylR8NkywOdT1t/DQ1bHdSBXcCN00ur/zi0="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9dededf.3_1581458491587_0.39297124991676236"},"_hasShrinkwrap":false},"0.0.0-canary.a0a3534.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a0a3534.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.a0a3534.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.a0a3534.0","fusion-plugin-react-redux":"0.0.0-canary.a0a3534.0","fusion-plugin-universal-events":"0.0.0-canary.a0a3534.0","fusion-test-utils":"0.0.0-canary.a0a3534.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a0a3534.0","fusion-plugin-universal-events":"0.0.0-canary.a0a3534.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a0a3534.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a0a3534.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Pn9j2+dkMmdkXZ1onUQbc1JgW8ooGpbw0CkfutodGSqcg+A+E7LhgNs5H4SS9dm5g2TBc0tSkFeQ2yjRnNSq/Q==","shasum":"879cab28e540eccf3b61bd63ac758c05fa02227b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a0a3534.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRJcCCRA9TVsSAnZWagAA9RMP/2CRpeTOmm9JJZrHQL/q\nddTx1qkapuRTIER0A6yyjGSpf6wHY1ujnQvRsc4Aop9BsBGIromtHQ1W96md\n5+B4UiWkhprYH/ZbJaFtbAkghFNgvXyXVtOh31zdQRmfyEFwBPIQiOYIhiFT\nufMCGb4qRn0LpA6q1Wg9f988i0FxqFojaC8WhcIbIsEtVdr1Qd5ZwJ8cGrIZ\nAv96VISoSaspznwUZGcpO/im7z3U9MRqhkHhyaDIJfDiYKkBcVwxmggSytUa\n+XQLH6MNYfd9Py5If47AjxlPcA9KvZV/wB7SaAsJuLFvbeenXVRAB8ofeRgF\nJqXeD3yjearTfnZoiNrDwJZ32YW/XX4/saBn485lTwK3Ocw7tq7Q8MdaJfH2\nbqUuMxGHVCp4JDvnRa4zd7gjy2LunIH1urcMV0RV8JDEQD5bh1s8GV+G4F98\nBBpW5idsAqSV3geidGlXMbJxlbZXYcRi+HMeefYDxb40rQQ3TLF9iRBB6EYE\nRDGtMK88xaOpy4MStEnc97IxscHDI7FdYyVGYk/7FAXfwstekSHMFpxxqwua\nCl2fhlGxrkOW6i3ZehDU8nYL9rq/7A/WXs8U4Q3H82oLob6M6cfmoHDpcrhk\nBVKEhaEOk7OxPONLemZytd7zSuDUby5AgfZMu3K+gpUbjolsnu4igN1IB/Vv\nafZ6\r\n=rdFX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDtZOv053vTy6xmVaqDNfrs+WOlBxLiCbbxJSld+fGrjAiEAmIjCUNwO8ijWPWWtYa3ELIYBD0H21iYx4MbzOy/aino="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a0a3534.0_1581553410238_0.717855256104974"},"_hasShrinkwrap":false},"0.0.0-canary.513dcf4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.513dcf4.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.513dcf4.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.513dcf4.0","fusion-plugin-react-redux":"0.0.0-canary.513dcf4.0","fusion-plugin-universal-events":"0.0.0-canary.513dcf4.0","fusion-test-utils":"0.0.0-canary.513dcf4.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.513dcf4.0","fusion-plugin-universal-events":"0.0.0-canary.513dcf4.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.513dcf4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.513dcf4.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-sUUqqTP+SKRDbBfXaaeUrHlzg4U6567x0fLv0NpjPhnjLEk57yvSbBrIgZZXdQYK0EBc/pOOTHErVIcmvUZz9A==","shasum":"f34c2d0a64a3dbc1a701f1a563c540af28825167","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.513dcf4.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRJxuCRA9TVsSAnZWagAAAgkP/2shvGZd0Nw65I0IUaA8\nhLTrhdhEe9BwpzsJfiHnAt8wM1tRdjkBbe3SYIJly2XkCWeqmqEnNRIbSUVU\nlIGpnX1M4GhYiqagoTwro8HDJPPQyvnwLALwdgDZTcdpm6E00MTGgHicpPNh\nw4aMqOIPVOxnDhgEk7xGr1sISjPan7PaOgFuW83fN1BvIF+LFJbYNjBPORO9\nrqCVGG6PbkmycE6aUc3pSMfYR1r9s4tEVCsNVN0b6BTg+0RbK6NSHEeW5Szp\nYDoRLQlZxik1fla0H1UMi7bExi3MyQhQAO3PBYOiRDh1cba0q8wv38FvPENm\nWPq57p4QBthz14/FjXFM3i1FiGErMKcqQpRpvpG7GxtuFymMw2xoz8mm5LM7\njttlTpuF/WiSYqCi1oGZUO02DCqBX7pnAd1MXkcsLSOMDKLsBfGtNEefGyn4\nBrtarfgBiHdwjK7vC1455L/L9AuAQK0i7CjIdsIKyeMlYGytSOWUIqumfEpC\ncK58nobE7uAiXn2sLZxBMKpSN+qsFDCTTgHbC2Q/L5YolkIHYHfnejW236Er\npHl78gbEgRdlrMeWvTbSjHa2jknX1M/N7VCpkFEZjxPUQXFx6c2VQi5NNq1Y\nqm+FIcTIIV2qTiwVSSvx4C1/Kjbkj9DLRRsQ1AG0Nrn2d1tVTJZYZ/8+KEq/\nI59K\r\n=oLuP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJAPFHNE4RbqF6LT4nwrZZs6RG3MR8B/b0iie4qfZsKAiEAh+7A7mofKrXCmqteeW2R9IMwy3caSdUhOkahYVsz0rE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.513dcf4.0_1581554798011_0.1802467730118742"},"_hasShrinkwrap":false},"0.0.0-canary.b276aaf.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b276aaf.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.b276aaf.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b276aaf.0","fusion-plugin-react-redux":"0.0.0-canary.b276aaf.0","fusion-plugin-universal-events":"0.0.0-canary.b276aaf.0","fusion-test-utils":"0.0.0-canary.b276aaf.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.b276aaf.0","fusion-plugin-universal-events":"0.0.0-canary.b276aaf.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b276aaf.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b276aaf.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-L2vIGLZ6xP1w9bU6YOLZxDZ25dHsdDXJVnC58iBJDkjNm2hE0u6liSilBKpR7vG8xNUF5/BmzL1Z0kS5ZawzVg==","shasum":"857fed64f87eaec1b7db4ed8ce4bd39fe09ae0c3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b276aaf.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRZw6CRA9TVsSAnZWagAA7BgP/R5RbiscT9TtCpaj+MOZ\nGt6B8gHcIbGvXCajJqLcotvrY5EdhANHSmC4qVyC8tTLoQvNOHT7RnUnkvkb\nIAVN26ttOTg66QqiG0GtB4jNePhLC20AfN3V4NkHsNfBKc10DYjgN4+XeSvr\nA3/QpaJWbcfdC26l6N6j4JwS3cVu7uhWMwjHUCjLvmmzpTErUi1hCK2Fhp3s\nTHG2kwU8MupSqMMQl+1EXzuYM+2nmdnR5t2mEtsR+bRwD6MEuu/1otnfcPn8\ntITmRFeF6G8RCE2UG4m4P/gRofDEKl8I4cjS5O6N1O8CLcxcych5BvKCjRj8\nodR24cxq4dShNpjcAWLZjrh8WFfc6bUeAn1RAuGa9rFMhplwbrb+Zy9wqxzl\naW/QWt4E/PaK/hIjaorTCvUJg1O8KTUUT7O5v6XmLHJpMzjhPYb2YxFxG7GR\nUrroH9G268KSicpmZtrYBil9lfbMelECD2f7Pu/lnKOxh6PnAFIuCpI7CUzS\n05Mi8rB8VYQlTdgDeqIK2Pw2tbNM4UN42KZYi8eTiCoGb/OWju3JsY74dVrX\nfivv+Ws+ojM1NAt2MMtb4WF6fgCoEaanPGFOJIjHEU5M7FRuHhIFsbmdYug+\nw8athxvj9fCTZ0djJ0KmKY8ZaeD4oy4VWMFSCSKZw1EQRtyQlVuO1pLHhBKU\ncASm\r\n=0nnH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcIIl/K6r4Pg7hldjBPLlaj1vibLjfTYIKqqbwXo3+RQIgdJpzyLFr88mepFKxQ7DpqTrUHGuubX0QuY/wz5bIotw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b276aaf.0_1581620281557_0.6010119818522524"},"_hasShrinkwrap":false},"0.0.0-canary.a8e624c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a8e624c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.a8e624c.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.a8e624c.0","fusion-plugin-react-redux":"0.0.0-canary.a8e624c.0","fusion-plugin-universal-events":"0.0.0-canary.a8e624c.0","fusion-test-utils":"0.0.0-canary.a8e624c.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a8e624c.0","fusion-plugin-universal-events":"0.0.0-canary.a8e624c.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a8e624c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a8e624c.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-ea5Mf3aB4IFYEnR7HcJB55soIiNM07640Zxk4UxrspGOQ4U3Cn2lAmAiuobiHZPIzvDvqOl7E293QV0PH2FVJQ==","shasum":"869139170d779be712f77e707db5b7914edeb18c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a8e624c.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeReYJCRA9TVsSAnZWagAAiAYP/jJWRrPhQ1nu/0T5LJuG\namfuha3q27/G/XF+v+isUO6jXfO4FDtZQLwR5Ge3q1gZ3IfXi9HKWcoEcFUk\nnjhOBQBL0EF4/ih0Li0Q728Mz8kAo0m6IorrMKVDOo0Vj1J7OmHGj13pHUUy\nvpifs14vNa/CjroFZOr6yeXjpPH9Rxpb00M84vDq6JybjkohI8vGu5qljuFy\ncavi1NL8Srk6qRdSqd15hzMDdewGKOuqqjNVr/2Ntn/lJBioFGCwnFpKRajW\nKuYCvaoLMtyTdjCCk1sF1jkVh946amTyiNhCcGLZDKFSjYJdzmPJkTx7pHlg\nKkZX1IaIoZXfPoXcRHqt8AyVdNiPrh4g0zCBDgUqe0DiOTCsJuXQqfBwgc0J\nKihUOrv1/fvvT5Qh9ECKOO4ss8P1hsqRKiH5rxPj7WCUd5SbRPHDulYcB32M\n9G+JirR2J1uPjBiDnFSBuMSAlb6RijTahXQv0FnQ+b4d69XsYB1HFGc01RLC\nCf52PUKTRkMcD5GZbIxXfoZLn0tEfp8i+/rinTwZ0AIYe93tJ6r0THph370k\nWvTeTsAbAEuHq3RONa4fWuheMjZGZhBixMESaIugkBuywyWDZ11hsu6S80ID\n6d9ADRRcvbhD+iWUoUMAE8jy431JqdGiw/U0zxfgzXPxeub8gRQDn2sauXUM\n0FEx\r\n=x3oH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfw8KHciHRWQ/QJFlJvIYtQDVKeJqm/uYMGsTSyRVPxQIhANck4YnBK/P7nfkr7OANXLLA5wYWygah+wivFz5e64ji"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a8e624c.0_1581639177025_0.6659915507928684"},"_hasShrinkwrap":false},"0.0.0-canary.2661049.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2661049.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.2661049.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2661049.0","fusion-plugin-react-redux":"0.0.0-canary.2661049.0","fusion-plugin-universal-events":"0.0.0-canary.2661049.0","fusion-test-utils":"0.0.0-canary.2661049.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2661049.0","fusion-plugin-universal-events":"0.0.0-canary.2661049.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2661049.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2661049.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-+7sHEBlEbZZ7Ypn5MEkBQ0NO/UeFvimFirzyC/TY9IX/YIiCK0xAWWa2OOSw5XwhTAypt17qsH8MmrFzPNK8yg==","shasum":"3586edc674e2b401c5e4ba62e9d562c371c9b0d6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2661049.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRfo+CRA9TVsSAnZWagAA9h8QAKHNWhpKTQxEiZat7vJ7\nmkZacemaz43HfoDWTVm5NdoNkUXYPt+JCoZAa/wUobUU852ak9G/HzP6pbkT\nsyJLSaAdfXrZBtFi1UT6uKumB9WEMEQlrUSXFImrGNxkuWXXMmAQtZ4aECnB\nP/sjX0wqT3wltCwitQG3O9Tbn1sNhBPd9/1jUE1Lu+WsOqpVl1xToSwyJLWP\nLUK/Ax84G/65QjztV2hHDqRlLaSupCKNyizZCrBbfUB8XbxyaRa2x+KvGTIJ\nh1v+pxrvB8gJu9NGhRQW/AJAZYurijXLtFC0kgxoCndeLpi1aPwlapTo+QMX\nvTNBZiuGmtkAM8EfxdcgBHNQvxs4oAGkcK8PKqc+S9cOxwj2ZASSw5sSZuL7\nKsNDkP+PhijMrv8f9Vp8A7NsjjWPM6Z6+dj0XsTHKByeOYcjKq4qTyeAxQlZ\n4RxnTYCptgYTSAL0PbE91BBn34blw8vSZY+RihPr8ruCgmdnjgMF2TT5UiPV\ncjNZ5qksnmIHegpIZKmMvzPO/dtNIW1LOxJtsdHDkLDjqEN0pSuNTvVOvVDo\naAVlOEIZyqmiIzhK86BeGYCdMzOMIgQrf4PifzgrzbRaBpQ155l3+vgRQUkv\nf6HMqxFWQ6B2KO/ukA+cMUF9QNM1dZvEHRnbgMQl2jTd4CUHC2+tkJMWOmKo\nz8Jj\r\n=+u9o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/PNjvdoOFYE3BUQGPEjLbeqrlMWGW55tLSLS7/vMP2gIhAIhE8AjYGZ5yLp0vM7o8sUT3dSpS4uqRB9QFGP6Wn8ps"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2661049.0_1581644350384_0.7384865498369546"},"_hasShrinkwrap":false},"0.0.0-canary.2661049.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2661049.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.2661049.1","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2661049.1","fusion-plugin-react-redux":"0.0.0-canary.2661049.1","fusion-plugin-universal-events":"0.0.0-canary.2661049.1","fusion-test-utils":"0.0.0-canary.2661049.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2661049.1","fusion-plugin-universal-events":"0.0.0-canary.2661049.1"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2661049.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2661049.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-FSp0WiKm35L27CmOdDiRvibReOL7t99vIslR0dZMA657sskZP63BUvcoWYKIijifvBdBd8uXK4vxxYA1TF2JIA==","shasum":"90cbac268efe3047a3a1d7d9abf1ecfa24be0ead","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2661049.1.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRfxmCRA9TVsSAnZWagAAohYP/RicTL2xNcqLuE2pRsbs\nLWLT2sLJjnxEbiC/fVZM81QUYYrFBqccImlICYjiIGU/zfQ0h8hCtd1ehh40\ni2GigtJb8I6SgVgNAq/ebcocFrlzuXhkQdUAFHwte7jrjvI0Z79rccJH8vRX\no0SAFP6O7ILfuBNUx1VWTSHKJMcHU+VwchcRhztXQO8WIB7dxvM/lbDchQM6\nHyDiFE7Hz3Evwnxtb6QkFRbhKUC7f1U9tO6NWOVDL/9K5ujp437N78AXOCud\nR1vHRmZk2s6053WYq8qPCi6Y4sUOPccLwuhzQQ/4e8G7tV01zt4Nq+FZ3vhl\nd0Y/ZOLt7baIXMdmpqOZxoK+/oxNmthXkkA93gzL25R0b+AykJ+Zsd53Mbwi\nzQq0GViUTLBPFn3VSe/0z//btX+wgXbQoo2xBJxYKKZaeHJc14nXMwM+ViJv\nlffsirajgOEI8glCDDYyFz7FnXgilB3YGC7dvBU4u06gNxZojeZxSA7pqnru\nrVwFNjSY3q0jaxsqFlZBIcORlA0KAf5bro+iU3vpZDhJwoON3DVD43zF4HsW\nsWq7ZT2IVr0OrVGOiMGBJ4qwDVXGWWIZu1HOC9WT40QXzxaeXMAKCvv0tC+o\nyHZd1vqR+5obVzLKAci11RmGPcx3NqljoYt3BobK8xWbHQRpMt2ERFa/Fprl\njVER\r\n=n02y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBjqoSsnN3oPUPcOCUm3o6Bpn8b63vy+M8+2HbQzDj1UAiBnCkFTzxS45PNPUJ1AZcSuH9xSi8RMJHCvJxzMCUCibQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2661049.1_1581644902430_0.4167346538281522"},"_hasShrinkwrap":false},"0.0.0-canary.7eb4e1e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7eb4e1e.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.7eb4e1e.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.7eb4e1e.0","fusion-plugin-react-redux":"0.0.0-canary.7eb4e1e.0","fusion-plugin-universal-events":"0.0.0-canary.7eb4e1e.0","fusion-test-utils":"0.0.0-canary.7eb4e1e.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.7eb4e1e.0","fusion-plugin-universal-events":"0.0.0-canary.7eb4e1e.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7eb4e1e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7eb4e1e.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Vzs/hKpWt7I9E6KxQuRoyxsAD5QbMogM0prNJc0uorcmPPHROeGci5yypgr0wB7LjiGnpPRIjs+oJuLZ6FSFvA==","shasum":"8570e7a85b4addacdf4b6ff86ab63010ca77fd52","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7eb4e1e.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRwAFCRA9TVsSAnZWagAAqg4P/1einVGt3nkgHFQYwyhk\nPcaWBKZkxB+HNah0XyGZ1ORytA6lFORBuPZ6WgilSKU8KY3nwx4jlfzcXfsz\nOMtr94JNguVoNm5fU86P+qbH+cXCD2CPiolONc7DqqocXd971l6cooUdvUCC\nsp0sStW06faAY7r/+R7h7CuAgVT7RHVj4+ZAuI6rpyrov+uUA7uFv1YOKYMJ\nqMptpK8CC5XSTUtNN+Ruh/rleggyoazIWFTzY/2sRcWTmZKgoOeyrRd5Lxmz\nT1+n3mIvz/6Rjiu11caTwHwbXJ4vE5ceI6AYtxQpyxPjH9dWRgZKIDLTvMN2\nP2katEDsM9VvW8OY0/HDcFBJpFV+EbZHfYggzm3wiOcKDAPal5TdhRq9UxUI\nPlFL5AXO8QQcZWJIt8TPf0rN9UCYzQiQnYdjjYsNJ8gQ+2c384+JI3xYoZWK\nx3Z4D+UxlDoYx32wIXUYc84geB6hh7iorq0d4F+4aL6uf4OjVRVXjgo2ynkQ\nM2KOgtl6/PQ8cQj7GUqgrPJJT6XP30YLsFYQI1cN+nsAnC3JOMdCNd5p+k03\nyKTd1DqcZb+aWTULr2oVAN3Ympsf/LN5Y75x4rn6FrqEuuGcpSRTz1l+N+Lo\nIgXBQieChLJsog6dtb2OM894mCLFN9dvTIWPxxBDt3CVuAKFbxv9S7SNoc6H\nt5ZX\r\n=mZkv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGQdBlyCTxLtt+7O+PzAyJy+G73NgEmwqhUfFT6BARCFAiEAxZR1uVFGi5wcqtOQNBPAawAk9wYfjHE137ZOfjN9/98="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7eb4e1e.0_1581711365413_0.9487012412840841"},"_hasShrinkwrap":false},"0.0.0-canary.5e59509.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5e59509.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.5e59509.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.5e59509.0","fusion-plugin-react-redux":"0.0.0-canary.5e59509.0","fusion-plugin-universal-events":"0.0.0-canary.5e59509.0","fusion-test-utils":"0.0.0-canary.5e59509.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.5e59509.0","fusion-plugin-universal-events":"0.0.0-canary.5e59509.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5e59509.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5e59509.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-bestB2g7Phq9EOX3vF6MqnOS/NS+XAJMwWnLyhPvcrqRSSoqnLq5qTDgpF0dOa22L1L5dr8eQm5qR5NDHTsg6w==","shasum":"3f263429c5b8b8c56523a9d3d939ccda9ab8d50a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5e59509.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTH2gCRA9TVsSAnZWagAAXxkQAJfscW1GRLaBm11sgjxY\nlhVqu4WCQrSKPR4fgQ/pbn78CbL2LaU0sq3LdMuMfinRc5OBJvyi7gJa8U1/\n6KT0EYNGo3PScelS1i1/lF3KgnHzFpNDuvAiiB1wGNruyk0Hl5xxC0YEYS0I\nkS3ah8lUdmWXO1/1jwwfbx4wEOxfUiMLtOth95vQFOUef6+R+1qBnoO4Xx8N\nCOT0ww+GFLQLM8VojqNLFPUOL6lV7fcNkFmhlgeYhAsAtLlw0WzIHQ2mNU4B\nN7/dqLiU0hnkA5UFdhQvzlzzp9PnPFH+LpIsvijN/gJZ38grLOve1zIrYl7x\nO5TmcDRYkCPHBkuGJPvblx7ZKi916oeiGQBEYOp0kjv5q7dBMN2DkV4y5lKA\nNI9M0Gb1VWEb2Yok/Kl6R8emox0KnfHZsOAfIY6YnIFao3tU1QkKZwHc3Pai\n9GosNi/zqx6lOn2CHSaG82lJbHrBm79cOcRr41OwFb3qQhz7XYn9SElmVGOG\n4AhrOw3AZ1TX5E09TBmYe61Vm9NT34olDMEs2M8pAfphE48hT0rlRpzRwcsG\n3EILmrm6WEmhz0W3meGhl88MbxPH8KjWE62pFej7Ju+a5Qb4nlwExsFwle9p\n/+qGmyJY/f2pYLpf5N+8CwDVKD3cef28F15mUHjeR5PS0qYVYTRQlfg/TyJj\n6b1f\r\n=hk+h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDbLy6QhUConm0hA73J2oV/OmyccJEMvjPXh2kA2suFwIhALDEAwgU9nNBlvxOXQj7I5hS8Yb6vRWrgqcSBQCwjIYM"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5e59509.0_1582071200310_0.4008975804950894"},"_hasShrinkwrap":false},"0.0.0-canary.062c690.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.062c690.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.062c690.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.062c690.0","fusion-plugin-react-redux":"0.0.0-canary.062c690.0","fusion-plugin-universal-events":"0.0.0-canary.062c690.0","fusion-test-utils":"0.0.0-canary.062c690.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.062c690.0","fusion-plugin-universal-events":"0.0.0-canary.062c690.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.062c690.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.062c690.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-/ZThiSkTJzUKKEgdL3aWohXhWzaOCmL1+il0Or0P7Mt60b3PWyTU65w1Zy8qnJnpDaonSSIbA1/Ef+i7rSDniA==","shasum":"5ae170f4c66eca63a67753441d250870ad049f41","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.062c690.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTJLjCRA9TVsSAnZWagAATt4P/2xYapuWQAobjPbOGtG+\n/bSbwdUt6Si9vT7/6W/iNXUnIb1GUb9us+cwTGXf9/aekaw+3Tt36vNIaowb\nlaSgyBRXwFwIPu2nLoDOKbFtc+cD6Gknh4FiYWR0cnX5brTiQpsS44gHWyuN\nvxcsF+Va//MmiD2pzEDpFDOZDkj1AGMBFQT1ctc2fFgkQvLhFDbWv5FkAjrs\nutMYe3nfzeCzUY1SdmAw9fsXkVGSmvWxAGQvo+vTlQx7/Hn+18ErbR8EkmLl\nePfs7V1n1A6ZyDtdnUVqUQqUfe9NejzcBLydYtXbd6J/+aESZr4F+FbQGthJ\ncdql/XnwFI7eRisrA2OTZFYW7lJquztwOwqNw98Lf2Hs/5LLyjYZI5GS4RAT\nC58/zjUjANDabrDfwo9Hda4sus35oXwcv5GhplMWloNZKRS1cmlewiGQv7Or\n0RrtPBviCLpA0/KZYTDkXR1Y4J0xXHpUmPeoHm0U2HvgL1dsZjUp20dX2OMz\nkYdKm0t2u/pKvnYDk2sUSgkexww7lH9nbBYYLFjxNHsn0dRDH8lutsnRqHQ9\nQhln+TrbYinQCbRXv3UOTxxul/LKzCcCdEoUc7hLWIkeTMXO4joXNhuN7MCU\nyUF1NzQjpX5vYWDjScJxj7HSLsOk+Iedrxl8yUhFIB4A+GJpz2euT14CArrd\nRBhb\r\n=WKOF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoYM9HeVkHNMWqt8VJMLsvUPPXwpht2mGZVDZtGYB9mAIhAIjIcP5oi/G9LZ1Bgi1rZOUZgrH0PLoO50z407ES4MK6"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.062c690.0_1582076643359_0.7511241920757694"},"_hasShrinkwrap":false},"0.0.0-canary.c9627c1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c9627c1.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.c9627c1.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.c9627c1.0","fusion-plugin-react-redux":"0.0.0-canary.c9627c1.0","fusion-plugin-universal-events":"0.0.0-canary.c9627c1.0","fusion-test-utils":"0.0.0-canary.c9627c1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.c9627c1.0","fusion-plugin-universal-events":"0.0.0-canary.c9627c1.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c9627c1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c9627c1.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-prdgfX+QZbR9vFvMYgLLiV3sxB1xE7/9zFUWEB25LxIg2/qvsrFfhMV9IsDrlLbunhTrQE5YBahPwpAud5wWFw==","shasum":"7d13636611f65148706e9072a1e034aed52a016f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c9627c1.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTJp2CRA9TVsSAnZWagAAYQoP/3Bl7UD41DyNXW8aUnuD\nLHkhlUsHM5jLM4WCMvnAlWYq7t1VExgeD5Q7427YV/lmFWJSezFWq27To7fF\n+rOM0HslNxBprfuOgVkfdPbuGLONG40mmYZ5vsM3YsoAb1Xb06ihJOOLqI+A\neTV2Skf5lFiydSct3RwX/A97AvQ5i509ZBwI52xj7iFk4vX6UDsrtoc/JT9o\ntDV8SSJh4oHIKdQ7e+p/1DSXv1T2XJ3QCctfOU2PcCp9FZ6B8HFQtXpv/8My\nQLDYHzlBgubcPfkEpOND8CvCADXbPT6RMh0JEV/Vb+EnzE1pux0C19GkVpnZ\nBGbmbNq3A0aDKy02ch8Tc3nGJNhAbs6/yv1D0PEY3ISfsLIsoU1F83qpKwsQ\nJ3ZGCC5bEs1fSVhQs6gsiVVCnaqvjTZhVVr9Hv9v9JZkY+zx4ds23YZagzuh\nINS4jTk96M2QK5l2adLgajxg61NLaNqZE62P9eGyLlYzLzn4nVKK8YyPh5dJ\njTDFdvNlkwGX/ZSdnks/s1fTuksm5IIbe345SSSDqBXwdFJ/6I5NAJQWtoCq\nRiG7lZglzHw6BhUuESWXvHPwdYHEPJBHXCz2PTJlrNvhmyfhhGNupAcKzfHJ\nRSyGUHdWXU5jpKBtUkuLKJZLyRwiGuHgcbL0XvJBCRCTqicQm6euwUPmT4rd\nElAk\r\n=0Nze\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCn9rhvgJdES51Oo2PPy1jiVRetlC7RE09AYGQArQSX8wIgQAHSl+GpSVtyGJnL1ArIxTqtAzVOpMVa3Xv1aGcKNFA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c9627c1.0_1582078581928_0.7744167885696138"},"_hasShrinkwrap":false},"0.0.0-canary.48ddc5e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.48ddc5e.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.0.1","eslint-config-fusion":"0.0.0-canary.48ddc5e.0","eslint-plugin-cup":"^2.0.1","eslint-plugin-flowtype":"^3.11.1","eslint-plugin-import":"^2.18.0","eslint-plugin-prettier":"^3.0.1","eslint-plugin-react":"^7.14.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.48ddc5e.0","fusion-plugin-react-redux":"0.0.0-canary.48ddc5e.0","fusion-plugin-universal-events":"0.0.0-canary.48ddc5e.0","fusion-test-utils":"0.0.0-canary.48ddc5e.0","prettier":"^1.18.2","react":"^16.8.6","react-redux":"^7.1.0","redux":"^4.0.1","jest":"^24.9.0","eslint-plugin-jest":"^22.7.2","eslint-plugin-react-hooks":"^1.6.1"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.48ddc5e.0","fusion-plugin-universal-events":"0.0.0-canary.48ddc5e.0"},"dependencies":{"eslint-plugin-jest":"^22.7.2"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.48ddc5e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.48ddc5e.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-9RtehWYNkEsjAy9aCq0C6Y4cP2L4iO/kesbdON1zPXxm+nz+YYIxcT4p1Kn/a+NFVo37Rl/8NqOw1joqDue/MQ==","shasum":"a24470690edb7aa118cd384261c4939305b1e2fb","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.48ddc5e.0.tgz","fileCount":26,"unpackedSize":141068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTcWZCRA9TVsSAnZWagAAIdsP/Rn2lBkrRDeXg50ozl/I\nLrNObDkOEUkAZac5NdeQuxq0EeccB/VKZ4UFY5VTSNnKTfovxm7OfJ6YnKYe\n+5fP+gpARnNBRzNv/wRYHpNLusyo0IjDBGwm56OZQYzBbHxrtuyp8CpqKydg\ncUaJOeQo/0SzW1UXaIGcnm6/30oC1gUt5DXZlxVjTDv3ARW/G+daeg4jqFN0\nG0T1UNszhDIz6l4F0mMJfVotimSlEwwuH8hbMbyjmGs2XXpbBjRi87om90wW\nYqBkDrlTUPo1EWDIUbIv2y0HlunGhQmcYCbDaNEqpyNWd1BGoAaLeFyktz34\n0AgFLGVpnT2YtwOKHhIA0KlWapObVR7WDyRM5tVJZvS2gNeK3eNac4DFh7Tl\nrbsr9rlFsaonkFc7cPsEPyb4NpfuPSkNbgvJLpS/HkoM4D7FmL/HYKeq05xT\nU02EmaT4brP+2ZSLwcNTmEdAsBmZ/B5uqXJAb6/ZeS/F8CwH/EfWRuxotXVm\n4rgtkkdDIxZ2ujYX1b90RjcSeWKkCGaslURHEA1DGdxjWKZ8rIUY/ZTIn2H2\nUr+JqWAyjzkXdBYo0thi9gAHU57R0fkikgIwDrKCFBUCUsda3QNe/m2jTpwW\nP+CxujXa/ZnwPRojVEG0ifKapWvTOtzh3ulYId/D7tu2lRCX3Bk4i9FI/op/\nz5yR\r\n=VP69\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDD0eg8wgawPcZmN4T1cA7uRPPylqxx9OK4xCYt+8471AiBJhiH1saE+eF5lNNgt9J3GH9R+3Qr5TefXzqu73Pg1WQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.48ddc5e.0_1582155161309_0.37991801168427886"},"_hasShrinkwrap":false},"0.0.0-canary.119a885.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.119a885.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.119a885.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.119a885.0","fusion-plugin-react-redux":"0.0.0-canary.119a885.0","fusion-plugin-universal-events":"0.0.0-canary.119a885.0","fusion-test-utils":"0.0.0-canary.119a885.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.119a885.0","fusion-plugin-universal-events":"0.0.0-canary.119a885.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.119a885.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.119a885.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-5etVE4NEOpS949y/HvUKOuS4uZScCR426UuTmN1ckaqi3kgyoQR+B4ug52SJFcMinrgiypChqRKlSBGryw6dAQ==","shasum":"2ca4e01736860491832efa4ccef26b728033b5a7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.119a885.0.tgz","fileCount":11,"unpackedSize":40135,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTtfwCRA9TVsSAnZWagAASUQP/0rcAoi2HpMtYKd4VYf7\ngXUXSU2qiIxc4fwbLl9KdJ0T8scBQBVTmy632RzQKEK71vQ0Uw71i0BzTp72\n05b0AoJjLOP80hSi5DM52zT3Rar8ibs03w1EymaQoa2yopTkZU3UhZFtiVA6\n1DRrpUxbgwpAzsGHRR7rBnXdIZMEbgnINFhl+I09dVaPLgAC+wWX7G0g4E5Q\nRG8OD5+CHiRUWrjAU28aqBxTTMqOejoq6ZzoVeo4jlPhE455QAJa/Q/7dDXk\n4WU9hqD+N6EN+yzxsRPSwvS3bRT7vQ7xUnAcZcB0EZjyBh0O5KXOMTamOCFP\nAIuOgiaJRJBfeoRSZzdchM5xOUanZDWwxuDxfh50pbgvtLGB7FBUnzPrLg/W\n+9ePRujrJFWdTUdjm0D9+lCKUed8BwaAu5lE9F+qkeiUOnJowZ+Zevujl5nT\nf7B9XksUQceaWmQt6WwxOplgJrKv3HVQdw/O/R5vI7/GZAdBOaCbKamsgjvM\nYqLkdKO8JdaCGG+dUCa+EECA0wgGwhcIwU3FRFo6XDu09VYQ1z9bOHZ0/rVj\nmTjXjx2Ggb5llZYcIaMrOqD54pxpO3iRJ7mKig294ARukI+ZJz2t4QYtAGbF\nYruT0LlrKvWpwcqK3Vqlz13M1ZoLXKyfCUwtLN9aOKbOhjjNognB59BL6Tcz\nSbcR\r\n=Wu1L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhl6fT9ULTuujzWKC3FCIxiuflyiYYTjONzmFWvlHeTgIgf2vzrEfwm9YE6p9uYOcrMToiHctNfFib0kyLkkeyW+U="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.119a885.0_1582225391917_0.21769894353376684"},"_hasShrinkwrap":false},"0.0.0-canary.9908539.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9908539.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.9908539.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9908539.0","fusion-plugin-react-redux":"0.0.0-canary.9908539.0","fusion-plugin-universal-events":"0.0.0-canary.9908539.0","fusion-test-utils":"0.0.0-canary.9908539.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9908539.0","fusion-plugin-universal-events":"0.0.0-canary.9908539.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9908539.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9908539.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-hZdFWfw6FigStfCaSZNSy8P2R8FgltB9oXnFXnwKAtED8egJyFLf9/gpESt61+JvhD2fRAtzEIe9cydvoKu4mg==","shasum":"518e11ab21a25af16545e495c39f34b701739502","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9908539.0.tgz","fileCount":11,"unpackedSize":40135,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTw89CRA9TVsSAnZWagAApS8P/Rbm1QkuKnsX7lGhHPls\nw0nkZTLm+hsY8H9AcMa7OqmO96UEcKf4EKoy8Nj4YgWrwNcb6IG+kYit99b6\nEhPwCm+qEMoG8EhNkGCPshfhT2d45qSLD/HZ8BqpCFkvM4bo1MsDTAw9avoe\nPa5sTJTiE+ruyISKu8csp9ZOHkalevPanE930ThOEzGd5n9M1RCVjjOdgIjJ\nkgjslQ9ygYTPEmVe9mNTDT56Z2ZMVlHI/kttVVR61CF04/fQ48rjcYBkCwho\nauxNQzF51cB9cTcQIBhZoDXXDkNY7TsL+urwfG1FTVlar8LtusCMwH6Uv5WY\n6vlXdVTFMEznO+TfNzwozJAaQGW6oD5YHDlqsJv9szYNakKBMy9oXCESz19b\nNc7do8VGVR/vJ+wfADnk9MlMQqm0lKz+rtNgkU7VwWUhxfBGL4zBSWLvSe8c\ntr17iQm7Mmam+/h4FjPY7TYiezcbruWA1aTs4+1pPV4kMAm/vGqWKk8yGBNy\nvonUkTudej4ftMslSWv5QRN3+9rkIEvNwtmmqN5uXcrL/HYO+869sRCz2if2\nib+2MCzfj/AJyATBNMslFixG5kTjx/TD073lIgPJaPUFvbWVFZ580Sjyl3Tu\nRjSlevVdPwvC5BdKwdZoC/eKxAv0ZPQR/rbRL7Gh0QSQrigP3wjJZLVJGjve\nxTrS\r\n=eppH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFB1wfqFMwYuj0o4Q6afVHZoV3TOdcS+u8BP64IJcQh/AiEA9LiaXWAT+d+meV5/e3FuxLXFfFUXj3Ypq3v2aVoD14o="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9908539.0_1582239548934_0.8797361851126"},"_hasShrinkwrap":false},"0.0.0-canary.5386f4d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5386f4d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.5386f4d.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.5386f4d.0","fusion-plugin-react-redux":"0.0.0-canary.5386f4d.0","fusion-plugin-universal-events":"0.0.0-canary.5386f4d.0","fusion-test-utils":"0.0.0-canary.5386f4d.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.5386f4d.0","fusion-plugin-universal-events":"0.0.0-canary.5386f4d.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5386f4d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5386f4d.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-1gxvtqL5+aAnrqdBAOGV2JCnqvAAyTh8YjPJnMheDbCSDUuIobPdJI/xpR7ZNzAOyKW0IkASL3xlZYbU41F/Ng==","shasum":"21817d1deb8a854a69acf0153bf7747f5810a5e3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5386f4d.0.tgz","fileCount":11,"unpackedSize":40135,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeU/kCCRA9TVsSAnZWagAATYQP/jCMs14ThdpEnUg60dII\n/sWoJPP8ZXLY+9ecIeyCluZOqktvyomiilni1zb8xmMvW7emMEiCSYqx62kZ\nRNo5qiSozdMgTdgGZhub9YzX4hY/TOAhOEq4CPUnTIpPFrlyiKaMIkLqxRAr\nnx/DyGFEXmdUtUISK27xEa7dVPviRTTF90ErucXKjQal8EqOQ5Vn1r5R6RMA\n+jbyop8mgBoBAyStWokH04HO/avP6zic5LxfV1z9hZxztT3QW9CNT39Wd7oX\nELEHAQIdQmWhSyvSxBFaxaiKQhK+bDYfa9Sw6aWcEUBy8kugzrOAB5sAEbC5\nTxtrt9GeKqcfhlCRmWqYtF9DCWuIvc5DNFRemMhwl+XPUhrRkP65HpmVXYfL\nTFAKgsw7G4FYb1Adra2OEp2FBZFfljx6vZsvlJroJ5NGpFh2wQFA8km1XcTX\nMHAZKklrfKgaGYSqNSY7BoF61JyDSRhhwJnZ+6HjgDtvKbI8GSndpoW05IIp\nz9F5paGJamw6GE2THEMRbPVZK0oyBtr7gjEekB5nkSK6oSiGXPK1KnEWPnj/\nnPsthK0vSC1atGNtgSqwCMnb8Es9KvXzM9KjrYCqWKTsDa9vd8TGFlkU/SAR\nJoPfhp9u8aWjOjs0d4iAOEoMpzCFa0R8vDhQ6e+WZERJcXYJDO8vF29WhwWb\nI71c\r\n=uo6s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFKD5ck4FtNxK3v7A4GLLqlDeIzcE0nOvYGtp453RoexAiEAu4nnCVnq/ptQ1dXLJMfojPe53pJzAsjG+mIqLvLBBbw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5386f4d.0_1582561537529_0.15239342946329626"},"_hasShrinkwrap":false},"3.1.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"2.1.1","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"2.1.1"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.1.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-WYfDZYSYJX6PZCz5pPR4zDmVn+/UL+g3nYHAokWl6S2sb+H06DEXZ8FtAG6m9bPEBN/JuIsoMhodSMvgeecRxw==","shasum":"9a733222d5c458231f01a46bd0e53ff7ee2d26a8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.1.tgz","fileCount":11,"unpackedSize":39999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVXCCCRA9TVsSAnZWagAAE/EP/0ajhpFibaxyaf96mkBa\nPbo3SAnHYwHo5LdaL0RNwYecQCntU09KuK8X+YZNRhE1JZEe9UHvKTxtA08X\n7HV3LhK9gUoycyWMn6ZyK/YFKvzTuTjFn9OTu5zs/soxRzmKVZcZ84kAUi2k\neihewaF3+vElzzy9jGitY8FTwPZZVkjGwu/5ou39JhA6mJAMxBVnVa2Hsct7\ntqi/DhFH4AKVRemiXuMrxXTRcmQQo52Fd1vH4NirHRSWmH7zZ0FIffxcQQH7\nTpQUFTIoztYuQoJEgeQuSLOEjAxsIvea+TRNJ98DxICC/wAA8UMPF/D0YGso\nhQTtlY8ZwOnclucGNQXgNAWyOQTCFWyERG0hAict8ndySEpA5wq7iUX/ANMF\nGggqALsXGGHrIQQ2f1ecwdT1IhYpMCw2oftIPQv3Sn9bazi7tMYMzBEYd/2b\nYgrqa5oRRr9IE6qxpyc+0hrRoQg8UjegvGulJ0Hg9pfUtXSdSThIxs7Mx1KJ\nBKM7btJZiQUOoxiCr3d8MS943Jkm/paUeY2bKORFnWC/wnLORoSLxvWJ3Dn2\nFGUeVzQluaL4JAtpJcznm9GuYqhFqef3hfmuaOl7mMnNgMQWIJ4bmJ8cslRh\nDMJBcX74Mrdje7VaixRyj4nlsprxfR3zht23/LplW6Cd9TivYcSuIE1hhbNd\n13d0\r\n=HZJi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA/hXUI4oV3QctLxt4AJYY8tAV2k6JuZD+eqOH9ZJ89uAiBd1SISbqvMq4cs7YsLqa0HcARGUJ58O7sF5fPjG5DQbw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.1_1582657665917_0.519985114479808"},"_hasShrinkwrap":false},"0.0.0-canary.77f8cc5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.77f8cc5.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.77f8cc5.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.77f8cc5.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.77f8cc5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.77f8cc5.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-fctgxGyWgmXEOzpigXXrYSa4QSc9KqIEDTfZCjgMJkKtYWg2JIgV71OxR7AwPx4m1W39q2SNXObhyS1BBufkSA==","shasum":"1e23acebfcc96696a17ae319d4c4ba99d76b4005","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.77f8cc5.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaRxQCRA9TVsSAnZWagAAM+8QAJGqhs438q7NvTfP3Oms\nZuG22v5LTlIbuu2Nxezx+QHEjmkQ/RbS0c4d1ZcHPMg14Vend2D3vUkylOBw\nMI+OWQXMjaQ7sm7NEULi7M4gPo75MzmOOIDhsk0U9HyU21uQ8OyTXPgUGS/T\n9wSR80cKJfa42NDfjUAsLFvR415IboW/yzyKaz1F4kAOWZdnZ3oycaCpUL8b\nVqn7J4wT/9+/8i+FPXRBj3BxeqNS9F1sKoMH6EtBCaRZLgFFornESMRoKj+S\nRBqrdCbegc5c0tLpow0/R0hvYt9cN0b1tA8Eb6GTBPaeTV0VgXWCVfK4+Utt\nUsrF2m/wpTP4VvgImrJx678rgJsM51jIDWlJZeiUvlIlQW9xn6Q2PyxXeckR\nHpXQBNhx6SAvwTMz48aAr4AYFhiJ/RS0z6g+mbgYcbuY7xevejRrvn2lXV1w\nRG5xuG/gL24cwDQGdSfrB/yb43hTHVXGhox86z1ku0G4SDhxrPnICylcxFvq\ngoDzHw+s8i60AV/wFRa1EJLRdxdk3BlpUEqv5cz7Zi2kJvMHejQ3AxrJ4pAb\naEIaPUyUVMMpg12G0nWyoC+jOJiM+LUPb89vsBnmnS57rKa/VCPORFTbjuS1\ndyl23cMLJ67PSsgGxMf5RXocnqWX9XLnssJ7dOswLrLrFweEnBDmWrDMuyMP\n7j6V\r\n=L/T4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmRI//S0/udCLl2V99D8uYtSqlWV2K0Gpm7BGb+rE6SwIhAJO4mf3VfqHqdjpqgozOrD4+GhwXr/jSdFWL8Y7QBbP9"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.77f8cc5.0_1583946832171_0.9565631279195581"},"_hasShrinkwrap":false},"0.0.0-canary.356cf23.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.356cf23.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.356cf23.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.356cf23.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.356cf23.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.356cf23.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-WajhyD5tMQ8bdabXLb6aCJ0QmsfNX0w6kyipE3SVW0gKrBzVPiAzwViyTLDXNSpYffWNWHJDPfeXIrr7jXtmHA==","shasum":"d3a86104233954a5e4cb034eeb09daba9e496dcf","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.356cf23.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaWv1CRA9TVsSAnZWagAAWjAP/0XEyvJYOm6fWm7V9pSh\nrc7JOJw8nxzgmEwg1nBL+c/mbDcw991/YecMXO2bLsoIhx1CzCZAw2RB7mfc\nVrNXANpl/QkZaHJwWyowVIL+UDRpPbyhLPOANUi//STpbY/0h19s0FeeWmeO\nj2sv23dmQYk/vAQXxAv4Fl8tVgauKqNLehnnM87TQsdoo6OxnsnaS5h6dTB0\nQUHdbTvfQ3Mej1hBTU5zUoHc0vUIiQkFtSG4n0VjTaY4CdRQ6y4ipusoGADR\npJLTMN3BGJCM2OkPdycMP/mDCbegv9Rf8XDgh+LPEgTCZ7ayyEnVmS8iO1yN\naOemAz2xSGbk/x1PGzvsu1s9BDt57+yOH1KS2SUOnop7X5W2rqHKElOqyEVP\nv5T1QRh7bL8FMvyMw2SLZfkfmEU1TY+OJrPzhv4QKAo2MYp/SlSiSumfIXJy\nOY/kTqKRoGAjw02ZaIbAjrOP50dfM1xDg54ZXwAHOsa4IVS4zpuf/JTvOKZd\niKcFos7ztLoJ2pI1gLYZl2BpsPDT5mxchCLt5moe1hF+cUsqGicyXVvx3Tf0\nK1zfFYqEyj6LlgYbUoKawIQfRMJ3sf3YigywcZ8jsSqEyOolkwUM3pdPWTlD\nutCW9XpVS2VGmQj+NX/3dr9OBA5Ytiezlxz5N89vPiiWZamAn9ujh6F2yAnG\nH/wz\r\n=QGW0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCn9NqoPAsZkMNMaXrWwmDrHIiIKp0L5LfS7zJcNB9mVAIhAKDEVipBdTSwhxCKYHT/7XBBuE56TYlKIKlDjCoUbt+U"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.356cf23.0_1583967220631_0.17757661732341945"},"_hasShrinkwrap":false},"0.0.0-canary.a5f5c1e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a5f5c1e.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.a5f5c1e.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.a5f5c1e.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a5f5c1e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a5f5c1e.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-PuInGLnAyCF5RAIlbwkp+Lxbjx13jZq4tOO4qWNzFTzyl4j7Lk8tza5duqB1k16fSUlJUq4e5TVHTbrFa+fgVQ==","shasum":"2bc2995ebb04205bc71bbf9a5c9442b360834e27","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a5f5c1e.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeapJpCRA9TVsSAnZWagAAp8kQAJqAf8Q9WFzI9+q2ah5i\n8SO6WhD5g/2ROxe5+87UM7b+gg4cxByQdcENHoY1bCk1vgJoqQ9sXYzdVnQT\nMXh3dz+qIMbGORNVJkKiIJZmINXtnECOUOquMBvPEC2oampElB6AR7TxQE77\nWV1SKG1iOpgiHSz9gmSrin+WlmDTio3ueYHfRmZjwhhawYnxPgSzPNIoa8KO\n8LaPKMPxqZyYrgaUC9V0Nl0Jw/1Ztk1HDbFPNTER4kI+gTJnSNpeOvBrfYCu\nf3xGquWvsWhV5qPcO3Dd5Ju0bJX6lgI4e59H8MNmb/gXvdFHNfd9qJwUItWQ\no4Tx5vgxb9Z6yM8YrxSZcIvI4LfZkyJByQxkhqIXiXdkwZb/1xmGiqfXruLk\nY5eFIqRxzrbROKpwZJL7yObDpquePrtgnZSeZNxprgjWdckcF4kgiJ6+uULk\ngwVykqvZ/Gjie+S/06aflCp7vlSHzr6vnnJCi5x0Qt/tfUQUL6dIh2DdvqLE\nWmhSGwGuyUkmlkVVbKkrmVxGtgU0Ttr9gAy348bl44xbKNKr7ZQcXXciaZQe\nYgPE/UNEDEnGsyR56jWKZ76BZx4UOeU4vqLbfHQHp7ZbwSJHzOTXP4BBo9c3\ngZIhlWnpHWEXF2llJ60mZKYvZyxaYjLCeppvAKBbqdnGf4Ks/umHR/Kw55Yf\nEf3Q\r\n=lFKh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDcxngESWNq1gw0QbeaxGmsyo7lxrztsbpXpKwypGsWNAiAgbT7skFkGUSQ2DDroz2L4lNgeWX3fwE5uWqo4w61pKg=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a5f5c1e.0_1584042600965_0.7156064010900478"},"_hasShrinkwrap":false},"0.0.0-canary.8d11e65.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.8d11e65.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.8d11e65.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.8d11e65.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8d11e65.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.8d11e65.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-nKc6A+bA3cWjjXeK/t0nI3RNl3oMkcy0jQeHpxIja84ZViRqaNVrEWOLVEfXnvfVPVMtIIFH9Y4BhYFsV3uHLg==","shasum":"9a8f801d1025556de31481ff7a1f588c9a8fa5f6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8d11e65.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeav6hCRA9TVsSAnZWagAANKUQAJshs5aylugqB/DNgU+M\nWUKfb5bBSVSj6wBIIT+REZ2k28qsOHaTqRncNYeLKyO5dr7J9h/Jiyk269vt\nLbgTEZks0wXqUL9KmB2WXdukqDu/msuyLJY3K8Whi9JF0G/044zZqm9w7w/z\nj5yNdeGlxLoEFDn416I0kvqxR8G0Yqd7bBrlwMzdS2cyyb/TQHSiYa/CY0C9\n9yLng4EjnJQ21tRRqILp9XnzlQ4PZu5eIdG8HCYcWO+YbfkAMF7g1NrVWdTm\nAvbUmpIPZ5iuVMfao1LUZfTZ0voocQc1fWcApb2oEv1b7EPsFzgkfjFOPjzd\nUR/CYKFr3X0q9IkgCEStszHGG85TALBjoxy7B39UD9xq5/zLzT2suNsTqm6P\nrMGmYc/4adWRDcU6lSL7tE4Qg8tq2C96tAgIsfq6nlFqgk6oV44AEIszugGb\nFguAwNSKx+G+Ed9mUUAwULpSn2pZP9iV/i8Fi3qLAHRsmPnaRJS7J50UN0YM\nnmCM5dI4s5MKp/HwYO+WqNn/EoMRWd8QU4ufNnkfPNI/bkGwQKajwCNByMen\n9Z4byirEBJznqFGvBGzqTe3fopChRVocniqSZAkKZelSM9Gd/PuLpoIGiPhs\nLoo4TyJrWhgpmfCbabkF2+nxy9xOcsRZ6lSVSvdtMmi9X06B2eoMD2EnYJk1\n4Tzs\r\n=TFxX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGHM2OKdf1XtmDBnB2TUssrWdca9UEB483YHcElJAYhJAiEA786epqj/q2hKBICEF/KR8LLTl0vogLPfr42sril/tWg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.8d11e65.0_1584070304621_0.9239284441893201"},"_hasShrinkwrap":false},"0.0.0-canary.c612639.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c612639.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.c612639.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.c612639.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c612639.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c612639.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-NBMZYFQXU4HER4gqCQ0CeUUQgxetrTbEOKOR+pYMWnzD+ptFFuxh7LBEd/vq4WOXM9/QSFoK0hYIkA3YqxztwQ==","shasum":"34c3f703c315b91bc60bc895290ce6c789850110","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c612639.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebAP7CRA9TVsSAnZWagAAKW4P/js7ZbL9uRSh41rGadHV\nMZQiNqpeLSWokYVcgMeKD1fUH8tyK1JjzbyxOoZYI3/SzCrwicKJtiK2Ar4y\nxCP1/4l+Xyenz0xpxr3ztF8I19QC3ZtqkvQQjUfe07/SJ04hfg5vmcfdH3D3\n57KCiL2fNpfERZjB3Ztn/RWREJB0iU6fs6Rig5J/EA9O6/XkKIGg2ynuZfd7\nmfnpdU4BGpy2SrzS5XGbIpFaiEyTXZzXyzpRE9bVE27F/viBw4D4BEBndfcJ\nhRZ7aba1rDPeW5DYzh9f1vLt7wIiidY9HFCOlumHzN2Qp5sdeLW0oXNSRocG\nggURUb7sKovEnZ2qTyl2hVgIYJXEO197kR5svxLOyhShsT3ePSgHgYuq1yNH\nqv0760KJv4wO4UY+NDpltD9jsoFdWzuWxeSmMXKRxOv2SIVg4d+02v/euSw2\nkMDtrPOtcCdCDRvjuHtxBRkBnQJBVaQmT80WrDLGDarAb/onXLdVKsQtxkWg\nVdj9tv0SwCcoK3sRZlXHybtuGuLo254yRxmHX6jzOHFeyoS4gm2fD7N/dMsE\npoCBUjPvqtoaNKZ3BIrhSP7n8hBoquvmm+H5zgEqgkNSoJzSiaL6lc76PCTu\nm8F6CpV5pNKFVBf9CiYHLX12r7F0Z4/1ksEoqGOCFxeuBxPM0f9lcWmhQYuD\npciC\r\n=K5AM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBdkFjVYUxQ4xBI/1+R4hVxiK8RziOLGK82vsGCyTZb/AiAog5lVDFRFxyLh08WfM23ghsh4yiZKCqF2g5G8LjMrHA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c612639.0_1584137211506_0.7869814988980435"},"_hasShrinkwrap":false},"0.0.0-canary.646af7a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.646af7a.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.646af7a.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.646af7a.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.646af7a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.646af7a.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Dgz5TQGSSptibWdPnuxtxPAFPcYIa+X6WlEm71Rf1VJzDsd7qs8ch/o0Q0cjpNk1D4Is4C3dlgPrDbGOOv51PA==","shasum":"113764ce8adc68a42a22c3306d73ae1614e1816a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.646af7a.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeb6r6CRA9TVsSAnZWagAAYJoP/0kxPX5meJGCz/rV1heX\nn/kXBByhKR69tqJ3niYmgxhpNLj/IukrSgEofrBUfzK3XngOqnrV87qWKTZL\nww6UWvmYRlIoeZQGrJs7lWy0y6BCHIjoITk1HD14BA6A/lxm8ZmrZqiYNPpk\nc8B5hWuQa6Tv2es3X4KiinjQBhfMPYjAIslIc+xuQimwCX+ytJpuWYGgrq3A\nY+bxFx1O3nWO8uGGaS2BQSZcTdhFsVsx/8TquNuIQ0JyMkczAPYLsfEG6FmP\nWBZhbHE4TnaXwd8idhL+OYRtiFs9PG1nfw2mmhYh+QbTccFMWshMrr0Q79t/\nGYHKiUMHoI9o/sfanEAdFsvQRPRJBwN3w2iz2VVGvymHoj2trvvUn22BYyZ3\n9AmN4tKULBctq60Qw0FkfMKZcPsULhNYpR9KXjnKoyCuz+I4U3SPtRBomGMJ\nUMocFAO1EZU34uJe7as3NNdIhp1k/8j1Xrb3faNduaIns4erc5O2ocZgIoOh\nCIDVLtDJUIEtS8wjTMccGQy0x1Z76vWTG8ZuYMEU9ClzkUOpAKjc0EHawdTz\n+WlwwF/Oi64aw6LTza2t3zJShHVtaGNhqZ9Z769mcnfFL6MzWDigkCH4cEKi\nLe1Mv8JDw4fkrQX3nUu0HrOgV1X/gJXJOCRNsPOU75aLVIZZobzYB11pnJDV\nsXK9\r\n=YfHB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAx3pNsHZ/0MFcSbxxsxS5F0Eerw32stMtcrDrrv0ZwFAiEA59luR0wxr8l7XhhcA0805AxtUbjtohPT8qR8SOjjjPk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.646af7a.0_1584376570211_0.37468326809921204"},"_hasShrinkwrap":false},"0.0.0-canary.a921018.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a921018.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.a921018.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.a921018.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a921018.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a921018.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-PWesgRqS4ke9GW93GJStcheHHZuUoXk9DlaTLWnLaNCxs7if2joZRcmeFDWJD3L+v1bmuAOfRab0yF4PCFwEqQ==","shasum":"23bdd2f568d27cda150a1646d3e92e56a40a2556","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a921018.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeb8izCRA9TVsSAnZWagAAoacP/RsJAiJPWuhl6BDhUmk3\n8PXDu+weFZveHiDh9icov0Py4o+5H2P+bW9ZKgEcVY80h+otImEOzVsmXjhc\nrmAzfOuI6Zyzzf2J1yTfndKE6hQU+I6z2k3dbbMyBuOyMawhAlU7NhvcUJSy\njJJiXpsd/wl5fnovTQRK5LUsdidyZGM7rmrhuG752LucCwTp2bJkIma8xic2\nT7FCCPAIXm51b8qFi5wPtPbvtCtTXOc7XfUyr4ahD1Co26WKzey7b4M7yY9v\n2joKr8sFy4KXWiXeusumeKMMtW0iC5kBQqvNF0nrYF3V9GiN8ozqRZ6CS1VC\nA1GCkBxcefXu7rcTQEHL6sIMbEullImGYwpwQVpzGtDApeTvA+J1vyheOG8D\nk5KcTa8YIt0OFRXyKiaARs5rFIUj8USPifj/Jn1JDgfDAX5eIjfXLPkDtUHL\nKkLv4Ykrc+0XWxdi4KXxQcTw/WSit1QfGTN3ne1rIvPENiAM142wAcBjCnPG\nggSX1VQBMU5BoLbCbBSd0bDIV937zxkuYwtk4CWxXmHUBSnVIugSUhY3p5MP\n6LfaRIa8Zv9dWVXUa8tbtPcd0fUOHmFyZCeGjMlH1F9JAJwJw/iWTtkV6U/s\naxfhELgmT+oWIryOcfMeEId9dJDmYcllqe0g/X5jN7BsndBL7YeoKKgmtuce\nDChJ\r\n=VoIj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgfLIrvRpO/ZQmTPLXWO6iGvA2w1Ue0qS0LYPXMU4zWAIgeWQnChasUveWCyg4RXzFufaNGXSevl6gXqfaWHye6oM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a921018.0_1584384179154_0.2524793219399364"},"_hasShrinkwrap":false},"0.0.0-canary.ba95671.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ba95671.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.ba95671.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.ba95671.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ba95671.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ba95671.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-rjpBHMxxloECjSg+a73eF4yraWijVRiGOOtRCg1rom2ocY6vCzLzyHE1mAJy8ZzBswqNmEmhRhCjhcrhNlmszw==","shasum":"b107561d04048771f97a9423e48d60dca643a8d9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ba95671.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeb+4TCRA9TVsSAnZWagAAdGkP/R9cUb6m+Q5iA1K1GPos\nvSKGqNP5VwgUA6i14IY7BX4IREC8Qwhek+z9QV5iv9dPhxspwHi5XcZzaaFt\n6SPNcnzV6zVpUhTvGQ0eYhU4vGvnAF0q6ZUjL+58LMxU4kgrwnra450dl/Hb\ne+pRxnzzKr3d4xnGH2QpAk7MFMi1CjY4d6gvYs0YEGHKWTgSePb0OMZ9drDd\nEeLVT6K5QMfjLfLbS8lSSpsivf93zxyjup8/eHxODQq0FLoUU+2yGgkM6ny/\nai+1FYkqSSpnJ84OGzQH+aMcRpBLdDCGVnF6yIiC7aF/1SUVWctLvCfSq1r5\ndqN78ht1jQokxpYMp+2xZTWhWMoRfs/0cBXqe/pfMHRqKFTQYvG6bMgw1Dw6\nL8+2hO02TLLQEvFYfYPgvR5g8sXbwjL/dd+ScwFxzwCd0yGlIiP0Kbpq0nSS\nWmk3h+Lj7cd3oV9jRQLYUaPWnJLnTus5WxmovR9lv0Xs/URzcaAm7UGD5rQK\nAu/SfpmROXMQaQ+g4Kb5fZp3iQ4iyDLE2InttxgsWeuRI+oP11cDOAn6Y9dM\n+R1CgoBK0majAKsCdy33B44MLYYLzvneZatC3y03fFCX+rpfLM2XP0V6tJfP\nf8Arol9J5YIUaYgKffAslOHu5orRg+ffIcdF0A+kp5WNAJ34qkkFSh5TVnwa\nKcJM\r\n=6mKR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCHyplnu0ZsBMRm+5P3kZ1V/0jRgmRCWHRiCl7/hGQqhICIQCrwPFLs14zcIlAJmCbTDRkSsx3obx8LjQWyV+92176eA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ba95671.0_1584393746641_0.044756845334294804"},"_hasShrinkwrap":false},"0.0.0-canary.a16c9b3.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a16c9b3.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.a16c9b3.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.a16c9b3.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a16c9b3.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a16c9b3.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-xqb20Wj8VyUXMHTY37Nl48UMsx3wbyzOibdPCBKceg9umerNBYEbFrN3cR2rAN6ht6hWyeBYAQ1BNcqxetqbzg==","shasum":"335b8d82ef73352a051a03c56089a8e4de1bbf13","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a16c9b3.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecVeACRA9TVsSAnZWagAAtDAP/3KZaiV5lKMVIolnZB7P\nPWpmIjpdAA631DmFR8TZ9KU2QiMg3kS/2S8q+3Ss9uxZ8/hzm0oY1wRttHsX\nzvUMHPimK9UEtGXznlO4zTusLtpw/+VqOVBP/ChXM5Gp1VUgMSCxQpfwx99v\n4eP+aiYxq+i3jxOWN5MnPquzgl2XOs7hsXr7tlsBCltC3jRWOeqKAdJBrv2z\npPgCZ2VZNfwj/zBgXi70O74JeTZFD07jymmQnmkYFdvPlTHwVZNqM7L84G9C\nRHMXnGkjZiEW6CtP7DiJ18zpe/h5Tg3Obd54ihyy5u9hFuXPU+/hduUD4dib\nprGi92/gooFuOANAB5Ykb1rqHvtH21zi0rlN3dumIwBVtUcNvEuyDV4dDM2X\nR2P85IUtyLd9N7ixOb7D5kOXqGU/tB4JR25EWUXw79raiGMmZ60gQjZw/Zza\nebCPxaQ3KL/GDtsw3EpscFQLNT4qOdZ0KzR0M6qwbiiCGys5uHPIYWDHEdgo\nHxKtXSyDLD3gukvWvpwD/qZJiU9L3Mi9+kkYvz1zpws5DhyzReOVVWVqvmP4\nyzoeNLtmOqvhMYgTt19HybfjMjEP9j23AGPLdE+JeYk5j41hMssHpUA2UMrF\nOFnmXsq8MC1TVH1sLj21o3HIviMLhEAqMDXZhXNDrmH9uOjuBjFkGlJ7Vqxb\nsxoS\r\n=BjeL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2KgTF/38zlrmVaqzsWCykDSPyjwSkyApotDb8zz+UZAIhAIZKIUK0LP6GWQ+BP+/akzE7QQLhJgm9C1xo4sSfMB5x"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a16c9b3.0_1584486271924_0.7105816394762028"},"_hasShrinkwrap":false},"0.0.0-canary.5817c05.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5817c05.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.5817c05.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.5817c05.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5817c05.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5817c05.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-2b9dMYvTlsUSCjm0oCXcRr2jvGQUBXtC7KHjdMFY+aUlF1/WqKiXcUz0XxoXulfIFUziTavtVd1Nkb9/wfSBxA==","shasum":"a66617ba638db56faeb658c1bf22eedb1b60dd7c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5817c05.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecVlyCRA9TVsSAnZWagAAFbUP/jDZXbqdNKlCnEBSgwjH\nLJ+vA4N2DGgZbEVHKqq1IpWbONOjI6SuHSZU2/l7j/1K9ujWCcM5smIdJnV/\nlc7PhQkBnSfXy0PNb+YyWB6dquw1QrIntC9FX4GDgi/+DFnK/qmbXzchOGVu\nloufvpqxOhxMxcsVaR2m7WT8GfZmjrEKZZQiQsYLEhG1EV0yJ4/nN2XhfZbP\nbNVYUvp/2q0K3rMj4+fFBSDJ2DUiQ/Wln7uwumMzc34o8eJ/688MJqJ6VG5q\nXnT9uVttjk7E6nVfNj3kvQA6PtCJI9X2TpovquEF+PzGkWWTgTVgbtiI3CzZ\nXn6ylavEoj9QnVG0LnT7x41kBooKFujO7zYcZbdaBgyO0TK0mrW/3GL5n5CG\nBAdNKkps1el8gMn/RZCZj/wp/+wWXTwuKrMIanhcvTiDhI+UPxG62dCtDrOO\nr1YAvwZdLS51zbRIwNBBKwueZl3KwyuRx5LKknMJlUoDGHGLQjRSK5vo0Vb8\nLDJ6MmZZIEdM5I1PPcMOa6n0D/mKsK4oDDuHfhjfTGtRN+wdfdD3LLNM1NpD\nbMnh4L/XFdDH+wV5SKVCmPk1ROc3UgZkMTRucmrc8P47Y0bSy3EtNm0rgvRH\nSE3ZZOWIElTH4TsKaY8ppEJtHta05/wjkz5HeW1hGaRzOLJnIzhUSWQWZP2F\n3H37\r\n=Qobe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICgSUCdAY8M4kDDj5yfqOgtwYiLAIpVim+QmUwtGHyNtAiB12/+mQD6YS5MNPZ8jA0mXqAZSWk21ptAZ3hSsA1/TzA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5817c05.0_1584486770395_0.013601349633611814"},"_hasShrinkwrap":false},"0.0.0-canary.5817c05.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5817c05.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.5817c05.1","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.5817c05.1"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5817c05.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5817c05.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-bHLyT5eTKPFsBw5dk4tA7znEpdCFZXeqZ1GpNwkesc+mmfoPt5v/S1BrQLYX0IH8qLCq3vVS2QIR4l90pO/j7g==","shasum":"046e1623182bf3254c6d40728df29c3a1fb5148f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5817c05.1.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecWDGCRA9TVsSAnZWagAAbiUQAIQwegssGtsfS3os+THg\nl9RN847WaWqJzT0cBwGAj+/0WSDo5b+A2oLhcEgTyiw3vcAnH/82B8zZVQlE\njCRWuztc2Tw9puuGMZ+E2ehm4pV4Qkg2trfLLKqmKXuil1njl5Ky8kCulOgi\nlW0ocqLuaRHxiHK5Wr+cXE7sm90gQZ8D28NmkEr+Ocy8HjxPLbO32hCMFGRG\niKyn3Yjgb79RUhLAfNo5dJC2T0n4lxmLFCW5Y8P4L9C7Ko50GtEvikSzAy40\nfQEuN8/mUyddkFsuC8RQezEtsWcsGpcTvk9PaOcnegowUL5FEoHdhW6MxoGb\nVJjeueEIRRrAhtX1CbiaUa/c8Roy9GcA/ZvXX+CVTzA8HwJburemrMEQZhSw\nBo/OacKpswY5UR+P/BdQ3TT1Uro61DS52xVdGllpcjZgtArhD5ZR5XSMCWfH\n5EeL8TZxJxHA81cVvc14Vqug3PH/mHkX/HrMuZK3ZftGh099iv5oP0zcf+V/\n0ktnXku11nmmfpOoK0SgARFWkq8QxfYfRfBW4OOoEi4dAg4hQfssBDrWIHC9\nDf+yS4bftIkAMAIbMlymVejHA0by/fKEjTzf5P5bnGACVMVIP2OvpZT+RAmv\n8q+nINP3szyoBIuAYFZ/wtu9+f/9q1lz29FpLpWcxpBE0EA/Xp5QlXX3Nm+z\nPxki\r\n=29ON\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCX/+TQXzbXBKPMvz/fvq41fMw8wb8U/2WJWXQdkj0ynwIgQgfdLvA0cLqPeWvue0O0GmNd6sqHsvTOqWGDG7qplCw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5817c05.1_1584488645956_0.3746380902646249"},"_hasShrinkwrap":false},"0.0.0-canary.091a12c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.091a12c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.091a12c.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.091a12c.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.091a12c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.091a12c.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-/f5mgVGcbzt/3Phs3gPObJ/cUZo33qhgBeKU883xk6BRZD8jHkIPgnlovgkHXc3uhWWmC+kiUbtixTqGU7NPBw==","shasum":"5d454369eb618b78d214bb6badaa0521a452c0b2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.091a12c.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecXJDCRA9TVsSAnZWagAAo7kQAJNgflj/nbjUbrG60qDt\n5I/HWVzkC3wRmWdWKqUGhGuzWAAo0aSECTAmhU0zMfySxJBAvD6vrSooBluc\nC0rQGdU8pdRYpgUxozUK6Yw7jmyURFYw3VLucnWtZF6tsSEs5FM0wz0cEGum\nulELGUnYRNUhWTHNNz8dxul+lpHx/VQ8uL98eVdLIxzfOK5XPCahDScJL9f6\nupRVlkxcPy//8IvskMrQBX4ce5nih1AuykLFamgElb7qW3RP4Q0+Io60QrM2\nXWtpbp17PYWohiYDg8p+f/0RRB9PxR9ITk19G4yn9mMMCW9yL+C5DwCMmCzl\nx0/mG9d16ycDYUqiAun4o7zOR8qsVWE2JlRscD23NHHs7crmYYSXjZTf/8sI\n3ED3LfR1qvpVvOy5E1xkBO8lGDZOpzI2BRPxoia1HEiQzn0YXf8zo8LSa84V\nlXTlbdg2gWGtaHRN50DMkin32O3bfQlgfBF47fLNxUP35hQ2iHoFBvwNIseg\nfAHKaqMVfllSLreVGPT2T5MWHS3IP8yceWr4FQYpslTJ0NV+1FuIK8jLi7Hf\nWUkkQLGP4QgFYkMM4jyA0AeJL1MXCVT3v67T4G1Nbes0rfWAJjh+fAju4ZnF\njNSrboOITK8BO8vS/LFYkM1Ii50LWcNvRZsgT1qyZeRmA0NTSHPYDSQgFmKx\nBKkC\r\n=Phtn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRcgi4ZW6Cd1RIMu/WTklWvRR2//jRTKmMwEoD9ePXFwIgYS+o1wSovUxLATHZJUCU21WaeRymwMGuIXb1U1iFrog="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.091a12c.0_1584493122877_0.627001570886168"},"_hasShrinkwrap":false},"0.0.0-canary.5817c05.3":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5817c05.3","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.5817c05.3","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.5817c05.3"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5817c05.3.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5817c05.3","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-wsIHS3Y7N9nmRk2RCUAffiq7hb/kb6P56Qpjai5dzcocK9oAtBJQvCV4+GcvJITpqzEnB4UfUxUgzmxnN4FnnQ==","shasum":"e6ac58d198161605fcd6580b611bc50b05ee0696","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5817c05.3.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecmkZCRA9TVsSAnZWagAACvsQAIKTgecGCxwT1L/AgpDo\njWEo2jeMUWilyfqmrqbDLekkVl1PTXrmMAIezxTIowugkpsjRC/wY5xscGgZ\n9LNXTw1XIyNH5a7HSnSxQMtYMSbZM7+Jov+4MmLPujK6zBBeWJz9j6IRO1H1\nXfpq4bmrwTv9AZgzsgjBEaJ24cgWBgKrVp/HnJIt1Jb5TkAboA0TCvkKhAQ9\nSwJ9Y2sriWRv6ae3FXi30MgBL58u8fJgVXRkMNFiFU3+RDsU4w8Sq+Ekdr6L\nz4DXMkHsyV2bUcebgSexGwZoX9ZV1Z1WuI4/p6FWTZm4YqGiiO2OJl4zTEqX\neAeL62cOV9T3YcTM1sKghVzjNODsmuMgmBhryS0awtRhtFWt1aICE87jnNgB\nq6OccoMCjggBHR+AvvWwRJBHeJA5e3uYk1HKdkY/Jz+VcSIXOcBTl7x5LsAL\nJdOypSzmITXF2d+S6kvK4dEAqsQqkjzQv8+NQfsu/VtaX/pSEv81NPiRDVEF\nZr2jNrlAek7PXdcBZ2Y6QucR/PxzVhCgqh7IZxrQV0Zw5rA/F4c//2yCINO9\n3aI030BKq//5RFefJQwQ9bTw7appAnvlGf8Avf2H5Y5eKPYfUUHGkXLaOBqC\nxZ2EmB0RjhMyTH2WaPZ+HaGbSFEfSZe7z4Z4lgTF+7yIKazfZ0txP/d+lCTE\ns72e\r\n=qOCv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuW8gts5kfG2koFGkslANXCzsl6g++xauXD55VDG7wGgIgYcvokk46btdfKSCmGBijy1najFZ5C+u7YsEHps+CxkU="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5817c05.3_1584556312818_0.18711268522122038"},"_hasShrinkwrap":false},"0.0.0-canary.5817c05.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5817c05.2","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.5817c05.2","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.5817c05.2"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5817c05.2.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5817c05.2","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-I3U3LNYVEQfHle3GQia+6bZY1B/N2yAUvKeRke+TPu0TLcTaQZqiTU/GAQjCL+P1ES5UInx5fF1EhIgHY61nkg==","shasum":"d5af137f1f1d178a8d4506c0c83dd332b7670fcd","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5817c05.2.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecmmwCRA9TVsSAnZWagAARVgP/2JqpTHSjr9EPJgU59kM\n6MBBh+h19DWL3D/mFxqlBlE0HpAfnJv0a3jo+egOvik84tlPmdp3GR6b2rFA\nsa3o3QDqtyZAg/xOkNl91vR7AppjlCDHIaHW47Sl2PwBqDU6b3hSYbURUISf\nwzdYVjQB8qEjng9v1+xUnyTxCw6Ya0miU/jEYexhqtTk3QhB2PpW6Q6WwjW5\nLK54ZfYbYyucrIOmOT39pnWpZbb+Ji6EER5Y1eV2mD2RJJWBaDax97D88lTb\n1JoIiCwiKbMh22qp9kOdzVSEWCq/gu/6PMHs8qsTJDNjn0aD/sGHwsy5ctwf\nEb37WqzFJs5IpgKF8V0BjuVqaftv4r17TBcd7dqJVB2GaJQBbCIYvM+BoVOE\nZBg0bgOHPvcQ5o8OhARu0tfIy59qrqqRdLRHHAIIh2w1CYdpB93TAXR4zYaB\nR9FmVcuxcOuc3/uhcD8KZ9TNKbDBdNKBS4bSJl389PfihSgOlabmtnu4QG7f\nm4oQ9rt85gsgKevk+3EMo6tellVmhGKV6Qydfsr/gJww59gLpyylafdRV+Pt\n5aNxAojOkh28W6i7CsIvOs2rXCIRSrWd7UKkzR9lTs/QNAAhozrESk9iTLJO\nFHaAs8ETXGsdl3YNHdOHII0vy4ruX7ETyuIjq1HQ7eXXOz0HRgbQtiM6IjPW\nAU/u\r\n=u7Jn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAq7BU8ZqowTSTvmg2AcIZYUiMeSvlbKF2o/EV1PC1tQIgHTxGzq/FOyF+zxWw3dw8A2u4Ah7vXZNQTzk2NxGZ+Tg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5817c05.2_1584556463994_0.008735779854179393"},"_hasShrinkwrap":false},"0.0.0-canary.db5498f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.db5498f.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.db5498f.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.db5498f.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.db5498f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.db5498f.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-TaGOBPGL/HJvPMuk7w0XMnDcSanuyojUT4LcQKHk6wOO/232/rMnKA/hcgX3FGJJPiMakqRfILwsgqhYyFkvIQ==","shasum":"4892ab6ed14a27ff088272a480d720e384673f77","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.db5498f.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedQRnCRA9TVsSAnZWagAAKR8P/3Y0zpyI20dcERjLwBsb\nJ+KbY/gPLJPCI6y9TXJpjVzvymP9o/alPSPbISMLEJPND32+XAK8GGMG3ive\nDph5ivgpliHnWwHyuMKcaiqkpL5gJdI8IH6CqtzYhzrVqKbq64X97PJFoxO4\n+ZAkSLRkv0coaz0zsrXqBNGuDgSWtKRMmH0nlj2Z2hug2qz/HRuxQC4sNsR4\n1JFzO5PU5jntbfrWIvMp07tA5+XExRqtWNdoOHY4UwfM8GVxydEqy1qZCxG8\n15hmKTuikTsLGXKr0c2bqnGBK/6RPVD60Zfs5VaT4adAP4Im94wE8Fvjn6FT\n3HGQhxsltXsTOdzwyBSsXrnEcKciagQTJDMr0MsMzyAC63AEMIsjPH7nx4gD\nEfZbQ1e+fObV9LyeqNyg1wokm17UCvQpAcGEnfVaN5Oqr80Kr9ywnRefYd15\n7D0FE4PP20YADMQP+VW1MY2CbmsQWh5py5klcz1Eh2hjTpTKPKD5ICPsOvwV\nWG8Gowym/1RrLt5bl3oBRZaOXKAfk/HxgChHIWbXAn2Gk/Rblt0tG9XFqRIR\ni06uwqoG3G2ueRY73hZGyGyRNFtH47k7oxu4l8YcX/Mgx8iWuGUGfr2ol2nD\n2Ma4ZMEW3koJDRkSDkx8+Vmb6h+uUu/jyqLaSzti3MDY46lV5xR4EPeaCQR/\nAeC/\r\n=gO12\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBuqs1F5OUWMjGkxv2rZwCGSDbiG7Svq8ZveYkjPXE5IAiEAzQ9W/EKBcOTEPseeo1/yaC0VDGBkzQTbygyZCpNpMOg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.db5498f.0_1584727142777_0.39250417547487393"},"_hasShrinkwrap":false},"0.0.0-canary.db5498f.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.db5498f.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.db5498f.1","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.db5498f.1"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.db5498f.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.db5498f.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-HyT8CcfhMFSpCLk7gOGErGSg3/E2iwaXobz6DPK2pc1ErXhHZs80+L48oq2d6TqYWZa4PllUIdkDQ4WyYaR00A==","shasum":"5226537d2626410ccffff97da8bcc84d8a969243","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.db5498f.1.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedRImCRA9TVsSAnZWagAAlRcP/0DXWtOcEq/oh+/Zd5wR\nUWawAanqAM6en/D38IU+8okx8RuoHmb88K8J0RNr/bDCOMqQIpOn0lIVJ7Po\n0N4lhYluOdUB8DfO53psfV7gp0jGZf4fMBFQ43slTHFm3Qs1FUurcnAUpkAO\nqnS5YPyaHCXRjPLR/KGU3Q4mY6v0BVnMWU3PPwx/hP8ptPRx7hLl5tVB0AhI\nW80aN76D7x/RD+GGQomxXfMitGQHIPs6cTEUQ9jF/4Dta+IzZw/rdYfEggt/\n9CBkP/+19MhrszEGDda56iQ5zosJRLWXU+ARYiDkMBSWT7qGIhouJSeKr7dP\nV8Fc0TEbO/rv2tXr//lKLmkjfpjwDbVcwXTjJ/hXmLTz+9veFI08oZocQzb/\nh0wlcMYJUSgYaqw3aUILCeA4tcGa3q1m19x2X2pWsMsTUUvqvuwVD0qXN1mf\nUAYY/JpnZLpZQd59gwp8Qz+Bs6hYWSSaDh87ivpYpmr6AH8Hj/xm1vradZG3\nmSpwd3Kdtxw7OOu5DrsEsJinqtUPs40ZSMF3FOAtwd1PWG6RNMTGBrXskTEy\nqkul6suPVa/uCp16o6/yUBWevj4gGG1Iyy4Xi3V+jtKxzr461AnGwYV6rXo/\nnJO3daqcUfugyki+qQgW0QNs3ocilrDT4ZQYxJCyjsvIBU0/pzGi5dn2rbfy\n/kAP\r\n=dMOb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqFwcPs69q7XvuQBsYE7lPoPeMto9qivIL055mPx/XqAiBiUr4kRVPrH3aRBwKpLpP7ecrFDlQ7CW7aDkhEsdAIhA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.db5498f.1_1584730661900_0.5115928119838515"},"_hasShrinkwrap":false},"0.0.0-canary.b3d958e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b3d958e.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.1","fusion-plugin-universal-events":"0.0.0-canary.b3d958e.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.b3d958e.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b3d958e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b3d958e.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Xxxx9QCOZcqnYZmYjO06Iw4HGGvdXu9YZLV7vg+KFmf5lo+FnVPkkZJp80PMWM/PHhKImQ1OlluuAQMOE3e2xg==","shasum":"e9ffa63f99fe9e40d4e3c40f42c922d810085cc9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b3d958e.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeT3QCRA9TVsSAnZWagAAlzEP/2IYWEdRGCqldNgZ51Z2\n1bP63L/YPXtvSmJ/VnXQ3P9EpZqOeXO2wfmtCmwEmOREzC4nnoCLx9IsXnTI\nr3R6kj8Rpb8M808V03GYVy5/bck+Hhv8ZHh9AYHmnHCZQS434YiuFKKaDBVP\n3pGDI3gANRa0G3vj91QW1Rq9eHCbJzi9mlRYy0QwkAhsVQc4yUB5x3pf+5Hh\nIb0LS1SMociHJlHPhr4wMhVxwUE0q5yp1sXI8DpQxPHsBpMmecq71F5pmGi2\nPdLAuEvJBxFUm0Uy9G+Jg9oKTBn2fvg2aTeqyOLta0Wa/uxNi1oXabkZN4yF\nkVEJDTq3G01HOXw+a7ER6M/t0L0xOIIEe1NUSX//1UizY/wBsM+21Fp+kYNc\n+1cL1z9CnwqkZnRNYaxTJ7VKHIKYelp3ye7g5BoZqRj8y5Lrggr8nhu344B/\nS9sWTZ6ehqTOWxoMX6lksy/TidXQzay/HyHRxfmCtVz8V/1iXnM9jUbvT3Ox\nYXzhrdGbM31/rQABbWFphsdNSjpB3c2bl0Lo2FcAaVs9GaCK/9iF2ntNeSu9\nYcgTctW3AVgvxC5xB6ddWv358j1pOWvIsum/lrcGyshV9J4dcLK3tjqlrtaP\nHMTDPu+22S/qJzlYyEdaKJ3kb5kx0xofulEf4NzeiGzwkq/nS9TrwYbhsT+o\nIQXP\r\n=i6Mv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDds3zXzwRNHHG/0Y7J5cP+o3PwjsrRT5dQ1YWFhJj9IwIgYR+6P1T0wfhXFTviaPGjAhQKe0wFmWdgxadZWcBf0Rs="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b3d958e.0_1585003984064_0.28775490898099165"},"_hasShrinkwrap":false},"0.0.0-canary.fa25698.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fa25698.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"0.0.0-canary.fa25698.0","fusion-plugin-universal-events":"0.0.0-canary.fa25698.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.fa25698.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fa25698.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fa25698.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-PQWY4MyNs4bcHmHqUI8dp3pDuyqA2IsX/P3Oth4P5RslSrFMkl4UynHbCqAdU8pH68Tac6nroXTMq4BEoI1D7w==","shasum":"22fa130360ebf70335b392cd5ff1ccd9a99f012c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fa25698.0.tgz","fileCount":11,"unpackedSize":40067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeek/ZCRA9TVsSAnZWagAAHKwQAI4gaY8Ww9K9bup3aCEK\nU2aU9kJf5X9Kv8+dwGdgo/RuO06UZe2aTuWdzIOUKNmq/Cu3xTfo5kGoeCR2\n3eFSYFg+5FguSbcaDp2MgiPRu1zoM6EdLzJk0waMYpLcjbJtMpFOZP+LXTI1\nX5Pl2F21KwYgn2vrjWQBgigqvriYHYsiuh5ykjPNLRlXEqZdxICIoHlmmbml\ntCSrZAIDIzBGr0rMLB2eW3m1YuWxI6xAwthN1ej0ffhB6VPJM4v86BTcrgse\nn7VDb4eNDrzdmHMNOVZjKBQRZWifL9Ov8vCCRDpwKP3K1zLmGblVRW5DKb+y\nl/xOPjv1RPEGOut86M+BBHXEsu9mDrZjBd+5NeFtLWIQtGAFFdks0lyUCxua\nLVzME5d8jS4wKfK+BeeHod4dIl5apqXOvChqQOOtFtNXKQACvf/LsqRWS4C1\nLeUZa7zYZB9zgwjXnBIl9hxiR4WnKvwphjj4bTOvsa/3eYhG/LHaK+w/9t7p\nSc1PId4TRzC5CBOuEZWkx56MS/xx7Jzqyq+ydE2DjQkjwKXFzJNV686pB1D1\nrEArI2C5WS1/d5D59WsTgJ/gjkeJJz4TLRcSYdJDK3K+V7311CyewdT4KiPL\nTxFYbKrJtSXdP/5w1EHenMXya6Tlv5xnRsvZ1k9IDfSQk1He1fBmbTlsWiDG\nBiqm\r\n=okKH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBGworCgEBe/w34lm9XoyH54kKjwH71ii4/aZfA84XAAiEAgTT8iOpqxQK3G/RtE3/xUMH5gdvRMAt793Yq02gG5U8="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fa25698.0_1585074136904_0.8871775654632241"},"_hasShrinkwrap":false},"0.0.0-canary.11d6f93.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.11d6f93.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"0.0.0-canary.11d6f93.0","fusion-plugin-universal-events":"0.0.0-canary.11d6f93.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.11d6f93.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.11d6f93.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.11d6f93.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-YjtgYzJtECJSdr4/YC4A1FsphwqCk2QIrKjHmfJ0CsSki3uWOGwReAsE/5aFU8gNkeDialnm7I5KDyy1pTGA0Q==","shasum":"e1821513b7a68e375e63922446da316cdb588863","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.11d6f93.0.tgz","fileCount":11,"unpackedSize":40067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee7ykCRA9TVsSAnZWagAAlQQQAIJ5F9qofFY1c75zzkSa\nqfJ6856Tr+GEihY7IjYa1B/lVHppAentqALvRY8Q1Q9A8HGDYsWzqbofbiFY\nUQ0O54I4Idz9wCSVOq6IU+tiiXP7Y1/64oh+qvuCfwiBXsc9dCAjC5nAbTAx\nygR3S8D2z0QcY31xncvB7l8DRuZhjPNysT8feiI1KyaOgUsNLi3OhJ/fltn7\nzDBd8Pui2ura3O0KIj8L6muJan+whAqxqI4phjl7tShMekkPu1v4zHDgMSuU\nuajq16FUfXJPkDNRpv2B9RMWw0zdoBzDjVq6/KQI6MnSr55F0ueW7imRLW2e\n/+tOkndgxZBaN/r3GjuDJqFCMHHl8+j63jKvtta6KHJNMJ44q+6sJGepuK0i\nc0cwPCW9HVOVNCkgtn5Nycx1Mqh5T2WWICYFlOz9Dw8HaFZ4o6rJ8RyuFRX1\nP3rHNS1TiPWsdlShzm1FeMS1+itYuvpOuI8ErFew6oy4VOR2e0AliHAgZEU8\n15IQqnfbzgToI1w2DQatgrsp1mT+eXE7/wlu7U/eWdRuIqgSdGRXEaIkRW3+\nxLpCPweLRLUYpeNIugcwLe9RZAZ3CgViBneIasgtLVZfL2hI+Y2SL4VYJkAJ\nJ3i7t2YIwI5e5iuvh3u1N0t5toqhjXjvXOc+vyZ6KoEptYEvCHdyJZQgiohw\nlV+v\r\n=FF2Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0kWSO73Vt4/ke83PDuwHejFeIeoGsH7XsCSpZj6nGOAiEAyK5uwygTPhhyg+VCXiIwpNcgQaD3r4H4lEkPRR7YC38="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.11d6f93.0_1585167523830_0.904892079077916"},"_hasShrinkwrap":false},"0.0.0-canary.adfde84.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.adfde84.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"0.0.0-canary.adfde84.0","fusion-plugin-universal-events":"0.0.0-canary.adfde84.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.adfde84.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.adfde84.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.adfde84.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-V/J4kFaruJH4acZdQvSExAkvjP8cEKKEQqFrz5F9qqSIIGhxndM5m4TV0QMerhqohKhr1Jfx2p6NoCxGShpgUA==","shasum":"99f53791a9f5f06641e9c4283af3bf650e26097f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.adfde84.0.tgz","fileCount":11,"unpackedSize":40067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehL9SCRA9TVsSAnZWagAAikoQAJ2bcNi2Ror3Zn4fkOp4\nzm3wcPlLuHuG/zHYc8z0MsontskJC9wotnQHgmD0x1VK00CbrXAZEQ/9D6ap\nSIcE47RYZwNire5kBWq7U/EzmDc7Y2PnAbd+8GssEo9ILLqFH32YfQ78z2Vd\nzIZjHI70SQvaMuRcnUQnjLMb60QQ+3suPrDA9GEF5plQGBXGehFlNsyp43Ai\nU8r4/OruVwjaO3/il2Ou4SzCEL0Nx6pohSIL8F+f9ehML7dE3FlKUdieE3Es\nzB8bXTyLMV2IcPtHVc0pum5ueLE3SBBrKgmtsMfL0PGVLRUrT1dmgC/DXSn2\nDjB/OwNvNgNG9HTDwyY1+c7qInJtZbKcwcjnmiXlBhMMrN8yiVRdNR/VofC6\nkQ1tD/b3aBrXHKvifyjNEF2dxesW25gIwdrjsDOqJT2Gwe+fYcWyAwvCGn/2\n+AXwoIaq6kyCbaLquLt4B+xo2OlYFdOlAhL66ilEyT0oT1xw1VpIMNWReIbg\nvNU+utdBL7YxSK0LqGlK5HHk9HJcCZpd2I1PGO4GxO3bAEGcgps5pHSFp4/Q\nSkraXrC1speyzBvuQFShLIlLi3AHEjmwBPqE0+klb1rNruFpAeh8H3S8jiwc\nF7ukowS/8cKZQZ00VDjJyzo6t6bXODt5UGyCbav+9gHcVg3ZkLTvPz3EHS7q\nW/gG\r\n=70dO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2dGqfBYlGm8qT8a3G1YrEayN4RnO4+NeXIQKSoPjnGQIhAK7SWuUpsxFDZ3hmXSbC2eIgnCWDKUhQBmyMXxyt9cds"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.adfde84.0_1585758034144_0.13549555742373465"},"_hasShrinkwrap":false},"0.0.0-canary.adfde84.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.adfde84.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"0.0.0-canary.adfde84.1","fusion-plugin-universal-events":"0.0.0-canary.adfde84.1","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.adfde84.1"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.adfde84.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.adfde84.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-jkIrn4n2DVYUGHigXzVyk4fF6fPJzcDlCXpGd04XAaS11E7s6h7gwY/DCKE4+ldxSgkWKONv4gOakbIL2bq4IQ==","shasum":"49937c70a7076e156acfa530e7add44e9f130353","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.adfde84.1.tgz","fileCount":11,"unpackedSize":40067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejkhOCRA9TVsSAnZWagAAl3IP/3bPcaNfgaZvPlMNAYt4\n3oBOYjk30ba27Xp1ZQT1uNsC+Elo4Rxg9eAHToxReuG04hZ3YW90MkSoRQcU\nnH0+HdufSNEZ8uwvCu5rtvkc7ll7izuUhKtacGJYw3hDEC+WI2eoUlNibxkW\n+JcFX878c8AP3d1AkOzkq+qcDtglO/o6rdEmb0feSDaARIWiIzMxFd1Az0fg\nZCg/XR990lxOfTuzAHm2rrgZyYIe9YEMe/QVUfLIzlFnzemuDJyeapVWfHBt\nbpSQNNtcsDqzBllYVJGDC89/1Ew/ejM9zmyh/dDYVaLqFnbmyDdeADQhF5Sq\nXyVpiG6eM1vQJwggtVPzrL50ewFOzTwjGig/8jCFMyr+PgyvpgC2AUnODspM\nA1MkKjeB9HLStOCel6Wj1iSvqPWUfAtj7ARrUrkI1f71piYhgAvjw/n2kzbA\n+om6BtcEcAE20IC+msD/hSo845AE+VEt0PKcp84/mAWfe7cgXgjMDPLAjPJG\nw9d8edKCVqbH6Ck5lur/DS5vAWfvDEjIG1SDLGfnS0CziPfkOJ5ChYxXpVMw\nKYiFum2VpitPoh3tOJus/Z/YmF5BAY6qcUEUtK1OeZnt83qIVHjxPvmlwUxK\nDKgfc3fqY/TwrOfwDcv+GWkoD32Z8n0iJwauEqE1sPc7z35JnsEpMfk8dVbj\nFGAW\r\n=OrHX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA6yPwbRWKFC4OOfsqUvWUXbNpolW6p6Mn2RlsnVa+d0AiBxuood9Y4qDHmlWEOaoQhF+YlUNFWq6I+uIGK97lVLxA=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.adfde84.1_1586382925930_0.2502911557675047"},"_hasShrinkwrap":false},"0.0.0-canary.26ab130.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.26ab130.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"0.0.0-canary.26ab130.0","fusion-plugin-universal-events":"0.0.0-canary.26ab130.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.26ab130.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.26ab130.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.26ab130.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-sLpdtsi7cQE0hDxpaTzDHzfpg8jg/kurUzLsgpU3K79G+FHePewy0LQgy0l8jqPj1JtuLZju4y07h0Ai9P6ctw==","shasum":"9deb0eb974411999aa46ca7ba986f7505ab7845f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.26ab130.0.tgz","fileCount":11,"unpackedSize":40067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejl3hCRA9TVsSAnZWagAAVPoP/0ArW8MLgbhnJUa+YM/v\n2eT2QbBTQOcLyprWUEhEcBqZvgAlPXQ74Pi9K7HRYUUpDdpgHgY0iffk8hPf\nfi2AGnjGZ145+igeaQ0HUAC5awaHS2fYhDARhqi2Pp2c9EHNRZkc3hBz422w\n6jDQvY+nscgBD0bMt+l5cpiqTMQ4dgB8sLdrcWXe8j8ZkRmgRxZUIiHmUH2S\nRlRTS3lUkGlp/tHKuyYPHED9N9nlYQRmQYStjI0MbRcdJGRYeW9nWM7OJMnM\n88r1yTIlK1kIvoMob3AHrBIobl4xxwVNJT9WmZu4Jf1Yp0QV4B7VXFl75Hf5\nqDxUrMe/XF5o0pLvu6EjckuWGy73QwSaYLy4l9BGZWPXDVlXXGMIuSkLz1hC\nx9dl8RDBhrVpWZRQKmJf739xbqsB4H/x/3IGAr1QjDQ1i+AeEW0Qsp/lzQ1u\nVTJ8NWTMZbXLJg4CezQRAg0avn0BN8Rhf5KhS20k6Zsa3MGMU32L5l8Upi6y\nEsyrmOa/wvxuJiyGyNpbyMul5WQhbGReJTwP+6lSGEwoF20nSqxCNtSbZLuF\n5SdQuwFIrH+DlsXOMBL3nmmfc7LjjFJboLo9kNj48jncn/daHmrcNFYD4D6u\nCeCH7+IhBgOSGN+UxiPv9rYATkWr3iRLHAF95CMkr4ij5HFVYs2x7I09leN1\nmGZ4\r\n=x1UP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSDdlfL/Otv4jZxqtnkmnSOLO453D2Tljrh9lfwZ3eCAiBY2/fzIyTii0kCiIbNChVPyNKG1g5PXxIhViZKz8ehJg=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.26ab130.0_1586388449459_0.6160583442388952"},"_hasShrinkwrap":false},"0.0.0-canary.f9fd82a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f9fd82a.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"0.0.0-canary.f9fd82a.0","fusion-plugin-universal-events":"0.0.0-canary.f9fd82a.0","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"0.0.0-canary.f9fd82a.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f9fd82a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f9fd82a.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-4FjENZum55a9D04C0miIC/qpnfshcW18iMePJIx1DLyr016CTGJn+bYGwzRmK6S9zHRtHBWP4n+jVucP3h0nig==","shasum":"47486e3278b91650a582ef8e2d3c63e63ba1dba4","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f9fd82a.0.tgz","fileCount":11,"unpackedSize":40067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJejmBDCRA9TVsSAnZWagAABXAP/0vlYjHGYq+J8fe9xocu\nWyb6xPa0UNmaElU8lvPAGBzjoDW2t7w0T5YytNg9qtmJNtglrsSiO2LoygTU\nNZBoXeUiV1lGqZ8whvwVjJB0hwhfg8OpFmIPHZQrU7xLPfi63bVLwdzgdvtR\n16h2OwkXK0+jMDE0ao1ylggmBhk9JkyFqmgWNJMLyO8nCoKETBja+cpQ9+SG\nXVBIiYytLlEz6sepI+Xz+ZjTAiwDTf2M95GZ2qthr/INFY2dMaWWqledexE5\n4N6ndXZ87jsAtAfz7cGm9bx3s9/tCIYo+NxuGbS8MVJbejEssdMLfJ8TF8Fr\n8o36eXyNVCnOKQjnCq7h3EQNxdEWJHygbB16g0SHPgWNzh7ccsQo7zfP1+YW\n844nEnFL1lMGd7lbDvAlmbYsM/3oIVGPcoV4HUS6njnU6vEbvRGW/nBE6tdY\nkgBrp2Bi4FLFjw1Q10I4xtm96+6fbqPhxOm5JP/Ow45dj8POGfbvw2Rdavoz\nVklPfZ1yEiKintzcJMl4NR6++CgHtOmsrMDnZIxEo9i2ViQME1iK9IKvXVnq\nJTHhO1Cb+ApNxkjy7Z1xF2PVaxKQzlXkt9y6UueWDmQ2EEAdiPapD3NE0JfI\nT9wGxwwLfrNeENkDxXrNf0Ct1pxBST+g5zt6oFgtMghKdRgqyWECrDfzoM8o\n9twb\r\n=SpJu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkgCsIOIgFbDc1B3fmYuN8kXvs8GEdLQT6gOiwLlstMQIgFvAhdPPBuETWZ0+9N+Ci+m11Ljn+cWUgmBxVWOd3PEg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f9fd82a.0_1586389059309_0.8660490838868582"},"_hasShrinkwrap":false},"3.1.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.2","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.0","fusion-plugin-react-redux":"2.1.2","fusion-plugin-universal-events":"2.1.2","fusion-test-utils":"2.1.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.0","fusion-plugin-universal-events":"2.1.2"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.2.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.2","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-jDf53nnItwHMlUrWftiEKHbGDscGuFURP0mL6DFDs4AnaFdwRkfWKCyVVySkK7efeZHxNa1dzysAyo19fCQ/nw==","shasum":"314fe37bd916b75b50646fe86fd0ce58c0279b8a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.2.tgz","fileCount":11,"unpackedSize":39999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJej32OCRA9TVsSAnZWagAAVbMQAI/0stg8WdoeadflX0JE\nY4SZO/RC2tMZmo84gO8x9XnE5Yv3MrUcz4VxlkLaNUw2qxN3tqJhLu6sNYkR\nBFoKWlBLr3E1Zh1sRW76gRfjBFkuK26cdLaAOlzk/vvx/lXkv02twi/rkcuM\nxjR7gXio9gyehTtbmePpVhbm237SLCTNGk6bwfUFubLA09neXeRXIDuHApVD\nwjVLrrZwTC1M5D9tByCsbyOzuGkDMxX9gUyRtdOK5zd9sowOdXWAw20dEkR/\ny4YJbQnNJ9DI6K8H3WCvmMdEzI1SS1P5BrNDLWDJzWkm/811b6mi5QBQGryU\nSva0/UrOT+dY6pDMnxufVptV3kzsGk28+qljipoAbo0bHVOUF9o4Ly4qcOu+\nTeoqIBLUN8f7IWUGclUuOY3OSqEXDWbGlRGt5FkrKwHcbL+7v3mx1G6OBhgq\niqJQOB8Z13jxPiP9jCJXrJ8/DR6VWm46SL+yyYwLHHoVigFle5SlMptb8WIo\nhEIZp20w+FSby0T5uEAMPswPDYi8UnkboXrVPJf56taLQJj/5MtgoBXTHO1M\nTGKhAnoy7qB6coKYMCwCXcXrN9iv/Ffyl4wu74bPTGFbZKe5qxyC+Vo5WIva\nm8h8TYmb2UhCODlxuK30whHUssULpvq8AriOTU7zwEjVh+CM2jFqIG8zitm3\nUdeQ\r\n=4FaJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDTb4ZGuNVaZt+k1z5PrEyhtHdIMudWy09TFxe0wg3pwIgOCB+tVgNpRLVHIhaz2SwwdeRiy8kC6sxNZPo7/Ed7zw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.2_1586462094324_0.04349728113349571"},"_hasShrinkwrap":false},"0.0.0-canary.74cf916.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.74cf916.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.74cf916.0","fusion-plugin-react-redux":"0.0.0-canary.74cf916.0","fusion-plugin-universal-events":"0.0.0-canary.74cf916.0","fusion-test-utils":"0.0.0-canary.74cf916.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.74cf916.0","fusion-plugin-universal-events":"0.0.0-canary.74cf916.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.74cf916.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.74cf916.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-yNVn9B4y1N4BYvITqWRqq2+RISW0/ZWc5xLSxXBKaZRLd/Eegx0r14t2OWUBSPWIyXXJZzUFH5NQcxMF11QUDA==","shasum":"259d05260e0068c4ad412126ced27d8cbca806c1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.74cf916.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJej4Z1CRA9TVsSAnZWagAAKrsP/1F7L9K9ZDDQtuxgkFnN\nxH8sOUw1ZK80uiVFj4j2ryjoJubYFcth7zpojBpDv2oUtKwDAc9pFYoWNXzv\n5UYE8yAgl3lraa25vfvWTphZMnSfTnbgGEGvc/JgqO3bM8MRcXGcqNAg4DVj\n7yCr93A5Ny7TnC4LEHKVWxHDG7+TyUOSbR4uK4X5u9RtuRpK97gsLQjcUBUS\nQylvrr2LyacHi8sWM036SvXIxl5RdBmoWg0mcJK3QyZ+kv1rzPBnOfzj3c5u\nI2jR0dUDGYVpFGu0dwoK+6oEelV+0yIkZ2zvC2TATA38Q1Cf+WhPV0wtbUx/\ne5MUlnNWP4w4C+07CxKmfC9cp8A0F9z91C+S44OctxJHCvtjKkuDzAs/e6NW\nPN5FjGQ95+UpIUSTG6Z2zrZ2qt+mh6UM5jGFBupePQT1S6vgQwxzCa9ABWHj\nhm7uiWL1uNGto79NqcCIJBh4TVcqDDPr9HWxQZuKPRKaF24ouDUgw3UvorcY\nFt2oCM/gVfgvDvYYxL4WrQegp2Apbjj3T/S+R5mSM5+tT/DKD8mIG8eoFXCR\nZY2b+jhtmSvhY7znUzRl3+PK3OEzen8OWd27P6tCyK38RFp5cqALTO/hwxxz\nizVTP2Tr/GPjHksdOeAwszyF0m2aU7gJ/WRy3yaj3GnAGIZDXr1226FcY0Nb\n/kE0\r\n=+92/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIET5i4VduQ9Os5f6T6cHbdkBmYgP2RvhBbS/+r1VmYMMAiEA9qa/6OHs1IwDiHg2vzWxmHKq/ZmywQqpW5X2abevrX4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.74cf916.0_1586464372839_0.04496674464709116"},"_hasShrinkwrap":false},"0.0.0-canary.5a76e33.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5a76e33.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.5a76e33.0","fusion-plugin-react-redux":"0.0.0-canary.5a76e33.0","fusion-plugin-universal-events":"0.0.0-canary.5a76e33.0","fusion-test-utils":"0.0.0-canary.5a76e33.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.5a76e33.0","fusion-plugin-universal-events":"0.0.0-canary.5a76e33.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5a76e33.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5a76e33.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-fcOTkWPXq5FHPIPWuMZTx1dZ3suRFO4psag+2kgThRnBUY0Xmy4fnBOddu1JOAb09artSV5b7OsXlYdZ6mH+hQ==","shasum":"6328092c62ebdd569acbdf25309c791703237245","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5a76e33.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelQ/PCRA9TVsSAnZWagAA0EcP/iKLrPgbtyCNylu+oduB\n9Lr7WQ0ixDRIjPR4TS3zfQy+cMnd/FnK1RLtppiXKzWr+yMFdFYrA6LJ8c7v\nn5ulyWfTVZmfqwuvFTpuxGyjxfJIcshIEj6zFzwOyXoFTGpRJl7mWVKlUhAe\nl3jftBVmorxQO5I5H1sluOdE0r1VPe3BwzfM3q4XJp/GVTrDOx456QVSYlVs\nMfyA+2LbMzM8C8xu78lHp4/S9K/GQd5E57Cs0FyG+bYgfycEns8cRX/6cTMC\nEejH4KqPv6erOw/Pj0UbVJ9P6O7iDJnoeow8rQbZVkpMZbnlDGU7cYAsPcBm\nRJHKUssKuOo2vPTq/nkYxIdKPOiYWDwTJ/xAOK8VZWk7aIY2PWk6iS/SJXbq\nd2PvjHbqAWzRx7Ah9RsYM7rCj3ukdHQgMn4X2HyUljaVb3NZZ8JKpQiSbA+Q\nZDKr2MSc/Zpmptq1Xu3naqw71sLhjXQdvlnb+sYlB3vUP8u9j5CSAqUVvUMm\nrqmwORF7kMV0/5B7N5T83WEvTZslhAEScgh+AEoTkuVHXAarzUmcs5u/9JBs\nmCGAwae3pns29++zhNL/zcAKX6sbEImANmkdxRI0jQ1X1Xt1ABZFWq3+EeFE\nKaIeMYFiHWNPuqWlTNvafuaYxvd4Yc1qwPLaorJ3joxkHkJFD0rKmaoj+kYQ\nyBOp\r\n=91Yh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPfkyptrsO2+0pSji+j+FNF6kRpYyr4lIf0repNsqM3AiEAhUOUgmMSTkJVUMv+br8WjkRhK0OH9PLujp3PUgX10gk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5a76e33.0_1586827215046_0.6902589374725323"},"_hasShrinkwrap":false},"0.0.0-canary.8de64d7.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.8de64d7.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.8de64d7.0","fusion-plugin-react-redux":"0.0.0-canary.8de64d7.0","fusion-plugin-universal-events":"0.0.0-canary.8de64d7.0","fusion-test-utils":"0.0.0-canary.8de64d7.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.8de64d7.0","fusion-plugin-universal-events":"0.0.0-canary.8de64d7.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8de64d7.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.8de64d7.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-vpidI1o91k3UJofrgNrgn76IdOPS6oDdxAoN2JCtng3Sll7hYN/rH4oqkEl+OxHROfn5JC7DYtXggumWasDDHA==","shasum":"3b5ac18e235d2cd06bdd7fc5b32282be5d3abc21","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8de64d7.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelhSYCRA9TVsSAnZWagAANTUP+gOJb+IZN7aUXQOzWigU\n5s9RSqfevrFdSi7aIF89JpowdDSeFSIo1Zfytx/dK4fs00bPkJZs8bzdPBby\np5qud1wG2ltO5vj5Rdui93tezldXFW/tD2jzD4/LxSd29OCmYN1aTn+ta14f\nt3dSSZUMnhx5dHGDsIPIK2NiKPrJsztONV4SBWDNZwPaRC6STTZ4Kz+CYZam\nN807Gs12EhdDgVrKFY2GnYrq9p+47eykubyYWVQKbo0biUx13tYaWZcJeOX1\nVUWvM7PcfgqSjs2BRzL3rfMQ8jZNN16YbHq66gVVs9TKzDhh37/y10aNmjyK\ntF/SgZBRjk/6kACj4TU8KZdnqjGmTmxh0657Tjq7rdFETph/Ha1rU0mzkZk0\n0eLnWDb6m6udzOnfaHRvbOZ3KQBMg/I6TrRay99DRyo+Vko/iivurFd/BwST\nWnMgcaseo0Vq+sd4ebmB4JW/3EdKnmTI7BAWi9gGkcY0thvLVpQWi5LE1RTK\n5fIiyfsUaWfYznuUNJZGqiIPadDNU4oqK2g4W/Q+N6kIJekQpYrsRlVWTl51\nO7N8qHrvTKYp1OOM949oLgx/exO9laloh8wAzIRe7TOGUoCxqFeVOVD0Pehb\nob/BnIWTcOPOnmTM+fnSdGBFBtQPDRkmvM95DMwGeeCgUz8KJJUkCHIdVzYm\n6iwJ\r\n=xKiy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTUDowzeyH4X0GtCXEsdB5ZGB1R34z9CQ46FJv87jD0wIhAI9o11EnE/WO6GJucp1OSYG+TB1aIEytqiNCIGFor7sw"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.8de64d7.0_1586893975452_0.31874500018340735"},"_hasShrinkwrap":false},"0.0.0-canary.d9ad58b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d9ad58b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.d9ad58b.0","fusion-plugin-react-redux":"0.0.0-canary.d9ad58b.0","fusion-plugin-universal-events":"0.0.0-canary.d9ad58b.0","fusion-test-utils":"0.0.0-canary.d9ad58b.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.d9ad58b.0","fusion-plugin-universal-events":"0.0.0-canary.d9ad58b.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d9ad58b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d9ad58b.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-BrzEK5g81NqUGpEMLKzz81+GQPLduByPp9/E9eEndqrrqfzkUZI7wTXGtz/5sd+FvrxVmSwA87E3x6KyJh1IIQ==","shasum":"8a49adfc52621db067e3279d537230054b0f30c0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d9ad58b.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJelqtzCRA9TVsSAnZWagAA0xEP/1dn0OCvjAqObz5Ct1nz\nYfWm857tP6e2/jowNC8mcwuj8hW0eynoNm1PXwnEtLrYAVZCKXFFY6gBe7qM\n0hmT/tBCFj2tSpzkEFzBNWXuZL9z9Ruzs+xVDwofS1uNUxfh/qT1GmPPKpFz\n0gLSwMQ8bdgWvOCJO7bBiOyWoa1pwcSS9rZGUgW6zTILL6A3pQ0pqW+hbREq\nxfIoPKB0XYaGM4cXC4Kd31SHhucu0ceEiDXKaD2HqHzIaZewgucAIREDROt+\nAJ8UPSqUG5Y+QM4ddo1CCw0U5tTBPOrMza3x9dzbszI5v+UOZ75nQldhijgB\nkQsXs6rtd1YBUUHtdNO4dnmSmVQz/ZYB1Pzfr8OjQ79rCGoCwYtL1/fKfNFf\nFdw/4fySUShN/dI+45m/7KnaLSuztJF6VSWJaLlB6hwKqxxALl3hvlDNeV9D\nxqeqJgQYtN4ULtg7HhlvJSlM/pw+dbJGMbH5N1+yiA4Raerbreby6Cmhd4lS\nkJymBfPHYBr14kToX4b7emzjOqhTq1tEnCNkdjiXYQNknmrc2k+phrRY2yjK\nX+H4RBHy99TiTaBEFhj8u/BRh0b2rzwPCF9uvkVI3Q4pYKxy5NobZVfOKEpz\nIqxRFv0PvNBvQOUFrqscS+hrGze/VnQd4jz6cPDE/BYJiHK2wKqR0Obhfe5e\neYt6\r\n=YOZM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHyPW6W0vLsif38Sl3GchrRsWcm9Q3cz7nl9BB9i0KOQIgOqcOLwSg0xiUsILw0QqWb30v3kwse0opp3mFR1bQFWE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d9ad58b.0_1586932595378_0.8199919352842018"},"_hasShrinkwrap":false},"0.0.0-canary.9049f58.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9049f58.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9049f58.0","fusion-plugin-react-redux":"0.0.0-canary.9049f58.0","fusion-plugin-universal-events":"0.0.0-canary.9049f58.0","fusion-test-utils":"0.0.0-canary.9049f58.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.9049f58.0","fusion-plugin-universal-events":"0.0.0-canary.9049f58.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9049f58.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9049f58.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-1AN9ANqF3Bg+0cPf/CdP4DKS/Qkpj9P8gI5wuA6x3/7YSLBZIYuJ7V59Z/IymLrkATCUS2rZmBSvU7pjPASggw==","shasum":"25c703e0968ea9cfcf3387bff8534d638d3c5bf3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9049f58.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJel9yaCRA9TVsSAnZWagAAzXwP/iW0jSlo8BMxY2JBxtYj\n6Ln8inY/kizA60zaaipqaui0CHOaMnwWla1G8QS6+zEVEtBUo7xQfVl6RTHw\n0Z7GH1p+Ksx7fNbo00SM10/iUHuqMW6Ok/tphs/tArGKTn4uynEcEvdHUast\nb+64tMAdkjML7iZEHdxwnPbcobHw2W9GtD28SUMoVv5vr/npqIo6jhKSMuuC\nynecw2nU26WrP66EQSEQyJIAUAOUupK7ocXyDmj1qfdKRF+8K9oM605/7+2x\nTyyQPB6IkTP+ptZu4KVSlwWc5TH2sPE2/ZLxqf3IK7gcp/7ZklG0prtCXeut\nyP/+wOQnvlXZB918ifYewqCHeB+xobgsk6ReTLquASbSrvn2cV/iJ4i7uM74\nBJtVhsFADfDcTpLaSNKQP1AUY+OIuYrTC7u1rR2MNuV8egZnqh+r9UEt1BC4\nRNW+0Igx4MW+0beAIEQPj1xORMmgtK9R4qGbkGtu7atLNZD4VqBafRovAqQ4\nQWFE2GVQi88hM+AQNEDeTbJwmw8M7Djlik6Fn+eEKvi6awXB14og0WOHYbA/\npuEj2CR5d7ZCKfL7MciCHDwYIoAqXH7DWN91KyuaGJZU2XHxYFkxapf+GUbW\nHD7oCyULVEwIxmIfGrIAM+sWZdNg1QqZ9ND9oindrvLF9SuxPtZEHBJzhroo\nr73e\r\n=8h+6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXLmnVC3a+3oR30aQep2vU4Mb7Ca1aQGcrDiE1aU9XggIhAOX+jTxzZehvmRYUxK1RSPIQXKNvaznixyY5feQLsl07"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9049f58.0_1587010714314_0.4806172106345268"},"_hasShrinkwrap":false},"0.0.0-canary.1f389e4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1f389e4.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.1f389e4.0","fusion-plugin-react-redux":"0.0.0-canary.1f389e4.0","fusion-plugin-universal-events":"0.0.0-canary.1f389e4.0","fusion-test-utils":"0.0.0-canary.1f389e4.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.1f389e4.0","fusion-plugin-universal-events":"0.0.0-canary.1f389e4.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1f389e4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1f389e4.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-mwQm4bylf8om5p3rS9C39qXrfFFCwQqMr9pNUcmjFfjbSVTqi82pEJsKatoPZ0eIjhVN2utQtkLOujTHlaBIhg==","shasum":"22039e33e0643eb21acce36b7be788072e51abe5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1f389e4.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemJhYCRA9TVsSAnZWagAAtC8QAKMJ1HZ95f+z1yv5NzM7\nkxB5gy/EF2k495vKNbX0+Uun1KCAiBJTorjAdPuZ82BKYJi9TwsphM1ex0ji\nStZ7jyXC0kH9tiED+ZMap+xAPT69sDNRgm3yj2WzngTw9u8WueTjjkTBsyzP\nbX4MgUscl5blwJxdwIuPaVwjpp3Ce1q8lieakSlhoSMH2RTiINPdpmdvTaGd\noEVEX4ELz4zj4TOnbdNJ5BSSuDn9CcgTvErtX0Au7ZCtYWrFCupzHqRpcyud\nIxKA7Rb82i9xFd6+dcQjEUYxAuz8mz+dgLIL6T7rmt0dt2CnvqGcnx8aF6l0\n8gOJyduU7P1+X4pxRH/yc+UvXUYbrQFV6Pktv8iKM+Fl21ryEF4eeqQmBq99\nohchBR7fuMs8JDdpVShQImapZJNOv08tWNwoOg5pdntXTUmXAkM3YxyFD2VF\nz5hZQ37e3RTJyZM7MBenOZ1GKFYUAK99OImdqLkbL9GS6+PbM/Pd7vqBGpyj\n/CKYq8gmb3hM7OhPomLZiiijQlxOM8m9azJl2CFdCS51XgQwG6/0fWuakgHF\nH4eBykQ51DvIMKfTzRIRZGx1UVNdF0fFPVmIYfNnu3Uv9tlv2xBhqEGNOd/i\nh6q1Hx8u6ZyUE3RcIpGxVLrGrF/dxqEu0f/e7YwdD7RSfWTwx4h4pKuNLI40\naFVf\r\n=lQHI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCI2/3jNUjaG+eEE+xp8yFYI8T51zHRqKly8X32/QIIzQIgROFN1UvuoaywLSH+kFks0p0PQjKGtBsBamtusIiWb6g="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1f389e4.0_1587058775640_0.13163691354543383"},"_hasShrinkwrap":false},"0.0.0-canary.952803d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.952803d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.952803d.0","fusion-plugin-react-redux":"0.0.0-canary.952803d.0","fusion-plugin-universal-events":"0.0.0-canary.952803d.0","fusion-test-utils":"0.0.0-canary.952803d.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.952803d.0","fusion-plugin-universal-events":"0.0.0-canary.952803d.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.952803d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.952803d.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-ydP9LbY14r+7KQjsBSLpd/NULSXzj8uAbIeG5xFWdn0vKLYWMBOEZtNwbcKGmLk3sJKcPRWovajvqNMs7X2xhQ==","shasum":"64de9808eb4515546fcfa7824f50afe844a5977e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.952803d.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemK01CRA9TVsSAnZWagAABWAP/RrPmFH3D5Q6DsB1sgqa\nmcdyAeQ1TWTg8LreOonzrLZGrkEetKH5fzkitgBw+19MC3w8esKoL1WfXr85\nvajLIQ5cWyEgPAsSF5sX7NuQBZjYLsKY17Qxpsh3mNBzSFDHcKHdXbXS+4L8\nb0wla8O7NDrscPVsx/NFbUrxHuJGyztJf3AgJLBSFLNfaGQF5VqsXJLzY5sk\nhHrS8gW2aRgGS6HCJgmvlyaui373xvafdePl9/IFFs6s/Rpwa2UmUzB4w5TI\nWqb1TUDy5CMX21gF2okhAtHDzHF3Sf1UB5sEQ0ZbJEcarTb8tlUQv+vhLuD4\nvBpgeOBOAeJyzdi7qmte33zNWx3XJcJrbc+Lr87AvSmovlH3pALCAdHMUgFh\nFGn0ZiN7NUspLS79337rXCU9KrqOt4J3KvKdj3jLw6MRIMOgkexCjxewcXeo\nIAGBk4KjBfxOgeT13EJ+cFrwkLFLGPac6FiEsUc7UY3HeSy8fDK+ls+/jeoE\n2nFp/ysMDeoYcdc6Fx+KKp9j32kGhZUpQd8E+xZ9LrapwP6tOrEEo6ZVUGMT\nNKP4UsBB9yhkoYgBf7ZPJCEai9qqjWcDHx5Tkay4I/gMFvT4xLZHnBu3kRoA\neehaGKtw0qbkaX9nvzee2Sf9yP3R+REDD30Y5LyXOFKzB/BAjegpJOlsT1K/\nuB+T\r\n=/S4j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3l3m7IaF6IqqzW5so85niWdlFugPJunUbDilvDDPxowIhAMEYc1eINrUOVUq8XPmmQVzhEr8jH0GcnH7fJPk0j8j4"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.952803d.0_1587064117165_0.9747133548642382"},"_hasShrinkwrap":false},"0.0.0-canary.0813b9b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0813b9b.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.0813b9b.0","fusion-plugin-react-redux":"0.0.0-canary.0813b9b.0","fusion-plugin-universal-events":"0.0.0-canary.0813b9b.0","fusion-test-utils":"0.0.0-canary.0813b9b.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.0813b9b.0","fusion-plugin-universal-events":"0.0.0-canary.0813b9b.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0813b9b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0813b9b.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-70SU8geEb24JZzTXOnteteYNVtFD26p1xa+614geWcmBbvT0ecwG49aRJWnZoPRRm4bdslEmNG3sNy5Q+mHrDw==","shasum":"42d392467a33f39252cfbdb5ff55cb73335783d7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0813b9b.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemkX4CRA9TVsSAnZWagAA0OwP/09KY3h36YWMDKH7tQvx\n0gEPXDxMdkxLFcZ8QbAKsmoUPB3e2HyJWsKg0ubcOxkqPiOpeBLCE7kYCRzJ\nTvxwSYXtWHaYOEnQN9Xyl3Omm1IoeajLfpey12wUNHNZTFjz6/W3IvWMaPUV\ng/gIKzxgsPW8yp079H/vjtQZK+VEG0elZTToLaFJAbNziBUjNHeMtrEIHry9\n2vn1qQWjYUzva9O3MHAdb+kieJ1kzaS7Q2x+wf/0FGRUykRmtJy8xPfjYcxu\n4trH65lCaF9BmPJEhkdat2YK5KvyzDphFgmeaEWaNLSxqNsh3x/UMex3W/SI\n2vzNruj78RlInRSuLguks6n54+bWKL06vrZCavZRCSdoEz23NI5yYIxSaD0b\nENcpa+ow1fvu3AVdMioex3NDcQQrG8thBgiyzCKicTZeZExwFBjrEoy7KpQL\nlyBDahqSXoIuDh1sLXnORJ7DQuD66UCxYUNCmhY9ALFmgVWuUcTmgWfsrAZ3\nyb0tC/uJsSjVhHaQsnQ6whSLUep1KcPwpRFJsKUhwP+5UuSsAWwl175g6i8q\n8ugRY/obnozP0X0s/XNnVIf4L90h0/eEwlmSMO6RM9dCZnxeVx7gQdXvMNyh\nrJk1Id8gCo5c/b7NUUHdrREo7sr/LoVXJP3KWmJhcZ3Uy4fdITPxY642csRz\nv+Ae\r\n=wJNh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeo6xGj9A+8jZn93V38PrUUtT+6Cj9d0U1Er2Iai/uBwIhAPBB1QWuyH173lnTtHkCzLb7vb2IDoFDDJB+mfneijCA"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0813b9b.0_1587168759978_0.6568393816254112"},"_hasShrinkwrap":false},"0.0.0-canary.0cd5338.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0cd5338.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.0cd5338.0","fusion-plugin-react-redux":"0.0.0-canary.0cd5338.0","fusion-plugin-universal-events":"0.0.0-canary.0cd5338.0","fusion-test-utils":"0.0.0-canary.0cd5338.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.0cd5338.0","fusion-plugin-universal-events":"0.0.0-canary.0cd5338.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0cd5338.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0cd5338.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-mwcSlI3Q/KQ5CQaaO7bCZmXfpVCN2FkBdFRvdyxNo7zuPPJlbkH2CXOvcdqFTVXNTO8siL9gMD2rVmkWYekS/Q==","shasum":"de5ef0756560bebec03558feda938086f406971e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0cd5338.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenhjYCRA9TVsSAnZWagAAULAP/153LigVug52smWKXE3g\nIAoSzjM1OYaLD1gIVWM3s4hjkuq3LjRRKhduu2spo7zoK+NArAJxkykmZ87g\nxfPNyS+0wcvOkbWfM1gTx2jx4662/s0KYP5Pzr5+Ix3OXzg6dZqd3aSu6R8F\nlcxfdauSwtQgSZCynWnL8s62veEaNZqKXaUNIJCe9l0eo1aW/Q9MgmXtsK8g\nEgEcKbFTRaRkaMjTIQ4sYsNf6guZ7HPw6fPwBIBI/WA+EFIZP6/K1vd7PjgT\nYvXz10Dhz6cvk6wH7gWTlFIiF4wbkksR9O8JAFTihx64c3Z9VYZ79q738c6R\npx8EbSWeQwZ0PjFSyCKg+7ZtXjMZatUZzejGMwn8qly62kNPDqXU953p1UDF\n3TQY3xl5/NyoLrSld1ypiYftW3UQx2hUuxVf8neflbFFFkRS1Gf1MdQ9yz3U\nWR2D9NkZVQa2jXBufPqrWHfSijOP3u3awtuMkZPe3S7yDuADlepaXf4WL+FV\n0Js2QQKIpY1NXoq6fhbzXQbS2809RWYrhTW3yBu2gCy5fIvzXvqW2zJi4DO/\nr+AuMxLAbwWySqm4CofCGCJ+WoCuj7W0+0jjtq+y2v81PTmYuLLBWN+Ei74l\n8vh6HEIbtoYIrW4hxuEHNuL1x0yZwU1f/AfWR1GH6jUUPcubLh/nSvR+ipb1\npaig\r\n=2XLN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVvrJLWztm0uBSU+nGZ160s5KYkI25Xi4/MOypYnBZJQIhAKZuWUcEUDwGkjJjOiWPKbyrkUEJwxvddimITSeKozTG"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0cd5338.0_1587419351235_0.377755622253366"},"_hasShrinkwrap":false},"0.0.0-canary.e8742f5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e8742f5.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.e8742f5.0","fusion-plugin-react-redux":"0.0.0-canary.e8742f5.0","fusion-plugin-universal-events":"0.0.0-canary.e8742f5.0","fusion-test-utils":"0.0.0-canary.e8742f5.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.e8742f5.0","fusion-plugin-universal-events":"0.0.0-canary.e8742f5.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e8742f5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e8742f5.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-w0Qui682UtVbqPDSC/8VOf0dym1IdtvkvH69MVhmnPj3tPcAtnOrVldbZ2lDJIOtERy+Ol8Nif35TIqcn2WPmA==","shasum":"41cf2843e95047353a5498b19349d71b10771083","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e8742f5.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenifECRA9TVsSAnZWagAASzwQAJvgUxENsHUXEf9fkAiW\nJpPtNMlx61A06lk/SzI0UFipR1dB6HHMS2MP+o+aLNuRCyR+dwM/PlTavEaO\nDfRs56//4vkiCIezjgvX41WWkyrwfWyiGeAGXK0Vbos4Y0l9VZQ5dQYZHd31\nGb3jhmFA/rptubc4jHtpM7CQ6/lum2dzwE7KCWX6FBDz9aABOLqa1j46V1xv\nw0kN0v4YTJt9Wny5D1foZHohIeX8JC/p4L1vRwZkgyGJgRgIaz+VV8fo912H\nLr4qj6K6jqS+JWI11TLY7FWJmSX/luxFzaTsAUI0yK4ozEBVsczGnI7GEK/c\nNybq6saR58xj3ds+QZWKMfs9fnOGyImIY9lhFZ12IMk0MZur2fr/L9vs8HuO\nFdDYSXj7nTvP5UzGumBGIZRoIPGM411EN9ILF1CorsYLVuLK+ExUr41h3ODX\nloaxvL1F2q2RFefbZ+iRcEkz0/MSQhuoXWTOxcS6Q9YCmpzOoPlBGr85MFoG\nAFitX/ZqoLfXLhUfPZNmvze1ALCPtFbrJgC55x7vLAZD8SYkpqgRdyUhZxjh\nBUIPBG54bDc3QcgAgF2JmDzSbFLMOU5H+ywDspRJifNmeRMI6ZPPGgklgeTi\niz9jIOjT9R1LKZ4reoxyZcvBfHiBSCdgyT7nu9/F8JAyLQH4/FGiuXLwWo9Y\neTnR\r\n=Nn/g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYePOq0kSSCN3K3ojq9TxtZlatn2qyKbB7Rr/VPcueCgIgeIG0i1goHE2aQgUuiyA8VnJfO/5daCtW09JSO7CNz6w="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e8742f5.0_1587423171786_0.6687470202609647"},"_hasShrinkwrap":false},"0.0.0-canary.e794932.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e794932.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.e794932.0","fusion-plugin-react-redux":"0.0.0-canary.e794932.0","fusion-plugin-universal-events":"0.0.0-canary.e794932.0","fusion-test-utils":"0.0.0-canary.e794932.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.e794932.0","fusion-plugin-universal-events":"0.0.0-canary.e794932.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e794932.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e794932.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-KwfZuUrijnhcwSF+xBmecBhy445XnRxTPePWNfzcTzMZbnarbRzI6euBshI/LWRNruSpDfxcGSZLq5rzOkkDEg==","shasum":"9f381e3d11268ab2b9d1e1e6acd3531e9fed9fdc","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e794932.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenihTCRA9TVsSAnZWagAAvC8P/1Wi+GKmEbkSkgb4w1ID\nS8pYu9wGuqmXatIVIQrCYrt4KiZrn2GkPa+luIjJqdR0VpsC0etbQ5Lh1g43\nOnTv3ygpqOMW8Jd0MBaqakWsMUqjiLjuREFJYjjaxt3noYs4+VimGQVYClwi\n5OmQk17u+/MHd83rVo2to8DBSQHPs7hcatLePOONYvrRi2VgdiUr0zJ87L68\nfdz7rZRQh1pfx2GXx9AXSFbC8BGdo8rbm4GrZPTY/RjPiJzXzGBdA5rBrgvs\nwTOAZ5LdU5yLRzAkGCjqfBJr98vzX3NraQmdX4KWODI6EjU78F4gGBTPrLxe\npR7+Q50laMfyEvaBClhciZN15zkDX2guGJwv9MU254rSSLIwYuIpqJfmS4ue\nIjP6/cztyg6wSoxtzjqDXnw6cFQZzECUC2IrdibZoDXjdTSC2tVlzaL1v9Nc\nfimF80P26OH39ifjYzG76IROayycahnt4hrTO/V0+qznaG44VVoG3DLibrJD\nMcEiVTXUOOjEJqGABLcddCi7GNt5GkH0cSVtzOBEoH/0rNuK6HBrSRkgO+1N\nMLhl4TBbCOM9sZM2bwGJR3PiheOozoc8ski+LTrad4XxGaoWy2Y6iWT/C2OG\n8WU8XN6cUd55idAm1PW0eru6oU5z/X448KnIUHxgdSKWoVFxbA3YYhue9NiT\niEXt\r\n=yJE2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDaCDZvQNlP8A4HTQoHIsuGA9O6OBbklOyQ9eiSrRBjAIgGQCFZGnAebXhOnKpJrxsSa5HaU/ltRtg1AOi9acUiqY="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e794932.0_1587423315048_0.7061470439920523"},"_hasShrinkwrap":false},"0.0.0-canary.e8742f5.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e8742f5.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.e8742f5.1","fusion-plugin-react-redux":"0.0.0-canary.e8742f5.1","fusion-plugin-universal-events":"0.0.0-canary.e8742f5.1","fusion-test-utils":"0.0.0-canary.e8742f5.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.e8742f5.1","fusion-plugin-universal-events":"0.0.0-canary.e8742f5.1"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e8742f5.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e8742f5.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-bMBY484QZXe+XwcmqS7KjD+QrRkyjQmU8qJyjSQ7O4bYhz18VVOFcm4DwpvM9GEqgFaWjmERZjoYPbaClrXJdQ==","shasum":"f894fc1f3253087c7edd25dd5e5081d5a6ef8db6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e8742f5.1.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenikfCRA9TVsSAnZWagAAf08QAJDPSL8g29WwCrcW9yob\nM+8ufP046gSBjsa1Z/y9x5AZ4whlHu0+W3wlGD5MC8/NG1bm2S2Lvm5itcEa\nv6uRjtCUVRpE6NjUiuHiVovK7WlHs84QF6xz+T3uChsuoJUmnx0TgL4hp7L7\nPFllxku2pv6gJ9C22vHLKO4uKCoIbgCg9f4tQ13ELCPo1Ei9tpKKcvZIVnIi\nuz3Oqqw7G+A6ooEDejehScktzitkAK0iPtCL2YTQkccRkw4LFOjtNrP0oaDk\nrsJNuNd/Z+DPlynbo/sTXNXxQ8NLDwcp9jBfEKi6aAam8an/I997LEcuf0tZ\n3DPl7Dve47hCAM+H/7XrqBk7VbfZWSOxAQTNVL6y968bfavkXW3oOZfjqNAz\n9++AYZcZrF/gNrX0MiOcmgmE0hEOeLRBZh0xaSkSQpblJ8FeOsCG73fzk463\nPzuYd9onuy4sWQXS3qCFv7KRFc8sI/BXl6swA7s71ixu86svoYzHgHc306J2\niYU7hOgcjWeKBmpvo4O70YjlVe9tiApE7fcRVOXzJQf6uKHlYOOgvpWdlJPd\nH71o2Yw4qKWOLG7g2mFXaEKdl4dpihG2SIj4qC/aE3GCv79zTKPR8Zs+mgiR\neI3TYn/p+yAJ4gl300bs5VdPovQBt4POir9he4gnCJHJy6lGfl/SbCRpio6Z\nJ/pA\r\n=73hu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpjcJL/OQk7oY8EXWhCvJKZjY0l6EQYRWmTBHcqxNm6AIhALkBbmccoEOqNJwglvYSYtd45M3igeSLwS4mEipq/A8O"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e8742f5.1_1587423519090_0.7370097026250775"},"_hasShrinkwrap":false},"0.0.0-canary.7debfaa.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7debfaa.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.7debfaa.0","fusion-plugin-react-redux":"0.0.0-canary.7debfaa.0","fusion-plugin-universal-events":"0.0.0-canary.7debfaa.0","fusion-test-utils":"0.0.0-canary.7debfaa.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.7debfaa.0","fusion-plugin-universal-events":"0.0.0-canary.7debfaa.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7debfaa.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7debfaa.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-BPxL0obAyrN69moCCRtyuvcd9O2JN3YBi1K/U0OoKlAp02iGHOcE+Tr7D0FiOCtOEP5V5qa/7Z4KS2ZN9a6qug==","shasum":"9a99387585460980d77df3e6b9521248b7cd5bc5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7debfaa.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenjXLCRA9TVsSAnZWagAA7lkP/iTJoHY3IuYr24B9jZsQ\n9s3CpMi/Iha2jweI7NDokWmNR4TCzque/Fvfw95CV6lW5aU6nTUx1xpMdq5E\nqsDgpr50fSnfxhvo6MF30yH84PIoLHM9/wWwjusRiQvpDLrVH/hdBIwP+Fyp\n8iZHsGTKN/mTGKyALbpi6zAOFcI73UbHQhdAwo5dWrzm34uC02ts9SfBTD0t\nqmoHaSkISc2BDUXUNl4ztyNYTnrmJxa+TIdjAzH47B6IEpeqgXk5tSpWZDOE\nfikShrDBH2Vj0oQi6TmT0vE9oB37dMuTXUzW5gRmmwx9gkbZvtoX9SyCicTt\n6GWD+nTRu70hYPC2IusoVBPxrfG3xdK4BwBsLQqMDje0ltH/wvWbQY8hEQYh\nSVcIoVtSNhE/LO8VkETNX9ecJ2fTycZfKzOkGQmpztEZH2ym2JgAkEM8Rb/K\nukmxb9PeZIyUgZOMUGYoQbyiGdd9gRLUzd3VKcE6B8McHTIyUCX1eyDqEwF3\nFoOUARRf4trpb1MX3ICFJY9QHNPAzb0xz8aB8/EjDMoLrx+z4Jbu7ZDX5Eg+\nNL5KlJ8JBxkI5AClLBzQ9RXSwSbXZ7NeUDH/eVGYqBD6/JHsLEcFhhJ430eD\nZVibQ7Rmx5Gg5h4rv6I87gWAQaYG0M/R+Wt2ubz0c77q22wUQYFzxA6kehmq\nBZee\r\n=FKSo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGQhDlWim6y9B/oxaLXGOf6N/M41OanOh/PcIN15GigaAiBTO5zkABsxciUsnQ1mqBXleI360MqUQ1PxM31Bmqgfaw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7debfaa.0_1587426763232_0.260610569721601"},"_hasShrinkwrap":false},"0.0.0-canary.840675c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.840675c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.840675c.0","fusion-plugin-react-redux":"0.0.0-canary.840675c.0","fusion-plugin-universal-events":"0.0.0-canary.840675c.0","fusion-test-utils":"0.0.0-canary.840675c.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.840675c.0","fusion-plugin-universal-events":"0.0.0-canary.840675c.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.840675c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.840675c.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-hjyuMA56horsKZ8WfDyXwPnx7YsrB44DrIuxQ3TTbvf33YvKBdaZwaJ8PgJnqbhrCtGjJu8qmkhvjeqcEQfqsQ==","shasum":"977ca545ea09c8a2fa4dc8466ef42b0bda3cf7b3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.840675c.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenlVKCRA9TVsSAnZWagAA4m8P/R+RgnWkpO2Wlhc3gYom\n+byQtQYFyDYKTcUSTFxxy44gRacQoBay05bAr44puVAqjhrNA5Ypii9RHNFO\nCQtBa9Cd8oJ8ijGZaqwtDwyiIqZHdS8yM8Up/7W3bC6h6igE37HKnthp1Khp\n+yXWwCq6vL+NJIcfJE1mxfO+MUxXjorFjhbu42E1FmeUox/8ivO4xELFLbNu\nAp2DuLDqnS0/lLEV4nBGZObJBn6U1iXpzNJ+P+DY1JN3oHLnhJI5Yh5FKDHV\nZVIxI4QZvO+y1kl+oNm2y0p2puNvHImrBW/4r5w9+0v0UZ0zAmJbvlB612B4\nj6eYjtpx0CutSU1E4tfzgP0hHSoQtuAOypdSV3Ux+XPga4FgcdZYLqhGHl9R\nXi4KfyC/1O79dI79TsLDIIFjQ0+BSWifj5oiKIj9Q2dskJw7EQ5gOh7WfINM\nIRFWjtRgbohCUvLK6cLdnp+NSjoIbmdjVcvFhwZlxS6CxK8YvsMdmQ8krtG3\nXGfmQkoy9HAnwDJu3FiLZv+m2ozS30tUw4EG4RAKEM/f4dCVVbxo9gDF5wv0\n+2pMUwCpyEh6Ocl26Xn6S4t5UqsQPpkYITgKj+IJ8ZusCD52c3A1Q66OJf+2\nUsopr0djsPPrj2b+h21qmj23bK3v3A9U/YgOLu0SawFxe+xonji6rh9j0xBH\n8oEP\r\n=UKFD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuwYHgul1JfMVLVAp8rwDZqg+qfWdlPPpAnLx+7Y4kJwIgVmwZVqtjdYWDPUH0C7KnQVjK+Amf0qWSMpCFUSOHNjk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.840675c.0_1587434826114_0.40158326759552976"},"_hasShrinkwrap":false},"0.0.0-canary.a3a7eac.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a3a7eac.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.a3a7eac.0","fusion-plugin-react-redux":"0.0.0-canary.a3a7eac.0","fusion-plugin-universal-events":"0.0.0-canary.a3a7eac.0","fusion-test-utils":"0.0.0-canary.a3a7eac.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.a3a7eac.0","fusion-plugin-universal-events":"0.0.0-canary.a3a7eac.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a3a7eac.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a3a7eac.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-h0pgPyiBZSBNVFdkn3SVKsIn+M6vCGdqMn8P6bTfsCH2fjZABbuaUgQWgpT0ZTAhEWoI5iw0ZLL1njgHaQ5D8w==","shasum":"b3d64d34afcf3afe77cb05b85b2c9dd3bbb1cb2c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a3a7eac.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenymRCRA9TVsSAnZWagAAjVQP/jmtunkH9hX9pPsHkogA\nTsKmRpSleTpwoHzarhT4sAGNGwY+VF8JEb7dBfdGsG8oF+NKtJMcWDCQxHlF\nC8Uq2Csaqw2YiEs1nLm5mPDH+6kzI1RdfJFZ7TerQpHebKJsLTash4zdfPvX\nan52KIswSIEeI0cqZbyFa/hZZyCxR1mEo5ZsP5F2ml2wyofmRGx8IbH10ig3\neUk2zuoWlRO5EK1UOnF4Kiw77jAxt4rPzC8AEUrabOwKKF293uKBtawpNxJF\nYMy5TFVI/SGBy0XAvJWnmqGj2btKTBA27z33qk1GPMDuiz/5SchUZv8CaDYZ\nN/u1rdY4jVvHK/Y2mPkCDnafvqG8w/sK1J1WnuSRUZM92+x+qYjV6K3S1CCq\n9a2td4DbxBmGbzMF4FIRm6MaeQfAXpnvH3xdsYuOsnFT3jCNopyBJqUYIvjV\nBmLBliewEkaVLD2hGe3iRtBAc6GEHszm8PAZJug0HwV4uG0qIed3xbMDZQfw\nKjcbSacK1MWAPPFQNzlutjRs4k2omC/18X7EISi0uyvX0bZIxz50aXNWqMdy\nH/JNpxTJpWnBGejCeJbAKIxYN9RwDR1c0ZY1dKpm4jzNJc3Nv+1g0mNd1E7B\nYa/a3TMCStDI6rOvBlOWj3ujaleZ+V/jHuk0+fN8sQ0qf02nWBiT0LxFHftS\nbpif\r\n=y9qT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGYbpGyBl0+ntTN9OfoBQwe7rWXgeZ9nSxGjXAM51o25AiEA0uihlyiXA3iQ5+lEBT6LM/EkZbKWrl0TdwBxcGTEcE4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a3a7eac.0_1587489168537_0.48833108669963643"},"_hasShrinkwrap":false},"0.0.0-canary.f69e6b0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f69e6b0.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.f69e6b0.0","fusion-plugin-react-redux":"0.0.0-canary.f69e6b0.0","fusion-plugin-universal-events":"0.0.0-canary.f69e6b0.0","fusion-test-utils":"0.0.0-canary.f69e6b0.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.f69e6b0.0","fusion-plugin-universal-events":"0.0.0-canary.f69e6b0.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f69e6b0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f69e6b0.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-43vAQEO15JE9WABvEiXEs4WN2YhDdNXZUgYF9ENHMQfbfheF1+paKmf1nt27qZzPtSOkbQGaXVbnbeJgPuy7Fw==","shasum":"1ce1e6b1975ff6811f9d1f93e436f2f2d748087d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f69e6b0.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoJBCCRA9TVsSAnZWagAAtb8QAIZuYR7si4xEAPa7+2A4\n91ErHathpjtM9YrKoLQs8qDoix8ZUj4I2BzKJ4Tx1DGMd3Rahv77B3TuFlGi\n55/iFWN+l7kg1v68Q3SqRUhRhML8NHF/M7tkIjZxDup3ACrYTClBElhGHVhh\n8KAyRlAYmzZIuyR2hCL1oo3uIfLaS78RyR6CIhrmG4V1kXVbk8LQPn0FZRDX\namcmwuEhM0e3HHZjQX+udmm9i1EDH85ZzNRegCDP1Jo/mmuGalsh8Kej6K+U\nAewz8I27fMAuapigoymP2I+SuAJ65NXd/ov6e3TeMfqf/YbGI+X9G0n/TQ0K\nepnHr85jfNfZyg562BM3UMdVPXbxfUL/yM3B4LgpvOyCp9Y6sL+P/I2zN2eb\n5Mm30yX0KpN7eUQM3+6ixiBK+UjaYdCWZdgwTuEJ5a2MDMYg3nA9UDBez5Ls\n8E3zWKoHBJ3WJXZPP+8QNyTRuvPhmUHMt2cC6HxL/3DydShCEt7ZYNookkI0\nDI6K1sQD/KpJDzPjRadODr1T4Tjx2tT0Pt2JoOJXebFy7U2F5hIpvLMZsnJY\npG2lqWG0VkAaao3XlYQ+7lJqjRUFM8hmA8KFH5bdw5wN1Ym/efmbUNlSKtsr\nFZ6utu8hLG1JlyyMHE7O5nGWv92fFvR1/XAe8vBM4BFT3ZsmKdLLvj2/qQjL\nSTXa\r\n=h9Ue\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdUZ+W2HDfuPYBuvp2CR2A5VkN16lSZhNmL3LL/phVFAIgDBnRombxCSeSK7pqnkhBGyNsRIPXkM33WbsGnv3IzXk="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f69e6b0.0_1587580993734_0.6515136452466499"},"_hasShrinkwrap":false},"0.0.0-canary.1850336.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1850336.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.1850336.0","fusion-plugin-react-redux":"0.0.0-canary.1850336.0","fusion-plugin-universal-events":"0.0.0-canary.1850336.0","fusion-test-utils":"0.0.0-canary.1850336.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.1850336.0","fusion-plugin-universal-events":"0.0.0-canary.1850336.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1850336.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1850336.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-30dkDvd763DO5U943y0/xgyUHfQXm3B8fZlgTBhuPDGrqFklp4mBcneaXP9GG6WaXsjrijzfhg9OUKNeHDwKWw==","shasum":"d8835653abfca43962521955a2c7ccd1223abc9d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1850336.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoMFKCRA9TVsSAnZWagAA5AcP/R0YHiNPpwt+5EL+UPu8\nL2ZtV2rzyTjVBJi33dNcAmw7BAjipkVDCWB0q5YsxVZxi8KMByx9SbJgInlV\n6Pck0rTcT1X0FkZAP0daaM56KrxoygQDUDQR+veX2X1hericDRTT1EY1thc1\nfH9brR3NeXRLRAgQb41gY3T7EisU4F/jMgF0rbcQkEGnjRKkeF84E7kLOlDu\neGQwPI7BpG2vndYZcmgmILP7dNo7UCeaX1uxMRUr9AKU7c/7cdkeA3vFKP2q\nju6P9T6IPAFYsyer/oSYvepbuhPKpG5rlKMiNApOsiat9+JodVCJAsBpWn8A\nPvE0TzFV2FrN6mTdK2RwraH7M26sgNXpu0terdwBYRKmFjH5B+LbA4RXV6Zz\n0HK/S3d0o6P0zZB6zpX3D68hrIdqIk23zWn/rEWk3y2fpxWDo26Z0FhS55hK\n09TynZMFcghHk4oiPZ4HsBjBIS7mVa+DWzBk7YUGlrL/1sQ591Del9Z+Cwiy\nkEPUPM8c9pk68dToBAAevc8N+EmiRhswHHmy14rNN7drc5acvsqvXF4bKgGU\nlDbUhiyM6EBCsow2X+gfyQFakyCtQgz+ZmUNC4fC8uYiXddPQzNOMnKEtaOm\nEnNWpaHfw3rIi83lBj+EN4pi4chvO/3plaWDFXiC9jzzJvNj/HrlIK0uEBR0\nd0aH\r\n=Qnw0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHpdRTAw+1rliRXJcAY2F3Ku2a23GzknukjGmj8MKUuyAiEA29TYpi9eP3iCLq2qKqsnuB1UYIMIHYnJI57Xs7V1WNE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1850336.0_1587593545934_0.37817652432606974"},"_hasShrinkwrap":false},"0.0.0-canary.2dbdc73.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2dbdc73.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2dbdc73.0","fusion-plugin-react-redux":"0.0.0-canary.2dbdc73.0","fusion-plugin-universal-events":"0.0.0-canary.2dbdc73.0","fusion-test-utils":"0.0.0-canary.2dbdc73.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2dbdc73.0","fusion-plugin-universal-events":"0.0.0-canary.2dbdc73.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2dbdc73.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2dbdc73.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-7fZfAgmifet/M6v10En87gB0Fph0ijQYPYsJfjIIpQ+Ze3PTrydKAKz3Ou3NbW3UJUTetky2nsrqqTJxd+wT/Q==","shasum":"c6eac110fdee6b573c4b0f4a062f5145313c7ea6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2dbdc73.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoODICRA9TVsSAnZWagAAVyoQAItsSLYYfE01Yfi9JxCY\nsu2oeAYtdM9KMUyKw17n/r4rzMed6mrrD5q14FmMtXZKgzbBuOW7FDI6XzcI\nkDEd5Y4WDv8XwWpCFEPS1e1s5yRJ2dXb0wYv4lyOwQRGaQq8GJardICE9FYL\nAa8JQxxpVDYgt3ZLhgueUV6fuY906JAKcBNNTu/w1aBscxiEgg75DXqeL6S0\n0d2a7vXGp3BqfDqRgxPrmVoIS8d1gEw3fDYwSP6gprzFPLcjQ9QRQJ2Owo6V\nxPdwvOQeX9q5fZLNtDJOP4JrMlAkmO0P8P4det3QtFk2S2UFe4KU2C0yd5Ai\neiaoinwWTa7QvQ2fbyJ4FtRveqFyR0jpQYwRnwoYNdCCrfA89YJ8SI3QgkDv\nCvG3FAcMalJo0+NYAbJ9kYD8afgfdtVoNVPlSDTJK4FtokMPHkdai6Z0f0tV\nSDnAAYQ+Khuh+42zHSLmewdWe0Y6wY/pc5+zvkxx4h5AiYa9QyISAyHcQX8J\nouX9QE3g0vSUleKdE2vihxaRkr+kgiFl/jHlFMZMz8NJ9zCz21gSIkHYVyDL\nOpjYJj/Ldnmgl+LkJxKjztNGcDPkWcmcpbH/jcudMsYuNxp2BIrQ2sgWESev\npqTrciCAdhsjvED0iGd00/yZrgwY1wNdhpMFxuhS28Y92xjmGtn+Jh/vx/Ia\n9Uo8\r\n=hNrT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCB+Q36Sdq7o2sLBjuKd2Y4WU6hpN1US7uXcwSxEiUa8gIhAN29aGDC/WKY2aSI0ANKtCsqE8b1yHhf4XRbe2DhvnrZ"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2dbdc73.0_1587601607734_0.24049559395482056"},"_hasShrinkwrap":false},"0.0.0-canary.7379dad.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7379dad.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.7379dad.0","fusion-plugin-react-redux":"0.0.0-canary.7379dad.0","fusion-plugin-universal-events":"0.0.0-canary.7379dad.0","fusion-test-utils":"0.0.0-canary.7379dad.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.7379dad.0","fusion-plugin-universal-events":"0.0.0-canary.7379dad.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7379dad.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7379dad.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-MB9IQIuQ+R7SL9DmwlruYmp/vVPv5Em7sXykrwbt+jE0qeufWyM2M1Wv3ytHdHq3TvhkHgMGy8O7Wh+dmAdWqA==","shasum":"161fc552a6dbe8a9455c106eca43d823c4217da0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7379dad.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoOWiCRA9TVsSAnZWagAAPDMP/2poWvg4SMIi6eLmPK1r\n1ziBnGmnI4miDcYDYNN6He+kc//U9MTDw1p59poM7hVHColbJ/G7cfHHmE8q\nNwW/OhMsjlVOECFP+dk2mnhNP2CBoHhJcolpSPGwOS7W/XJ04NzGUf2V3gOs\n/pkg+2HniVL+FQ2se3CoV9VPEWAgk2GlfI1SPcfaRahlnaOjdkja+FWeFEyB\nM0dEiViqjZYeExMQwYAuns9BNlUu/IcFeZb2K2MlUbsfp1YWn0FBFsBcYEvj\n+/RKvfX0Rlda0SxhQ0OfrhOau7MBfUzzlXl+VODbCjtX17/9V9GppVSBpJR9\n9QQEJGUYqg9KvJbplRyGWno+bU/RY91dS5p/Bp+Ezh8qXdfKOmftruExgM/0\nKTj+PuXcC9k6nCiGzSB47uHlcFdg8AXxxA1l0MiyU9drz1KAVzzaqNQwPUqr\nT1Tg3UtrJFofbaUjCZto+yGLbGFtt8aS4C9eMeTEambbzYnLlFMNsn1pspHb\nbsge5Hes6V7I3q0DBCMJwTvKWlIncMPl+q5GiqQMmclxzGDCIQCuscxdQEXM\n9SbzHzb9yds7zcUdmsly+odxlkGcDliJ1FbGtOI3aPHXjvQTHEjwZeHn9OdO\nIa1Fxl3gxFCa7UIxrLK2uqf1mjv8m2o6scJ9fuUPnpGZgYb0k171y7gjJH5L\nvufs\r\n=DfC4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAh7cG2MPHfGfDYCt+ai+LXNzAwjH+g8JeBH9NntLPXMAiB0qh0S2PPG8DscY8F5sJWTj7JbxYtVBMtz3kSRvWWOCQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7379dad.0_1587602849586_0.25719364504660214"},"_hasShrinkwrap":false},"0.0.0-canary.22b9ab8.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.22b9ab8.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.22b9ab8.0","fusion-plugin-react-redux":"0.0.0-canary.22b9ab8.0","fusion-plugin-universal-events":"0.0.0-canary.22b9ab8.0","fusion-test-utils":"0.0.0-canary.22b9ab8.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.22b9ab8.0","fusion-plugin-universal-events":"0.0.0-canary.22b9ab8.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.22b9ab8.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.22b9ab8.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-nOz9imva8yI0mm7UFRvdjdppzl9DjJt6FNIiFio8Xua1bhXNUXKoVVrBsdLsWol/dx+2JSaJQ3wNaLdRZEG1Rw==","shasum":"e7aa4f9d3a4a0422e9b6a7bc1fc8248f97f1cf42","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.22b9ab8.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeozzVCRA9TVsSAnZWagAATYIP/1NmGYVW1Ir39Pnt5nz2\nQcFENj4i05OFlUUum+7iCXsLPzA/C4EYGvY2AbBRuFkSi8y7X2WABcpMKkpW\nyisbH9cs1MFVYhCC3b1Bkgnxd6cfjvriR0yPgNqaiI+n1rxep/W0cxJjt60I\n+v3uzpexhTOJDX5gdA+xB+aE3m+Pn74uJVsRj4xkXUrFN9jPPbawTZ18ja/s\n2DAmuezM3pm27G6+lWb0jS4GX0p4Qhgq7naJmPQzw+avKzcDq9aUkzhjJXQn\nbytDmg74O5O8cCvVD6Kao4T4ufCTQiYp7jZ997Q8QshlLqDLGzXC4hAqeej5\nke1Un7lVwqYB7hAq3yJYHsn4SKeg4XNRSX1oB0oL3LsmMEkNYJAaF8/XrZ8C\nkR6nA9MvV8KQfadu5PVVNVLdVLKkcCdHVqfSGWvFNofvQB+m41FbWoj/31Zt\ncTKitCcCQhmvu4TM7sP7tP8APp6orDxH9ksldIDSDNNiX7gNSN7ABQQWES3m\nIj/OAqs/p0HnNnTmGRNBPJQjcftBn1zUhzAMUOjT2ThIAevpRi7SRII3gYvM\nFEcim9y+12zaRWL3y9nW2OrM3b+To59RAg1IblONN4R+JKEGAI8ImGBqU70z\nUAjd5vSeGIJ6qOI9goWGYzCR5JEDIGr5pedwN2jrDFJUk8fLoUkqvLN5DOBu\n0kLV\r\n=v0Q6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEQ1/m33ovegqLFIIP9tDiS94lZDvoqqvz8br23PidpsAiEAg0gx1fdBctsOe/9oDP/jIN1ESj+lt8W45CJ37T55HeM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.22b9ab8.0_1587756244712_0.34664963933226356"},"_hasShrinkwrap":false},"0.0.0-canary.69f59b4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.69f59b4.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.69f59b4.0","fusion-plugin-react-redux":"0.0.0-canary.69f59b4.0","fusion-plugin-universal-events":"0.0.0-canary.69f59b4.0","fusion-test-utils":"0.0.0-canary.69f59b4.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.69f59b4.0","fusion-plugin-universal-events":"0.0.0-canary.69f59b4.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69f59b4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.69f59b4.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-QupRLYclpaxw1Ln7ju22CUxjYjnZY6wHT4Xdx+x4PXMdooBTAuzuMR9wzbUAfu2wMK3/nEAwVhUXIcsYUPWFEA==","shasum":"4a6fc261771cf974f57117c6d560bfbb62341d8b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69f59b4.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo1MOCRA9TVsSAnZWagAAmVIQAKGGyhG/CSe69m1770NX\nIFgDWu5sH2hSAmS4duXz7uHjXPSOkTrK/v3WH9C0Z/VSHRQPi8ZILfAEiHGY\nhCU3i9JBcv75ik55HK+ZR1EXTMswHY8wKDHYzEDSwkI82TJbxRgV8uD8FNad\njw4J2Y1GlBhP8Ep9L1Rf4XprMTen6NBzHuFO3zcT41omSrVvFMYHgcdzy3oe\n4Bzlhma/VeBy9krYWWtD1cSd1Q0fYLuA2OFJJgmclsz4KoTgjPu1v/zf/wt1\nZM/L5fmC9z7pfWEYpX/135jYUZS8tefFwZVH9GAHJvTXMUFrD85X78dVPr6D\n0lzTpWXOIPzX6XyPHKVTvUhwi9Qs1Wrs2LUUwxyorV+CMk7WwtXhBbRAQL2k\n5017N8EE++1akhuIFVcUWswHcupAND8h526C1KR295AJdUaHok/j+8+5pl77\nn9FSUtCwl6ICkhQH/FOKt+VePoY4ogVKG+0OQVQWxTv5yjVUDK/oRZ3YYkXB\nXrWFM49KqOY0RkFkJ1s6F3AaSahIHoDObiLBiNZuB/niEgpe7UmH3+7fzvt+\nv2+eCDJlR0a9RYd9UftqeAwjKPaSyhOmFPZR8adbReQXDRWaPxb4SVbz4q9k\n+AXsL1Y0wTqQAxtJIQV0PrX1qB41PbFEN+HM/WfV4nDi3MRkrBy2HvXYTV/o\nOI5a\r\n=Bsx0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZIz415ZZzGqTNz2C9VROuk/JmpzY9KdVG40oXJTrNiQIhAJ3Zw1T9/FieNidtyJIMk+MP64dFeEtbqQDETuweSgCp"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.69f59b4.0_1587761933793_0.040734318144023396"},"_hasShrinkwrap":false},"0.0.0-canary.3d209a6.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3d209a6.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.3d209a6.0","fusion-plugin-react-redux":"0.0.0-canary.3d209a6.0","fusion-plugin-universal-events":"0.0.0-canary.3d209a6.0","fusion-test-utils":"0.0.0-canary.3d209a6.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3d209a6.0","fusion-plugin-universal-events":"0.0.0-canary.3d209a6.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3d209a6.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3d209a6.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-+NXbzi4QyCkT9M7fAW1CuWPMBwaPKIqrCSszhGiopJyUpjniBoduX2xDRrts4e2M659vcXZyuJci6ssfSwiFMA==","shasum":"f4853b77242460825241c1c24f92a06f2de3d0e7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3d209a6.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo1/ICRA9TVsSAnZWagAAopgP/jHoP1f5x4md0+yA0kxy\n6BSjqxAEjUUsyjZjd/F7I9hM8YbAwLErpukKpKbdM9Ra8JM3QT3P1AWYOVqC\nlGPyNqWqz/aI6db01OFzTeXNuV9UVCU9IADVsQOdMWivCKkLAOWAlygEdWlC\ne6bJocvoyql+2WxjT20z0rhw4UM25J+xTS5fAB3cYzf6+IbOerSsmTeaF3aa\nCwE7YwGHNdGgPz9JQ+7UkQVqCag9YGrj1lA7U4voLB1zwQ7ok6ZH2LJE3zqX\nSa9nAQwG8FJtWUJc/Wctkkq4YRY4Dg9whog8d/Bq5FC5d8yYgsRgeSI5ypD6\naZDHxMzW9aEvBBDwi9TI3GV26zuLzglAtsb1CtObfuWlydMX67/zh82yaf89\ncGsBPPflhHk59DdcYUCz9bvKVh8a9vrBdNW0y5nChb5leg9LlA53V3lvllOb\nIeg8OkB2AULvphzHFEfrNzNheTudsXVgL8tL2nA1ykE58a8N4q9vuz7nYz5R\nC8ThNu9q0sp26YdqYXLCmkt9GAho07rwUYfX7z1BXdds7s5D7WrpDIFnSftB\nG+pyU0NziQccB2LKKwlUjHwxRsNgfi65Z979N2NfG+6txHRRZF3DkpO8fj/I\n9ziRm58XK3+2D0ZXtWmy+A/6t2IMjK2aU23/cw0RaN6b+MjgKLMUFnKAaqk1\nzDjQ\r\n=b1TA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID24/vxEUlvFghrvsyw4JtjTAQAeLAGQ61CgIbAfulXkAiEAhyVG7jMhOYBk3LagLAbv5VGIArCcYMwxXXwDAg72uq4="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3d209a6.0_1587765192251_0.08254572936126858"},"_hasShrinkwrap":false},"0.0.0-canary.70b95a2.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.70b95a2.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.70b95a2.0","fusion-plugin-react-redux":"0.0.0-canary.70b95a2.0","fusion-plugin-universal-events":"0.0.0-canary.70b95a2.0","fusion-test-utils":"0.0.0-canary.70b95a2.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.70b95a2.0","fusion-plugin-universal-events":"0.0.0-canary.70b95a2.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.70b95a2.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.70b95a2.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Ow2rfhu1Xs5iw5IsWj1ZYeCKMsz0BphYbpRvuvZ1xRLbEXwAMoK6QMsjB+b6kEmSwXMnOG6HfGGC/myT8OYYCg==","shasum":"e64342e1b6d5229716c9644338fba4a56bd12344","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.70b95a2.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeo3qXCRA9TVsSAnZWagAAElEQAIgAMhh0e2w81HmRwsc1\nKnAZtpb6ZLIPx3M+2L4oLa/K5Yw9x+Ww3ONxCLH4QqverqH/06fDCELAv3x7\nvJHtc0LvkC0npWIMNgTy1Qr1P0zHdApgN75GNINeuttV07jSC22JponUDlpS\nz57nF4kN8Oxu/Gsb1BNfN9mnHe88yyNgPrOnPQZIeZJMvEfmT3oVYslHB6T+\nL3N3ELExF1JbT2IHe1aPQ6Ji836MWKaZy5z1OzgrZk5HcMO15dtS+IRrciM4\nkWdipd9d7oTyiZ5SpWh0QSai5guX76bA9Ode/HfogsrZnpEpFHrnkwev9Lpg\nVuxWwRTi25jWunC9AJf5L2JsmoKeB1xfCfeTiSsGELHoN+N9g/7q6dqJet6a\nlaDUzy4iem5X5N369Mfb8qnMRehfzmkCmd7WfPOCImfRLs2wNezk0Z+xrJMO\nJ9VFgLtXRr5uWWOODjCaqTJmYKK46jdxHuyBY+GuYqDqZirz5d5+KP/YbuCb\n9y/mefjCVgAq95uortkQbGKDietNhm4iNdTY0kncK9ftHU5A7Gf9AF1St+Zp\naNrf/f0h0cAMtEehPTkwym/4rvXknwjsPLRZyxkVA+v0bmN8m90ho2YkwNcj\n5D6MPw2KjI2+cvEikkVZ/UhTdBx7kXXR+P6ij/pmkZDAQTmJeACZ+3lbUC+v\noxE/\r\n=RY8X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2+9Mne/7YjyZu+jMyGDm5iEDSM+cDjYcqYln5bg6JoAIhAKvsFvqTSVi6EA9Uc9P6B/IMvgoq3JBAsP4hnTwSBP8z"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.70b95a2.0_1587772055471_0.31539407490944593"},"_hasShrinkwrap":false},"0.0.0-canary.99a4452.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.99a4452.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.99a4452.0","fusion-plugin-react-redux":"0.0.0-canary.99a4452.0","fusion-plugin-universal-events":"0.0.0-canary.99a4452.0","fusion-test-utils":"0.0.0-canary.99a4452.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.99a4452.0","fusion-plugin-universal-events":"0.0.0-canary.99a4452.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.99a4452.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.99a4452.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-fev3hTIDpmtadZ0CdR+O1+Q+s2HbOoyDiAUMdTY1MPxw/aL/8iehjRXFjTmRgdw1MqzcEJ4naSeOAUz3/TxJwA==","shasum":"fdb9523b5c86f943e79828ca478dd1616e0cb622","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.99a4452.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepIGfCRA9TVsSAnZWagAAS5kP/0MP+9CUhBrfMkriHttN\n45PiofUUettao5ivjXYLGTmWj0W7t7o84vwaXqJmpw7jZeTAl3fYrt/hnTui\n36LNN87MyTiyRj8F8jvRUVsVTLoN+348LWy0Mod/pe1mUlfnt68Xm8rJ2kwU\nba3gtSlsDP/E7YM8DKFLtg0a7JaMnhS8eFovBKY1rqMRDfJpo4iljkuByr8B\nfk8Mg45YvWvGtHK/BVuWVWGvmn5Y/FpVJhBbMGLdb9Q7J4ADKvnOouIttIO/\nbY6fo2GjS++trHf7AvcpguMi9vCXuhDvLlsomWgzYjufbIlEetoPXqVwiPTW\nIm83KIH+mIM6aRUNGk9eMBYz0PhgEaUT0hBeQUnI1jf1cbJIrbHcx734uDOg\n1gduSgGGMy/x0sTMYHLuiP+zYER/dBTJ99Zf2tdGze21KqQ1Ai4HmwIA4X98\nfmZiDSbutAgIi9+muuH2YcOMhYpxCQLtURbzLPCngLdcR2Cgky0UtVOST+UD\nga14GSQW8+Zj8wfmLIFdj8uLU2/y3J71XrDOjxK/cBI2jqw53I2fAHlR3ZZJ\n0HxEeq15DkFcXaJZf4hWF9zFkXlJMYT1Xu08kfP67J3ZK6mqNpAT+zLNZvkd\nCGc1vcDvaEmuqRJghKpfXLef0sc8pQZmQ7BmgupU6xhW4GU4q7Irc+pUjAwW\nUhk1\r\n=Byuy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFea12cqCuxPvEuIGmSRLlUJZc+csL5o7mox+zAtE90GAiEAw67Tdz2DLnrzPBirrFFrkMdTwpgkfHM2M5SwbZX5hQg="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.99a4452.0_1587839390485_0.7115026311910075"},"_hasShrinkwrap":false},"0.0.0-canary.649174e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.649174e.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.649174e.0","fusion-plugin-react-redux":"0.0.0-canary.649174e.0","fusion-plugin-universal-events":"0.0.0-canary.649174e.0","fusion-test-utils":"0.0.0-canary.649174e.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.649174e.0","fusion-plugin-universal-events":"0.0.0-canary.649174e.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.649174e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.649174e.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-KOYLGCH8RW81LJqjDYjTBMFvnDQnunMkz6Y3knoXHjaq9XU/CIuA76ub6dpr+RYWzKCJGuLLbQBU5v9Xwucg9A==","shasum":"a7f8f2af1b4911fcbdeed1c8aedb8c4be46c9697","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.649174e.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJepz/gCRA9TVsSAnZWagAAgcQP/1Pq8ARPljg7q13VEhPQ\noThe0LopKR0IxEisYoFCvJF8WKUOjNzAbjgBmcudksJPK7FuNckrPcT1ei5u\nh6u6MqU8r7QL9dPVTGQB2sEFMG9yvIjs00rAri0G6cmuLERnbQYgQsiYGc7a\n2aFbPv/cTQaRwyM6travDEwUqe9GtX27wfgg343mbiBcQ5qIlKmKv4S7I1+Y\nqcqnKiz0grG5ZNx+vV7s0satxdb+Vfb8UymTb1AzsrXn2CAni6a/mIUajjdj\nz1uiaPPxvTInA8vOs1n3sG/ecwCuGdR7t2kpqGUDddmQaTOznLp40qNrZuLB\n50MH0BN2bjvMxBixCbHrqARREkeOEQv1k/8gspID6Is9DBu95mWx2dZKmtev\nTaMU54uNof+rP491EwOUvGLnGcmI4dm89Z3MqMnzFNPZxLnokOiJmg2pjb9x\n2EZ+4u9aQ80I66Q6kTeRhDS2AGLAa5JtH+6fY3JI6VWhr2ls5va6Cgh/BobT\nIGnZt/pR4m6sJ6Pb4hFQ1rKvrRyQ90/Y/8oA3vZrSzEmhlDf0qQN+SQA0nAl\nDcY9u65q0JmgVNpiXiphtBDHjfIK/i7XtOiGtwfxk7W6lgDpFIUEQFhmDcy3\ngjOv1cXb46ES7ko7abuPJTE9nO6su4vEpiaXjrbxSQwtnmUQSGpNSouzOWhM\nqsg3\r\n=BCD8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCiZMEibG92yiQVecJRV8l0k1S9hLkCXjZ3FPKVhUkbAiEAy07DNrpI/XcVyN4z6O2vJjJsNE9wcR/rBYEXdQjwxms="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.649174e.0_1588019168244_0.11741387464147923"},"_hasShrinkwrap":false},"0.0.0-canary.99a4452.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.99a4452.2","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.99a4452.2","fusion-plugin-react-redux":"0.0.0-canary.99a4452.2","fusion-plugin-universal-events":"0.0.0-canary.99a4452.2","fusion-test-utils":"0.0.0-canary.99a4452.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.99a4452.2","fusion-plugin-universal-events":"0.0.0-canary.99a4452.2"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.99a4452.2.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.99a4452.2","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-H0dWK8ioOWVBI+4s107KR+bf6fZdQ0BS5IkWlriIMjytU7zfcFf23pNL1UPXw2vFhP32PnlVqro+p+BPMiYV+A==","shasum":"2ad582ce029f20fbc829f6dbb820af59077896f2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.99a4452.2.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqHqfCRA9TVsSAnZWagAAxf0P/Rby6r0an/ZO4Qbq2jji\nv8B5qs3WBV1v3+hNKmEHMBoUi7GIhBFok8GiaZy+lynxO336Q9FJp2bfsoFq\nVE/sEZp+wi39OajGQ8jvPyvpkM7hfSr85clDWrs9vZl5Ghqy3pAB3N727r6I\naqrJrOM5DLBscWfgAUHyeMqPIxZnfYYoGRcYnW3OEWrNotn4aeNoqUiZiypD\nJEDdWViif7uKGHSV+5kG0vpLn8inQA2E2YfUXrtwPMrWeKeGY8qW8WqSCoHJ\nhvWlqLU/hwHXAgfM7eX6voliirRURmWq0xS1WT/ATD/PHIdDt+qH9UyN+UFH\nW56YZr8PswCTeF7YY95xtE/SJkJO19l8+n/b9KlTwFRQEtLBebZSN+SSajQf\nR+zdV2mj620T3Ynvp0QU3zmnNsJRDXUlE3sJhAUpctRaDOqDOZ0XU7wjIl93\nRqJH3Rd0MXbD6hMLqy7ZwcdqQN5XLrBNNW4zI6A/X0pL6txSKoEvy6Gl933K\n5jJgdNMXXRgxDdaUJ3q2WOm59iPBumsJUnp1xkk+WfCQ1WzhkMpaRliocnUX\n8Hlu8nRPXgE17eGqFEzhhWi7t4sph5UfCNxQcHl7k6V1ERltmPk6f1mvVkss\nRH1a/5zSlDHhNiRzaQ2ruVEb/F47pn/+4zjL9f6LT/qvkeBy1DEGPaUe5us2\ncSLq\r\n=DqNx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzOQ/WHl2+yFpklHZBLgaILVkFFJYhRhplqWJqEsuGeAiEA1LH7bZ5SnCJBvpI3VwHUi/fr4tlxo98gAw4dt9PA2qw="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.99a4452.2_1588099742781_0.2272862937093425"},"_hasShrinkwrap":false},"0.0.0-canary.649174e.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.649174e.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.649174e.1","fusion-plugin-react-redux":"0.0.0-canary.649174e.1","fusion-plugin-universal-events":"0.0.0-canary.649174e.1","fusion-test-utils":"0.0.0-canary.649174e.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.649174e.1","fusion-plugin-universal-events":"0.0.0-canary.649174e.1"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.649174e.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.649174e.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-7gI7coZe29CgLlTMEtWi0vhEETm0UyQqNL2A+QdY+cRHWUZLHiA9CtKa5xl+/khjyIWHkiS/Do5Mke7eV7LQFw==","shasum":"b9bd788ce7d6eb3782e8f20eb589caf10762433c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.649174e.1.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqHsACRA9TVsSAnZWagAAnGgP/RlSv2EhjcjRil3WloXv\n6upGurpmefBGhoV1fHJ7rG1sR6bH4L2c0fBZK85oCdrZC/7PlkgoA9yhV7Qr\nX9tRW+wOUhf0hGwF9lJJ7cYJzhqM5wofmeO9BS3sYWUWKO3/bnQDsnAlFuvV\nm417ZArpJ5ts+S2WeTN5aL+yXr3hUp6Wa1u9qdxNLXZKmyF742aagNsq6deu\n5TsrfZrJC+XJtriXazswYCRmWVXBe5tt1CJMjeSuXRMKTXMNs3rYc9isNfMV\nsLlJl/ZFb4+DObx7FLebm67Nb1CB5R010yszQKm1t0djTvl+kqzpUV75m3i2\nSyeSFVOnvAy5y0T1faCFBb3nSo2hlmbio2uHJkgTWQ4tfmYQBPWwuf+psT1f\nAxf644h3WdK7lWjZsHj+oBgYjBwoI3HhYwMHKOyHPH+McEbD3Wn0XWdU00E0\nVGD82XzGZpAErFL9BOqq5YKIknWStxQRY346uQU84oSHocwNAySufNTz0Skh\nwKdGr66OK0I9Cz2QsNV4nQDmkuyB4Y2T/cl4/3b1WaR5loqLiTfxynNxZdi/\nuYy0DbB030B9mmeXfc6qMG42Yu4Pe6ieGsDQWromTrlEKXrUimikme1LAMVF\ntFn5GzS4Dws9smpL9cyjPpvhTSbHguVUB7uAsThxnrQsiwW1wTqFqPE5StPG\nwC0T\r\n=KwzA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9haV4yOO2tIrdc/f4xiyOtC9A3EhvLMDn7wSwZs2Y4QIgV/XlMqgB1a/lXCAioUfqbcY3QqkfL24P/Chfjpik+uE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.649174e.1_1588099839651_0.940295139532167"},"_hasShrinkwrap":false},"0.0.0-canary.2450eb8.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2450eb8.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2450eb8.0","fusion-plugin-react-redux":"0.0.0-canary.2450eb8.0","fusion-plugin-universal-events":"0.0.0-canary.2450eb8.0","fusion-test-utils":"0.0.0-canary.2450eb8.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2450eb8.0","fusion-plugin-universal-events":"0.0.0-canary.2450eb8.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2450eb8.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2450eb8.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Ns4hCbrFv2GgHjLbVHtJuSQkHobTaeHWQClbm60XDn0OCpysMPltNWkSDXEZUd1tHh62SEXdGvDb6fnIjK2SbQ==","shasum":"f3f539ad9b6e46441a02f8909ffc6244492ef5b7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2450eb8.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqH2iCRA9TVsSAnZWagAAXCcP/3LCAAmPwuFn/OC7lOUX\nJ6e6jGhDBeeCvrZUdQoMKO58l8e+zw9g4aoJb3nRd25De4KON6S71OrSLIJz\nuDXkmKVM4s++yomWhAjOQF9EtiFsducsZpIcJ4dbzjueWTwcgczGBPhjs0bF\n4l6wteocex1LYmyuCTuiOdRaqK8ax+ZLz+iBFM9/+tgV37dZmxc4Wv89wbJQ\n9Yhpo1lZsbT5xR6xHMiX8/wgej8DvCl4wbAh8K8VEXH6s1ElpyqJqOd2eMhi\njQ2ogPI5pJbpqDhQzS7wd+QsDwgHyg/+bbaw2isQSlBA6/6V8Son2p9CNwDM\nPRbFr6R+V5GSO17xuJPncQaTV632UVHjTT+O6vOMQE+hC7BuJ398qNZQLmW3\nXanl9aH/tKzgtheuX/v40aGKwBLkPudHX2RZ5v7hUVWo7SqLww2xLWbH38Jz\ntpMosJRNiMKkK2hjoroVgUa6iYt0nD73eQWR0kPT0vw7Y5CJwKCOARS9a/Gl\nKnAPAZWPndofLPbvOHYflvJKOyRrliTCm6uZysY0Y3iriHE2dyUYogU8lk70\n5ObEsY9e6gqeAUyoC863yaeDGNklqW27OHguPk4NOmZsfOmHd/WRuFvd4TSR\nH6h+y95HEX6+oRTJD3AEywByzFyWnvHoMApcejzOh1d3V6oquhhr4KovYpEg\ns0O2\r\n=pvAv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEFWWFAl52Zdq3mCZ2Xaxk0IrdPwHXtUAYF1ECFUQ2QVAiEAtx0XFjDLR52qtdXGn17QA4gfX0JLlFjBmR6zw1lAGLA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2450eb8.0_1588100513982_0.7125958397541057"},"_hasShrinkwrap":false},"0.0.0-canary.2450eb8.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2450eb8.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2450eb8.1","fusion-plugin-react-redux":"0.0.0-canary.2450eb8.1","fusion-plugin-universal-events":"0.0.0-canary.2450eb8.1","fusion-test-utils":"0.0.0-canary.2450eb8.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.2450eb8.1","fusion-plugin-universal-events":"0.0.0-canary.2450eb8.1"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2450eb8.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2450eb8.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-CnorhJSCcMPreUM6H6CS+cvJ2Q/YDXdzBDII4XDJpo3RpbRhLsNTrxqdFlSlbQhMAlTbam79zCa8J6/VREKWyw==","shasum":"5632feae905481e7756040b55b83c36a5988db05","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2450eb8.1.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqH38CRA9TVsSAnZWagAAg9oP/A6ISQSJQRK7N/2sIufT\n9nhky9S6AdhY3gNW6mrCcVpV9Nv70yEfZ6aaO5d6V+K7yXuggunC5N7kmPeS\nWuHZDYdX7TkhxUIrlhSLXli3aZI1zdGIGXZHTl2xrtqzmzmH/FcudhzpnEmA\nWfoXVmbBeJ/DX6lhtNPYubc5Dtsdwp66fi2Qpkdp6oBu6UR1BnwVyJKbQLJV\ntL3lpvCoXYc0HY7Ie/FgAIs+FU0EF+wD2kqxXVLjCNxBIcZ/tPDkKTCzb5+o\nh4kciyC3x/PjF/iWTGqlodsAFNewdBKKHEKSyTLsNE7KiEuRyiJV2Df6MnPf\n4bpvg97l8Tm6BtYZPt7RZFCDcNwIwO+mM+YLN470n6re1jykZwJa/iUPHDPh\nsi8RPHXDRvmliiP3RARD6Q4sbJ6D2ajwtJOfIKlZn7MuiHdX4QC8LJVkdo6F\n7cFPLWGsmLKjXI5n52HrzALwyECg6o1hXOtzrPBbPUmjJ03wvsz4aBQaUEhg\nx0cOuqZiMoKvT1/5vDAos0htkfuyRFHWpO70gYCwuzT4Ysf0TVA0qiQwNbcQ\nH8rkwbyrBLbVxHALTAyDfybXJKMhqbbyrO/pqE6fVqXO0ugTMe1Fkllpiv14\ntGmzfJkyE07ZshfbG1aN6/LUJv2aPErh5ItauxKIF1XSYtH0uMK5KXY0gkSv\n18/1\r\n=OK4N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICKtZZJ01dtgdk9cnxiuPCRwOLP0UvYtncrcBtjg3SHJAiB15KNa9R0bwUNGIeUf76l1e//rmHlugmy8hX9xJWLY3g=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2450eb8.1_1588100604344_0.8843655381319584"},"_hasShrinkwrap":false},"0.0.0-canary.3b3b756.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3b3b756.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.3b3b756.0","fusion-plugin-react-redux":"0.0.0-canary.3b3b756.0","fusion-plugin-universal-events":"0.0.0-canary.3b3b756.0","fusion-test-utils":"0.0.0-canary.3b3b756.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3b3b756.0","fusion-plugin-universal-events":"0.0.0-canary.3b3b756.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3b3b756.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3b3b756.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-ZgLmkfKLb9OiAWhdt2LB59AkFwdKKMftY0tgAANwxYVQTHpZBPwMX5yAlEFysLxaQsHy8CGXDBGCE6R02C9xcg==","shasum":"73e807e10504d01db0581982f760b1f1942f8c4d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3b3b756.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqMoxCRA9TVsSAnZWagAAxWQP/jt0cVbEe/2eJP1dDZut\nm+j1uV8+uL6O29yo3Z57MdaZ6ksePuCCmzfgqb/1yGAhS676EM0wOF/saHcA\naRTZ6f+m3b23vnHlg4kIxilJpu29JhO9qwI7DXTRqwKu/ztVn5XXYA64ktC0\nSC0kzjQHJteOSUXLdhRAq0Iuk6docbYpiGK0RaHDmuYGyxAjP4T+UxLWIOvj\nNFgxtzeBgal6kcm0dDL4zj/lWbzey+5fR1F+8WLPWeV+U9g6K5vnmSEGCQNF\nRW89lkOnq5QywzmOoQW+U4WDyPYRqIrNFvVAbneazrW3Exu3OVoNejGGRBxh\n+aSVXpULaARVz0tmV8RNmNY0twP66BRiJlxyOgLQJtXib23NNnMPlH+nuL28\nC/RYbEdeTGmTd6ug49bDnb7DO75DG/HfjwP14jotjcM5VkO45K/y3Ne04Uxg\nwVfkRXG2ELJGytqR9V+pWgUTB7p7ALsW9RnfXnwYNravmTPbfNvetgHUK1zM\nc4YrQtUc3wPXoiCBG4X0+jfGzZbSpRqESgK4u1g4HX+l6OCGY1WxNSVe3XUG\nlpXvrywWf7iWQQRDN5wcvDCAIdFg7y8ZkkSmGbI7kMTJePGj4v4d7waWHPj+\nqv0neDiTe/7N53XfvP6CyZNlEZft0OMtkpcuyNe0tS9ogWybSTCx+uzFzr7M\n96JS\r\n=4wdS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKUF6BlRF2INBAIjQW4sJsdA1c4kAvoRLzjgebEEglFQIgSor5wy2kTYmYb5LsRW7lc6IQgvyFWTssxwRQV+nYOjQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3b3b756.0_1588120113193_0.6510790671547282"},"_hasShrinkwrap":false},"0.0.0-canary.3b3b756.3":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3b3b756.3","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.3b3b756.3","fusion-plugin-react-redux":"0.0.0-canary.3b3b756.3","fusion-plugin-universal-events":"0.0.0-canary.3b3b756.3","fusion-test-utils":"0.0.0-canary.3b3b756.3","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.3b3b756.3","fusion-plugin-universal-events":"0.0.0-canary.3b3b756.3"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3b3b756.3.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3b3b756.3","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-wldOK+iysoCJvGSOUAhpXK0EdUbyXePvCnUqKB9tyw/3iqkHXJCWGc1QDmxy74zXrf4Xr3rRjAXhn+Db1hPGug==","shasum":"0cc5e28284228741311000073b91bfb32ee3ed63","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3b3b756.3.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqN4LCRA9TVsSAnZWagAA3s0P/jxzx6sSzNop0Xd7j7yz\nkOTno9wfBn38EQztk1b2ihHwRUubAcdPWUVoDgLYzT5datg05uU2+AOSxCVr\nItyuTxVJkD+s95HZsZ5yAnLb+gVRH03DiPnKglnrUxvBvtoRe9m3bgjw8a1M\nn6AD4S/xqqd3lsw49BNgYmnF/idpFwWfp+b/ZhxdhGnDhd9twNcJBg/DpbFV\nKUzNirh12yez+NUDBNJDQlkwGXtBPndWVSvAW6ZqLR+4ogDUeSZ8n2xL/XvB\nKdcPAES1XVbKFhwD1pPOoz8pvbjYGrSACciUPLSzQexnW6fkiFBrTDgAWvX4\nSaEtlP0pMheKHgulgUlozDpxbbrksXF+gbWsh9P84Q5B3kaN4oWwfgyWDDXw\nz49rTTT7Jbv8YS/6Qj+UsiHURa1ov31Qc8HVmVymP6HJlI/OJgzm6aTNTYDH\nF6lDAQZ0dWQ5IVF/EejfDgyjE7WNvvsjyHdtXQHp+IUv13YAFT9YYoZgq86l\nakeu42d1V5201WBE1GQ4lkCN5E5QuyytzpsaoZvpl51bTIKtA1cw6M9/nvZF\ndw6zw7viU1zrMCo7YZbYqs7an8PhZ/diYbqQ23/b7VQKe5FgaIlN8QCaatuT\nBhhN+lyQxQfLeYy7DCzj/YPKCkeHud5qywKV15Bo8D4tu14ow2sLKUjJL/HR\nAR4o\r\n=9D4v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQbBwxcKF0WGdbwU82WfxTgaszZEDwnz/03FCQvJzmQgIhALdCM8nJ7WYp4JLVPcilO1mGX+O/MjQwbOwXI1ypHlcF"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3b3b756.3_1588125194882_0.5832308305646137"},"_hasShrinkwrap":false},"0.0.0-canary.45a5f32.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.45a5f32.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.45a5f32.0","fusion-plugin-react-redux":"0.0.0-canary.45a5f32.0","fusion-plugin-universal-events":"0.0.0-canary.45a5f32.0","fusion-test-utils":"0.0.0-canary.45a5f32.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.45a5f32.0","fusion-plugin-universal-events":"0.0.0-canary.45a5f32.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.45a5f32.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.45a5f32.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Ys8sypAiAmqYUDgYIPQrupYWhModgJj1VGHxqnok4aqcf5dGOXdT59imoCMCXreQZhvxojsQiU15CjNFcKPsUA==","shasum":"27e1f34b78805bfdaf80dd03339a4c2e5023249a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.45a5f32.0.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq0yYCRA9TVsSAnZWagAAwMoP/3Abc7cXgWN9x9th2FL6\nGF4r0bZmEp9PF8tUbjaMLCbhGaIqrYycyHaFyIT3gwjgNxVtzzzLkPtCq8vb\nZyaLcfXqtwa7JYMJ1VbkSRfv/kQEPvrSOrp4BGtc+ESA0K9nNPGl2r+WVZKh\n0i3Mm3ISQUvI8oEfPC13F1dBL215MBf0/H+Fsa036H5ZxxelAlojklXTpNN3\nBQJpU0OfsjlTFeR3GEqBFlaY/Y9neZgRpMyxInAm+vczoh9NN8uRDGMVUVrK\nKfKjdSWv8IgGST1f9L+ZfKLTyRiLNOa78HFuLkreykCSnRN+SEJRCP+8NqQV\nALKbho7FyTMJz4pd713KobG6JLNgrha9xiXntRV/7V+IJEtZ9RVlDkjjjik3\nxJe0YaHF/RGQROy+EUlvAffx2HRN9F3d9CNkc0c1larXzLNkXQMuspV9l5cK\n6ml+6PYim5Wubkd0YtWZbj+GaQfl9f/rRKmF4svVsS89zYNR2/YiNHysuTiM\nY+tvndTs//yEpZRAqu8mmySVon6TsQlzo7gO3TQ5SkVH8hGK5Dh8EMr+DrcY\n3BuVf8MwZCDcFaDxt0+U72dGnNVnPGz5C6FeQpSznWW508LfS29t4quUcIob\n4+kg3pJQVamyzFw2Hr3dKZ02wvYt3KQI/AAA0Rok72xOnm6hR2qckBUuMblD\nXnCP\r\n=GNDE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVZqfRbnPQOJbpHcr98tkcTKM8F+eIMA1qls1Gsy6zXQIgQmL/FN6kZFCIVhEt+GtNkDv9UVRep9izVYz+snkPvOE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.45a5f32.0_1588284568111_0.866936460086511"},"_hasShrinkwrap":false},"0.0.0-canary.45a5f32.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.45a5f32.1","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.45a5f32.1","fusion-plugin-react-redux":"0.0.0-canary.45a5f32.1","fusion-plugin-universal-events":"0.0.0-canary.45a5f32.1","fusion-test-utils":"0.0.0-canary.45a5f32.1","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"0.0.0-canary.45a5f32.1","fusion-plugin-universal-events":"0.0.0-canary.45a5f32.1"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.45a5f32.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.45a5f32.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-C5bZ7ZjUvUPuNE9iUGaIRkKg939jGR3JVu1kIx4LBs4BpqO/lTzkOjUOpm/iuUe+66+9T56iu/9PuhqkZA1zeg==","shasum":"055e78b850fdd94c6d61cd913c6756d4f9705ee7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.45a5f32.1.tgz","fileCount":11,"unpackedSize":40118,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesFa5CRA9TVsSAnZWagAAMZwP+gJ5GKlbMU8zZo6/rJV+\nqMVK8vC+FthIhINwahRkSyqmpptQ/Gp0HEn1AGDjfWDtb2uxcd6h+dhlysTf\nZNlkEioxs43LQayx/CZ6JGhJ0eYZl/KgKdxmZgb3UCSZiXCn6oq8jVI41I+T\nZ9T88HouCvzd+he60LEkUBGL4og2I/vUJ4Js2qAa2Apk5V+khs9NjmJ9tjRa\n54Zz7v7xg8ELZh3x+EjrBZdX11pg4t9DroyCMjTtfXBKy0hPrSUpziSCoslS\nYh46jY+StrILaQdbOdwcRLO6jTcqEWVD6i2h/he2YntFrSId7tKqn0mbI2Ja\nCFDiw4fXmORL0pyE7UnojQi3gsPYZWicL/pBSwr7/6vzuIO5h2ZxBPgRR82/\n4PpVJMtvFxz5UQxXkrxiY2Sx+gJYJa4/7j8Dy2QffyMbkFxo9f9NWjXuNU2Y\nty3P2FVSp8Ep0hmOB1vxRBCGR1cSO2QLqaIK1cHPmVM6yhiWH5X1KpH8vYev\nlNc8dJwk+BVPO5YbhZQpKl/6YG7eCr1C5fFjCLrTOHM/RKAzy1n/iSq4hvlZ\npe19XZUK0xD+WSZa4GQUb3lYkWSwYkqX1Q7/ffTAadoWmq5jR7YaYx1FieNO\nPGPmpKFteZGO8LdOH/JrILeAHf301TWHQNtYsB5rFbDrC40t7CfedvZ5wsbc\n4oKC\r\n=UZyi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEo4cRB0VfUeV8geR3X5zAyl9pWXN51N/tgIVSPIcePpAiEAo5HjPhwwmUsu1qpARmSVS+4h//K+XAblT60r//ZpIrc="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.45a5f32.1_1588614840828_0.1001331791428246"},"_hasShrinkwrap":false},"3.1.3":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.3","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.3","fusion-plugin-universal-events":"2.1.3","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"2.1.3"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.3.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.3","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-+rcKIL1I7luUXa2QXZpBvy4JmxtoJkviXi2e9x8PsDcIb6DYFNPxd/cGrrZaAurhZ52WkpT+IOGVhCwMUo94LQ==","shasum":"25a24c1e1e852d1924907d33bf8529a5e15446a7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.3.tgz","fileCount":11,"unpackedSize":39999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesJxmCRA9TVsSAnZWagAAxEYP/R0ZaDvqi4ufs9GBPIsH\nkLJl552qSbnzmYhwHQLGItnFE0BSsM2b+B0O+FTn5e+LNkj2S2214/2xwdA4\n25mieFsEKdnCLAe+thgCupCDa/sPZIzY/ZSGvgaMZQ7yFxgVWsaSvy9zKXCA\nbAWXo+fOOseEhFlTTDfxAztg0TV9Uiid8lBxZhdOkqGIutc3R1GdBuPeMm0/\n7xVpV0aR/IWNDnHKr90uCxyGLrfUAAXJX65xj7VSJ7BRuo7CQGHSPXq0uSoW\nOGjTvkQhrdqMVIE2+F3nE3be1MRkW6JqfMjFbGRidZKrBa+JbdE/L5Xt4+f7\nww6sOAG9I2YrbPla3lfE/VDa3r8cUD0vsbPtQ7dw2gZRDaS/a3Cn02f+YmAw\nyKzdLCzSKUd3spjyaHCgvJ+BXSsa0umu+X4sP3MJIKy0Gmh8Z5OeSsG/7aEc\nJlLvBOVajSdyS2R54LDY6TwBenWz0X3R2vnAi9arU15SWtD0Lq1LdBH4Y0iP\nLa2gJxKWG0zwA2ZU6/epqNz0WLrpxG9pZ849li78vJX5khtsbu2ajznTDc/C\nIHNVzF1VvtFn/bc+f/v2o60UGsy1dv+xIOzFmSBEx6kZ4EOrjJWUHxC5u+dv\nihPnKttIcdt9iEE2vGClEe92Yxr57bsYeXhAS26tlctQC7M3YUfRHzIQQ026\nJPt/\r\n=aGdm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBFdwEHfH95R91lVa6v2MklTQomcjT0D6hNL6iG/oT6tAiEA6h2vMmUaxGN58OACEl3YIgeqNEkq53giJ/QIpAmOJSQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.3_1588632678284_0.9594082667593471"},"_hasShrinkwrap":false},"0.0.0-canary.d57096d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d57096d.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.d57096d.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.d57096d.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d57096d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d57096d.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-GbQae5sB5haXZG9ir69ipcaYGkSuaOgfppkf8sPSauPoezlp/fmSqP5M5/yPYTs9CfKiMsbnVQ60bWMK+CK/PA==","shasum":"bc947110066b69efa3b1a0423aeb2230d41fd560","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d57096d.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6S1jCRA9TVsSAnZWagAAhI0P/2ll5HhDpxGQAsqPIHaf\naOrYDVJA9C9TtIRc5IqttVqJlYPCPll2cXAo1DykcPqzREN+yyF3gQ0DKKaI\nDX307aIsw/di6mE1epnZRWi0eM+Qhao8pbeqAGB2XjgV5FclvbtRkrZ1TCnA\nzCxy2BZuHZQnVoQNFOZrTxl7zESDsuxsG2WlQXehagS4Iur8I8+m8EVzfP28\nLScIXJp+wa4bSlRm12NxRXEeo0SAw8FbCq2YP3tPybmYaecsEhw07S+XafyU\njqMz+zumpShtCwwUY46MkyDo8JHusa7wC/ovD7Ll9BgOJ4yuEJ4YZklN5vMY\nMLrH7dMTeT/x6eSsFKLk5uGtBOlli3RaBnYbuTbw5tnv9FgrOC03ZwxXDryq\nCzetWmRQ32JT04hEEYOnCfdDW/cWKD/RYMLkeEORhymthbUduqkakc5oBajO\nuwaOUMwpUnGdcMhSbMHgJR4J6OqdMG6VvMDRTEijcYtTNASj8nUEb26k0Nhv\n27zIHx7ytJqIRK8idYZC4JNGNQmDeuMSoByqM8bFjAhgwp3Pf2HlROYuPzXQ\n/NVNAlSV+D86LsyvNrZLkdHcDsySNKbS4iQ9ed9Np7Q94jpye3poTO2tTC6N\nqGs9wyVRY2bfy1Q2wx0gDhl2yIxQ9BAkKofvfOYeqRHHbMCOeskAet9hXmVu\n9bjH\r\n=+Bc/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICREKsx/Hp7PLdeBquCwaCi1YymKDayS0m+18JNBTwW6AiEAuH5/ROrrv0awcu9k9FDx8D0RNtsuNwn+fOqpYpyfEtQ="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d57096d.0_1592339810600_0.5263496694633596"},"_hasShrinkwrap":false},"0.0.0-canary.7291033.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7291033.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.7291033.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.7291033.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7291033.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7291033.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-4nurbBauNkCE/nxBQAYMmzCCB8QUaZSXGSx2gsY2ou0o2sCyqYStyI4++Vg4H1JZegYgwuQ1aqS4JfDE6B7cmw==","shasum":"0b8f3997442399aa493f82809a1eeb52610420df","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7291033.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6WwQCRA9TVsSAnZWagAAwQ4P/35T5BSTSVDO68yGzCRw\n7UXb1dKtm9O/oHWgMY05WwpZNU8VyP49tWNz+GZNQb5iYiPCHHCAgWJMgzHO\nfHx8foalQ5QiyIvtOqm3YjJ6Lm8HZIP7QWwWc46Nadk91U2jYIzW85zB8iVt\nfPlLDYXDKGu976GlMdxNFs9aFarx8/HIeq1SgxC+bwlO2+PQpIyyYUHSol0O\nIbcspcbc0Gq4GMneNT/1ys4RQeRk5phCbGCXP+3Q6k0E5KnOhgbCV7GIoH58\nyoNz3FTicrf3Es94EuV29QzMNF61GIihYOl6aQ6zLqPGIy7+Sy0Oxsw+R4Kl\n4iaUkQFu/FLq2GWZRit2TovYC7k51fWzBC+o+BfmgIbXdxU4Yh3SlH3eQpOe\n7zf/6hjcM+tTRy9LQT1RD0V3mungsGPmIHwlmXh1j+0AGAd1xSdk5ut4sIZ1\nd1qCa4pgzmF7Bb/GrdJ6v6BufYSeriIvfPEkJ2WtEOljZogOQYZvRLan4mr3\n7npK8Z6xN9DymgoM0cIOsfjQaHVXDPB0QpjET8FMbLW6PjFmi9WhaL4xn72g\n/1sJmKs5KCJUIk9Q7mC8KLQ2I5djVWMXZhs9X5mJymAZBMuejUc4DgcZdGKK\n1+2BjpvLI91w9tzhspNm3e2iYlMcExz/0n8+TYXuajq7AVoJQFyhz4SKeWhJ\nu6zb\r\n=Ic3S\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJqUUzfvwadg//v7RQrGXOXySAEmwaJhEt8r7ljTG2zAiBs9SwpHmq6Wn227UeHeEhjALVpcdnQ36Jw5Q1WzyZKYQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7291033.0_1592355855517_0.5227825129920474"},"_hasShrinkwrap":false},"0.0.0-canary.ed3b1cb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ed3b1cb.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.ed3b1cb.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.ed3b1cb.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ed3b1cb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ed3b1cb.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-aUnDgD4mXGBYkbqjFmfoVcxcnkHqlddhquTeyehfF07rwvByWKZ0gDZX+ggkAF9ZfvZ96n5SbANIA/DpUQfnvg==","shasum":"e493e3e7edfda4428098f84ab9b3e0d8e2b84305","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ed3b1cb.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8jthCRA9TVsSAnZWagAAUfMQAIcWq2DfOmCajYewtuF5\nzqjaDCAahgUTG7x7JWlCg4iTtoM3J85nJ9N9/m0w8IWfpC64fpHcpnTsZ8tf\ns/f4pVc9GXs2VT/wJA9bZloBE4d7Hx1Pnmtt5OtLVKg9PLK1Mq/CNp6RXp/o\nBxjYIgRcqIkLZ9A6ZB1V0XUJsvqVOQmcBGH3X2XXnyg5T/cmfsVnbx/XUJkD\nWImTDzZgH2u+k2XeuVK5dIcCuETiGhetG9j7JBQG9c6e7BrHfUqrFaB95Rb/\n1nK9kqCJKkGKMQ1m7pd4zcgsuiUR01HPH3rL9GjRJmbzC3lrToy4+6LVThcY\nXn7PPcZG3TVJrjqkhWxivG728KZsy2Dcr5uiwPnNPjP8k1tcgGmeb/xH1sDW\nD2HB/HTD7Odx7fM4r5pBt+K4VZhtT0E0U2M+Q3OjIVzxsFvoaHaqg3UvcPPq\noYXGnpmtZzi/Gx+CU0HJEY/93QRltGfLjfVYpy0HfEnx/7GcqzLZnYNtUzkS\ni4IMUfX1ExWgMoGtOZ24XLf4p6r661aaE0BtBtFHVy1LuoTFNKWM0ATy8/Q9\nWjF3QBjx+gy9BpN4H2p02pIzvGuy9Q2uZn09xJ6gZaaRBfsTyKM9YmK9ggFR\nXaeN5QkjLj2qNuo0RsY9IcAdvGvS63ybI7Ol3EDVyLhGHsny8K9eqo2wUqwp\nsPNC\r\n=4Fqr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFSdLVJ+Hu5SZhkRHdSy4O0Tc5j0mp6lbbTy/imvFvUvAiEAiKrNn2+3434c0VRUW9wFlyhhYMVWIpKtPGc75uaiNdA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ed3b1cb.0_1592933216576_0.6225302216963364"},"_hasShrinkwrap":false},"0.0.0-canary.024e4d0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.024e4d0.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.024e4d0.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.024e4d0.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.024e4d0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.024e4d0.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-yuDwP0D55Q2ZunsXOa0A7qWKYj9HLVAtjBSF9BDr0ASpWbGpjYZ6yOeZZaOpFbSBwby6riEgdWb9bMJcuyY3pQ==","shasum":"5232a71267e60b4709085602b647c0a02ccc1cea","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.024e4d0.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe83lGCRA9TVsSAnZWagAAfPwP/2kFNwXm6oRkhPVMyNuf\ne7ra3jteFwB8mCY+j051yasORH5wqEoNOrpF1k094pbUSrY8fPnKMFGr8aK5\nT9TrAlCmKK5C2SLe6D7h1rKGX+jYY5wZb8L0Y/Q3BZozzEawcgUG9+VxTyhH\nFgHpMLZwmU/cFxzXRcm9mAoIrMKpnwt7GmTzTEm5c3T7ADMmq4zsP7iuLdk5\n5q6XB6Ybd/4bgSWR0z4cQNu1TDdGP3B0o/CBZXPja1tSPq7Vc87qIQ1u7ubk\nuDi9QAKaoFfHo+OuL0S8G3cqRPTAiSI6j1+w00ZKB+b0LRyve34GhhUIdHTP\n2J5+u7EBbMWOQVL7Km5asZfYI1oBvRDQ+hSFfpyt3/db5Vt2dn0IbFzWrAqL\nO+i0HMY+4Zrefj8lYze+CIrk1rtH/ow+oOutF60zkSPLWcLTCydXdduc/q7p\nWxSNUFgnuhZhYaZztk6rqLqP/WGPLxLuLSJVMnPk0OINVxZN/XHHZX9F9EsG\nic8R0/yWXwllWMhlIMlSNxzmGhGigtahILhJJTqafp5vU5mrAvODbD5ZRh1O\nEleP80VNkLOwjRUVFRF4D2CaR2UuotrazhW8d/vcsjF9XnMQOfE6oXUInuZB\n7X6L3Hbee3VSQybuyJMFHpy6uuPGUl6ACxwDIVbmny8BoCLezRuH0+PHpUvQ\nL0qj\r\n=9g7L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdrvg7PvYluIF44JhccF1VeXjRtB7cpbEwpvZjTLslrQIgFTU8m4OMYnuz2K3DBcXWrP8FeBLeScKpkGKzsXtArLc="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.024e4d0.0_1593014598243_0.17209624476795482"},"_hasShrinkwrap":false},"0.0.0-canary.7b62fb4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7b62fb4.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.7b62fb4.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.7b62fb4.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7b62fb4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7b62fb4.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-FFdixDcvhUjQbecFZVF/hirnhG1ecrutUYJm1ZP1T0+JnM9rM17DFsK0AmAG7YKJdZhiVa3S4aO1KA5ZOEFh/g==","shasum":"792d0da2ae21dba5e3125b0c7ecf2c703f0582d9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7b62fb4.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe88TfCRA9TVsSAnZWagAAxKYP/jcAfT6lDySrMz5+bWRb\nvHEizYbXclrvuksoHOatVtpuvDtv5s27SVvtH5v5IZ9G1e8bm5UrhFyz4+eA\ny1XIftWjTwLuCt0GCbfb5kpezAOq0PdL4a0cuONPylzOgmR9FTofqEHUvKzP\nxlf/k+AvOiZe2GYLwQH+ljrmgPgKjEO07fnqzHqqqi60Xlo1uzb8/uT/8wQG\nr2la6naHenjyyPvzJB6TCz7IIXL6AY/N5jBYbOsZg0OC74g7rNVjCz0BF4rR\nu2D9H+J0CSTcI0j6OY5bv312OvvHZV8QaAg6ebcqWRiejkvB+q2V3ks3OPmO\nOtfRxpKXj1J1EdT+d9zQBwMK1GPtGD5HP1c1GRohkOXTcGxNvZL4t/4LULhE\nkMVs1AtyfGjApIxv/QnMJbINF3LobVVDOs9aQtdWd89h1AIryFRHEryvz2+X\nhidDXp95K+756zm79sVf75a/xYcWStku+wZhkakJdRdTqhDhLdLPbb9WIS1P\ndPMFJvraLnWJqr7gB19o9sZ/jYRaN8oZ8sY3o1RMg3ZWXHb3i7QZR7M3t6sV\nMiwqIQ6AnZlOxJPiMby083SPK9FRGuPoJ96VsxiQBhDcZ9gi2a9MNivTJcut\ngeJSsM+ie2y0Ur4kq9UfrAF+kRvCZrmpONtOlOzkLzvtJqVHkh4ufdEyapgw\nxFcz\r\n=JwxK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtYPu2UBX2vUarINBHtCThRLgtM9SN+oWHDgPpKBLfnwIhAI7DiGMXGJUPsGgAXOooObCNcP1Foj/V89jDpDfTm8ie"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7b62fb4.0_1593033951399_0.4751140042985307"},"_hasShrinkwrap":false},"0.0.0-canary.f151937.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f151937.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.f151937.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.f151937.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f151937.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f151937.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-aC1kOfBQnNNbvGL5AjMmfm4XBAPCAEVrXJmh5BK/E/uqYaRM6urymoPLCcGDKWCOb4VstgjS7/apPvo4ktSTLg==","shasum":"f607bfb9b50532655ab344c3b8a31710645671cd","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f151937.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9StdCRA9TVsSAnZWagAAISsP/3jFIcNJLS2e4G0LR59b\nT/VrX88CXoM1sivZxxj7NF7LJheqwSKQ9A2UKrk8Oq6T65SEDf4T0J7jrEkw\n3hmo9eFF8ya1He797I3fa/+WRUV9lC7CJGo4o4LNGKs3BZmGyYmFvJ0uUc8X\npBakkpJ45o1m/G+U9vKWYGipjl39J3UQ+dR25LJuoOP6ilvzYzry0zoxSTp/\nQivvtOBFerYJP132uqA8hiDtp4iTz1XMYOyhtJ8xEEAQlsqYqgT2BQYCfERG\nyQdeX9S+9fXcNgpE5q2LT37SMOV2jmIZTr2Fc3SiCYa8LqAKx2RPhkWIBVHl\nuk6Jf0zlqDJ1Gp3vc3ilXt3OhZX7x5t5f6b+rEEYRpssIcl/8BN6QHFBMwKc\n4kLU7NKZ8Y3jheuwGer5ckQauRe014D41uc0kOGVnOH3xb75OH7tEgbSvOQF\nte2hfOnLbNhb7QthXrRAvSGFJso4iM7rovc/bX/Lb8mreymmi/U9SeItXKJS\nPWeszxagJXo49LSgqlAgpBtpYU2lk95WS3npAA0dxCCLNZRpn5qZipCNszqY\nWc/Cgz/w2hEqMDEMv3m7/E6riHuJQAVc5JQzvF/atof7FBM0bLjO4SJGNeUE\nozPNNoYZsNVxOn+s9HPUfaq0xI4Byh4oox98ocjeRO4cgpuuiif2lhmog8pW\n66R6\r\n=BvKb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqKtS2jmEkwUfI26zJxHtV8nqp4/RtR2pDgo18FO+TTwIhAOg2pU6CIRdk+yf9nfBYWEoUOWYULsfc1mgg20MBMtJT"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f151937.0_1593125725181_0.21425434708091284"},"_hasShrinkwrap":false},"0.0.0-canary.b9c56cd.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b9c56cd.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.b9c56cd.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.b9c56cd.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b9c56cd.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b9c56cd.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-U70ClxfRAv5Kx278lgNRGFAaJmIOejZ9rwmfQfeNytjmw59xaSG/ZRGGgHQMr5co0VHNuLLlegRPzEh7gStr9Q==","shasum":"db07a33b72e7122e7e3cd9fe6db56f7520f63006","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b9c56cd.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/MGzCRA9TVsSAnZWagAAqwgP/3JpSFxyTNIT8Aaajeru\n4fmFPA7k0PPW6IfxY78VUwiB1O3govrgdErieANPmla6TAUEoMyDUW669sO1\npcluWSAvgIklU/Zs9m+I52j8ypKl2PJ7y+eYJc3oQW5fl+VEOQWbMg+5CCOi\n1+ivuWjLIWOs9QdFYBxWXO8HwO/3TNW+28tT6Z7ihV/EQ8+qB8w5gY6LcwIn\nNtqxDU8H2Msr5/G3A0ccmJ94t9SoTrec9fepL1jP9gRFWInAu6cP9tFqJgOc\niyNQ81rhWXjaU1zXdQ7SDTS052Huc0+/ny6vC0R16QIbACLT/Lq4rebLxi7c\ng64HOXCYY44c2u3F8Tqp+JVdL0IqObpqACmBQmUg6Tzk5NZIctrrH7wztDQH\nhwPI0J37iBQENc92Ybfptd8X/3UK+9rrvA4OOWJp5WA8NPFKbciJg8LbiTOn\nKEvIg12e+IX/Iyy/PkaKmPjSychyeAXVXH7PI7zw2Epd4fM3zY3kCtT2xsn1\npafVumiRhmnanOqNdfcBuVydwiReBEqkWcasM+crHDxpeOoOJhXhL7JDIy8T\nRXHRZOfJhv6e0Nlr6OHJiJogBsoIc1RcUDDaF8Rb7o2DXctUZ4V9eSLcFW1h\nlwEYTZi9AfPbTtEbsAxFOS+UzLpDlIhH46JkB8W13YTW1gof3w/PPjwq57YK\ndCSj\r\n=Z+f3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA1VXjbmVbzGxUAGRYrUZI3c2yXtrUk9hzEX1Wykflo5AiEA5FWNM8km0oKm/G8Me81HBJyD81QBcBtOjLPmLtl5rWM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b9c56cd.0_1593622962856_0.38427335316492206"},"_hasShrinkwrap":false},"0.0.0-canary.152e4d2.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.152e4d2.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.152e4d2.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.152e4d2.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.152e4d2.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.152e4d2.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-BJCXcjhleNxl/oc9CLkRmEmSXsLQQdJNdIAJm7DHPi3kkOF84l610e0LL2MAcmmnVGhisayGuUCDf0FEYKbq3Q==","shasum":"1a01add7229207eedcef0d107f254782866ba1b5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.152e4d2.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfA73HCRA9TVsSAnZWagAAbkEP/Ai2CcNJSUXDNwgfhgAG\nmuZo26mlDgNszFizquZka6kRMVGRcv4IVQpCy5P1uki7ywgXF/N9agVdZdvL\n5X+Bn7BASGQX9F0k0Vnog4CsHx6zFbahxH7PC+xTcGxvMXawsqV1ohZgAJDH\n1s0b/Y5TXIIT6HsPNZaVwdg/EicLTzsi1+moqBrQJj0NcNQPZO5wYPfAV3Ch\nQYR8lYssp3g+a/aYG8jJjTvHtcYSV3r6rWb5EQ14vGY4sCbjxmm3vXX+I9hc\nsrCc0AKZ0Kyh7mgQIqPSzG+wdYu1SIx0s6IBeW5tuTOsC1W/W2kCNb/3CMYQ\nm+jIswxZld8SQhvSueMER6Nqsd1G8q+Bt8QqsTbIdBVDcu5RJFYbaRLdHAL0\noZoGKjUGfm92cy9q9raMBH9E6oWwtC4cZ6Fku9i3i1QZE0urS+reh8ewm2MC\nhATJisr9hPAZVw8W/Z1f/6+RNVImwlhfYqQH+FW02ZxvMN8qBDxc+wlqFOo4\nrhCNIun59zeLbRXeOqDd36EpUMBRkzdKAXwllHhBpDjHCAV9cqgG9XptmVl8\neR92z82dfZPaNIdQFohTtL00++2bppVW43RMZfMk+JT2YaSZrMNykrqgTeO/\nmZqDySPB3IYwSFiFc+eaVEkOF1HcL3aRoumYiYFRaQor4/9NwKwxQZBZTKfT\nKmfl\r\n=ca1m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAPpddFXWw7xtCXior2aJVFMc1OcWGXOR0G1kdnhF4LDAiEAst8UqnkncTeUBzfvPyNCJoadLWt4ygCvXBIhWVopAbA="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.152e4d2.0_1594080710587_0.5860941857852335"},"_hasShrinkwrap":false},"0.0.0-canary.3bad172.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3bad172.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.3bad172.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.3bad172.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3bad172.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3bad172.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-gRE4pAoVnhMdfDu5SjyGz6V4lgPRnhnCD5V9SICPyKWgH9b8cVDRsYK1xOOdLACPWula6qDn4qROB2GtNbvNGA==","shasum":"62c90566fcce6bda42c15cecfda7555e9dd54de0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3bad172.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBKBFCRA9TVsSAnZWagAA7+AQAIEzmQ7lQvliqS4p+e7f\nZHQA22ABXlsQYigQl56GDiDYetZqV5JPiwiFT57FqatseCRH+BHeqyPQ2SJh\n5Rh5+UVZu2EHv5AY6KiDFxyX7QaqMVM4cTvleqXO0TLCTHJCdOtsPzZ4HqAh\n/hgbm0U3cVC8h2uya9NMXkbu7cxyTz9H1thynG78sxbgKzuPLWYRnV0Woe99\nDPxqRWt+9eriOkL6YB6fU7GXnTYsW2UF3UqlrvH570/pJP51rJg2Fc5fasIQ\nxf01F6X32tXThsGOZs/6BG4ZFrLl796MJ70/nlGRk6ovIb7q1ZKfS+AJkR2Q\nXpwgJ6MoKaiK8zHF8dVu5wfWjmsWric2Z3EgppazbyAigAOGu4xRdgNiXZd8\nl3UxEVl+5kwihlj7g37vrSY42xszRxByEH1LwKeYLjz0wQykioYCqiuZaw6r\ncn9SZC9GsWDPUFI5bytdds5GbF0TUSuKskB0zu+M1v+eFVOFY1+tskULyOVY\nbkxPuctP4EA3AXlVr5Y7ZAZT4ySOku/+7JKlZABqEGOQeiRUTg59tXpKh6jf\nOg2uGzRcLJP06/hfek31GWVTtq5E4NjGCOz7ANMjI42ECMMAbBg2JPdzTJuQ\nqny31Ih1ejJzJUn2O9aKRZhmaSo3OwyjOknUDSCusQPAARgXq0FShGdt/Zqe\nC/zx\r\n=09KN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID3CDREPr5ikiL5aAdnLdnoeS6QcDOqumbG/aCtCggy3AiABRLH38fm+EdlNUkdK62f+gb+enCrhmFWt3SKDxllBSw=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3bad172.0_1594138693211_0.9785699715792233"},"_hasShrinkwrap":false},"0.0.0-canary.de7fb27.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.de7fb27.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.de7fb27.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.de7fb27.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.de7fb27.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.de7fb27.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Bc6qO4+H11LuDuImA5Lo9Qp/srN6eydG59v0MFivo07XRMEPHVcv8RPAz7NaIUkKudIAnm4wAF1e2K3UmSudNg==","shasum":"67fe298e3ddc097b2654bed45b07f2b0ca9778ca","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.de7fb27.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBL7SCRA9TVsSAnZWagAA8rsP/0ByLRPH50K3E4k+2Fgs\nJPw7emVQ9RV82YBrKK62YyPFjKxsNL1P6QouiYZ+P/z+y642q8KESbAVYOY3\nFiCcy6E+/0AzeqS3dWvFS9BL+//JWMGxHYtRayNxUsMNI/9ker6WA1Gu/iim\nFhXPFdJRbUn75yom+Me29GtpEn4xqHKbun7UeP4BKoKOUKonlGHPiwVUCjy5\nM2yKjWN4Pyrr6ezRMeVCG6X6pLu8fqu8i7f/OsERctMxq8rElxuy9PMbMCbZ\nmRZ6rPEgp3AP1HjXjavmr5rXvf7zYhkz2aMBI9kRHEIYkjoaxxypsF/4/KNe\n2vnczoWPOXM7787QFkkf5dhyLzNcY1YWZpDq5ECwWU/IFa9XPrev/vZkSREz\nSsW/uGSBDePIbDBCZab703wIixHDMLQlgCBBsYa4B8heiUYEwxoPc2FjpYI4\n4/sBrKO1CxkF1vG/iGvOReVPp+Bdeve8l2fUY/GKFkisHjv4KmIW5qBODVmM\nEQhSfhdlnjJU9TeikG29euJ8RY4WC8d1/KZDmDC734GTRtmsFygrgY2Ev//n\nWFgFZx83WbrFicDGzK8fsZMfic9CQqgvFzP3W1nlxHIZ0OqUCl7us5cOI9cj\nJjyVZk4gbL5nx23M/KQPEP6PUoYAUalg4cvfukHFSeUXJgxMogvneS4kCG+X\n9d/k\r\n=ga42\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID4UTHLBtp0kv8/Lhfre1cyOCr4ENJn/VG84OdrQBk/aAiBvMW7KycxIJSHn6vZ5x4Ve0wurbV7xxVa0ltGWBWwGoQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.de7fb27.0_1594146514240_0.9738680527987678"},"_hasShrinkwrap":false},"0.0.0-canary.fe1674a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fe1674a.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.fe1674a.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.fe1674a.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fe1674a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fe1674a.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-yzcMovjmtwZL8UGQKDgemsT1WefTVkdxNTB5/iR8BGJMAq3pKGUitGZ1+k225FvfVVLb4Dt1BkX5CGpBScA2CA==","shasum":"9045162b96d74b1dfa27484e44f354614a83ee43","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fe1674a.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBQJhCRA9TVsSAnZWagAAAWgQAJeK11d8+hxS+22gt4Xl\nU0oGyOLH+q6wc0xXOVNXjaTVqeKWR8+f0y+0T7ASrFxuVbF4SbINOkZoTlWM\ngDhJGjx72HM2u9xF6BkKf5oBd+23ABb716cz8PjtMoHCG8IN38PB9iXkOI5T\nfNnkQZAeWzJkmIVvmcmzamrUUzB4+zK6TRgVoQwKoXp8B3qlGgUnVLy76Szo\njtOEoGzNSMxELOEFk1FMsVSHdzLLA5yL7aPcKiZxVT50fO9ncl13AphdwbPs\nWBJP8l9JTwzFhMfnjTgN+8O20PDWjydE8VHr4/olbaC0rUrHD4FsW5F7mODy\neQ0rXB/kEUPRyOk0pjTdOMOKnh2OlYM/1Y6n59AivHu6dTPq37hTDjVlLzav\nSDVdOIuiC0ISlkaY6PmUtzdKMYgaL3aaRx2+mSMaiLEI+t1Sf6HzUCuyh74v\nTCRxdSHIAW6q/QlYFaTmXd6hRfZHVFACFsJa2McBlysjmAk+VlMvqXVYOLDG\n1VEYBrnk9nXJtCX6nuMcRqafn8+RkLICqf/hwHg6e0W1PtpZIwLwfvod7mPO\nqd/0JISIR1tnfw++yDEPma4raDpw3r5w8sCGx092mGaN0+VTYmqCWvLkKbUq\nOPBR5o7EI5zu1h4ssn6qv0J6hnrdOvYmpLFsUcncQlms/vWxkqPlTHo3mfyv\nj2Ew\r\n=qdXK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE+YESVDGHMQhNUv3IhzdUEFe3WOq+4PiGjKp3EjSyttAiBtuHVQyKLQWO6Yi6re5NIunL89VpaR/Xa7FPFAm2O0fQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fe1674a.0_1594163809450_0.7008021419946577"},"_hasShrinkwrap":false},"0.0.0-canary.9d3d9dc.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9d3d9dc.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.9d3d9dc.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.9d3d9dc.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9d3d9dc.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9d3d9dc.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-oWNvS2oCtO9o31NOz2OoFv8yqvMkFl677gZL2uagZswoFp9il06kosad9WRHlPZ57TDj2LK9Eqi+2WfkEghUkQ==","shasum":"7159eeef58a9253b08160f6d141c145749de2ee1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9d3d9dc.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBfU0CRA9TVsSAnZWagAAML0P/R3Jk+YT1YAfDz1tDVCL\nAjkEQyfS+JwSXtsSLYS2nbUHVQI8I3Ey7mpQgsyhkvsM2aMOl0s6SIiltT6N\nYn3GzwIFxOvaSrjyxwOIZT+9IuyMFtNIDko3taGRgF/BtZIYT27jJofg0bE3\nJ2LQN3h62PmIpRs7lJz4ZdN+18+z6qZyJb6MoDlTKVMuCZffv9hlqmW5HPoU\nHSbb6bi04TSx0ncB1H728SCQ4GoFouGnzibCKYCN4dtV9Lb8mOozXRI6xfJ8\nZjWL9uYivZW04Anxp/sM4sC5GpxhTngN8KRZ5HN+s7EGd+awcp0fZI3LJWyt\nr+dbh6eHJ7xqkqd9TigtHjXQ71MkARXFXLszr4G/vcxzB80P3t192hgC2Yrx\nXnxURAHpj9/oI+3Kf5iwAhEGv1jQnFXHBKLskfDJ7Hw/HIOQKcHwY3EKHBKA\ncW0RTmonRBb09Z6LAHPIdNZ1I3b3qkOXFzmSBSBbfFiE4J5qNMujwXg34EHr\ngSShAVWG3Nlx12MIHnU15dYptYljzm+smdQm62yV2EaoSCl204lPKk1o8EK4\nRnwbllw4Pg9F7yYlTx57BUYWcdx3kDe0sjFSs+ULwwIsJuL/HdfuEK/aZJLU\nPSrqqPA/jI7V1MTD2qULF5/njhs0YGxQqsBtg1WQPj08S5w/F+dYnN9ltxJB\ngMgP\r\n=JDLN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGQM5iUZOQ7WkL468IO1KqVVkDyDAcDphiDkSJCCb6toAiEA4u5GsADY/1UzpZDZIx8xc9g74Ga0FKHcE6Q2MNcIYXM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9d3d9dc.0_1594225972032_0.6987115690873169"},"_hasShrinkwrap":false},"3.1.4":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.4","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"2.1.4","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"2.1.4"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.4.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.4","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-E//aJlphe8rBHSfz3By+J00ODxkBCOZ33esuaZEhJdpRHO+zCgazaioqAteI2Uu2eYtdsTWLJueBPRB3FByo1A==","shasum":"c7a9099fc4c025598c906f5ac2cc5a9b48b49b56","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.4.tgz","fileCount":11,"unpackedSize":39999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDO1RCRA9TVsSAnZWagAAvhwP/RBXd5HzrvCTojLHNQIR\nK/sqW2ivmhJEv+Jf9owJcr8wfzmgCm7bsuoEIYidX7EITVps4YAi+T5lQvAj\nP7eRSror1VRQzqDduJ8q+lHFVk9ptXxE5kjHqwxxmF5yJLVWRFOFLvkVaS6F\nZnt1oJwFrsOEEHKfzB9FLsO6bv04kWhbQ/uZlT2KKCyV1OxkZETYPrhXkhIg\nUTKtEGAuRgzwAFo37Nv0PqzcGkDciSdOkRaGSPjPy97Vukej4TZlATKzq165\n1KJ2me9YfconF+yqECt/ZKj7j+Lw0uee/lCq7qyPRF8tAQcJTiEJpicFPwhi\nY2x8TwuYvfvWooFGdvBOp63psGzg/YyLqXhLXH3QbrsIrnFkQsS2gLDsdo/d\neuR171/nUpSn+2wL83DT9mlPRXP8dBbFgyePev+IJ/2cBk3kVr+UrR0X5aNY\n27khQOuTVLWyJaQOOCQvhnBzSDQks7SpWZUQJ8HaWR1Oo8APgjDbbcn6gAkC\nPeUZO1iYbu8m6FMGgwnfMFcsMm63XR+aNuqCrFmRU61sOf5MISudDui34pZt\nTkRO0XVW4qcnj4y1W503tyocp+znMCJbkzqQupFhAn0iaRmi4+0nWW3p7XP8\nK4x4Vuu6epId3KycCrUqJVh90GhVKnjZdbd/tS4cibKHsiSEqk+o+zeTii+C\nOkt3\r\n=WmWl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvs7gt/PSeksrnIIe0uXFIQzJdweFlB7vf7uRvs08FagIgFLBwT2EbcZ1FTtLWIFtx3dWnWIqi/3GrxD93etR9T0I="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.4_1594682704893_0.8744521891722778"},"_hasShrinkwrap":false},"0.0.0-canary.4e80a7c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4e80a7c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.4e80a7c.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4e80a7c.0","fusion-plugin-react-redux":"0.0.0-canary.4e80a7c.0","fusion-plugin-universal-events":"0.0.0-canary.4e80a7c.0","fusion-test-utils":"0.0.0-canary.4e80a7c.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4e80a7c.0","fusion-plugin-universal-events":"0.0.0-canary.4e80a7c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4e80a7c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4e80a7c.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-GJErUz7QOGsAbRTPzwumrsNRjRygmgGfVoAk0vspmZ0j4oN8ybFRYK4BQ0VlMaIbvIvR/2JK15kYJG0566NYog==","shasum":"198e03520dc1870d14d56c5f363544cae8178aca","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4e80a7c.0.tgz","fileCount":11,"unpackedSize":40137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSDIuCRA9TVsSAnZWagAAM5EP/A+J4CUPgV7iVHhqVUzx\noMswSr2I2KcgDZhZ65RJe2I8PeiKxRGfpyVGM+y9Pzgst2Xxo61i0jbABYsP\nQCOrlEhgMlL1ew/XmIQAqOEv66wmRFTdX/b8TSGMTOtN7kci9HUgS9kJ68bx\nY/YtYqd7UKClEtgQtz30uu6haw5/Yr0MJZO9+QPiS82y8u6O9M0JckUY14La\nQ+qF2cKRW4A4pOpnM//eMPrFReF7ujuUwnMo/ACobrt3s9BwVj5bSBoigP0h\nc/YkdT5v8sC7yxz251eAuagRZIbAc2IQGRk4G7IFMfK66h1RNsxGsTcVWASO\nnFazfMRaJJZfOI4v7cK3xOEXvGw3XXesjNqdhZDUy6BL14B++pAUgfYJprun\nGMv1L1xPZlFRKhkd9KbHOgQN60fn295RqYclpyO7RvU0dXILltJOXAAxw1zz\nSOtPdsPUyPMaSYUaP6shktT7m1sXPN7YwmT+C4yv6jEI7T0IyhEuSaqSdVa7\n33tUKRVwU66hWwYQxdsLnwQvdxgasnMusnnnED5ImfTjv50vKNaoHT5gpbE8\nFW35F8UIvd4DnQsyXPekFHtdiI64m2KpbF1WKBBFYEXCjeedoXqTbOgF+YgK\n/Pv7wkPo/ArVUCufYhzCscgTz5qsmaV9hWn/WS4di70PEVTXdH0tKxJvS3bs\nP1wn\r\n=1mLU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBYHzHSyh5V25a7thE3+hmV/JG43lwodvz4wWDa96poxAiEAoBCQGqzUNxoRiUOHHlKACJJo29b3/eS8LgNvZZ8WE2I="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4e80a7c.0_1598566958091_0.03882557305348677"},"_hasShrinkwrap":false},"0.0.0-canary.4d0772e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4d0772e.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.4d0772e.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4d0772e.0","fusion-plugin-react-redux":"0.0.0-canary.4d0772e.0","fusion-plugin-universal-events":"0.0.0-canary.4d0772e.0","fusion-test-utils":"0.0.0-canary.4d0772e.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4d0772e.0","fusion-plugin-universal-events":"0.0.0-canary.4d0772e.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4d0772e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4d0772e.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-YHSmkR5nauyL70RGnMpsDvOXkwvUiXQ+xpGXwiflJ7zVfNWDoiT805XhgCiYkaoBYlRy9u0yBrTTm84aDu/uDg==","shasum":"c35c29e6f2a940dec67e4cec8f91e6eacbbae47e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4d0772e.0.tgz","fileCount":11,"unpackedSize":40137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSZvICRA9TVsSAnZWagAAiHYP+wQj/sFWBhal2kjhb6b7\nDf8+65HUx2YcfTJ1nefUXGwR5ECZpMGda3OaLsgP6Kf4Iok8m/72eFloTcv+\niUuyUC2H52VHdooVc3jepdm/ss+z9KXJDWZURRKQ32X6Ieq3hRySXsmEiL7K\nOF4SAHThEquvhRqgWHuELpnS9YuttWPf1P0HImPFk+q7JbVGlKmuRb7sbgUB\n2wrra3USFPqwoXAg5kpJveoWH/oHgKdmbhIArXDOC65lxjzxg9RtI01DZTxy\nK3De0om/WmekI6ukiKT4K/Xy+rIFv6fY0NUIJ2QmSf9TZRPqqt0eT0D/Y5yc\nhzdDq5+hluSA99KrBmAz517z05zDS/ikIn04YRQik9XsFF0OEpIgdHotAqwy\nI92uDtfJqzaZ1Yl6vPhfDyW5s6KeF2QONX8auwxvpOSAirLWF4FgAFclxkxQ\nSzvo1GGNdXH9H8bGZnyEmObLNlogJQ9hI6bH1NXMnvwipxFq9UZC6waTmeQ2\npHOnZyc4uxCQZkc/LvOBaSuM6CeIe+qQmrakH68nTjO0LYpcKL0Xtmxegbvr\ngXDuRTRscHfzZGvfTL6XrGxAzxjU5VT0q71fbHtx8FFYJFdcOVmy67kJwxyB\nElV+68fP8MpcqfKrUEj+16L0WtaVkXOQfvtdSMxIv1l1cT0iJ3vFnlBbooF9\n8lov\r\n=dxRb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2KeTf7gAWkbF3lsMP88pAJLDKAdP5XFfGXUZUp4EQSgIhAO3qqthErBLmRXeTy7iHCONm0buAJCy62jW002GsiwW1"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4d0772e.0_1598659528227_0.4178248679019334"},"_hasShrinkwrap":false},"0.0.0-canary.8a530ea.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.8a530ea.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.8a530ea.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.8a530ea.0","fusion-plugin-react-redux":"0.0.0-canary.8a530ea.0","fusion-plugin-universal-events":"0.0.0-canary.8a530ea.0","fusion-test-utils":"0.0.0-canary.8a530ea.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.8a530ea.0","fusion-plugin-universal-events":"0.0.0-canary.8a530ea.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8a530ea.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.8a530ea.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-mHCxAtmbHbgPqJO0rlBw59ZvY2N8tIEJQMaT2G7b5mNGy2aNRRx32T4LR4VPlvwS9g1hYkCTVewmML9DXse1kQ==","shasum":"d731f97fd4202767de8c8ac8d507d3cae9c49360","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8a530ea.0.tgz","fileCount":11,"unpackedSize":40137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSawoCRA9TVsSAnZWagAA2IAP/RStCpvCmxEXy2gKDeQE\nr92R9Ab4Ti4OhqRsnAE79pUTBtJ5nvVYPNByf0GiDa+g2POzzoqgYt7HQYlQ\nS8q0Li+uOG/ZfK4gB+WspLXG+HkUIdDzato1HiLlML421lyPNlm4Ie33s+2z\n9dAUz43OFTSsOoZECiXwLKkWukimZK7BqA/NAZBnWIOm8o5KnY1fJ3x/Cdbd\n9dbnTzYrEjL/urTtWFh3yTXUaIyK6W9k5h5dMvzBQsP4TVKgXrr1SYzdYgJb\nRd1s0XK3JPUPkRixu69dttanf3GXvyjKV2AR1kQCvnIM15XHx/6+6tQ1WhZE\nLxI9wU3xwIQHi3q3yhqtGoLDclYKDzj00lAznXTfFtkvlPRA9VkRP/uL3For\nEQdriUZEx3de0KAABl0VV20248lGUV6J/hXPuXIzMHayEqWjB0PoyzaKR5Cy\n0TMXODX1ofAm1p6n3CyiyvVqWs/0ylIli8aXkpmAt7boNVxolOOu/r/nF2nP\nOYDz30XYyAklstKyrU+T9s8fd5MbFg3Lnqye1pZa7oTKOkSwCR0/2rfzDCQ+\nb0PT16va6q/MhB3Nkz29qq6LHXacCAU95kKREgcnvMyJSO9w4WRNSYZf4SsF\nsRtfojDONGouoLfpuam+Mv1unpc0bK7b4JINYmp3MWCUO3b/UEfcgNt3q7HS\nzVE0\r\n=d2tp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEzq2hZRTI64r6EuoAnHRF/i6mxYm78+SaDYD9UzaJwwIhAPLWuU0ITFYEw9BPB1hrZnFkctEvBbbw7mAGcfQ+49ro"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.8a530ea.0_1598663719817_0.6272899428282079"},"_hasShrinkwrap":false},"0.0.0-canary.4404d9c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4404d9c.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.4404d9c.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.4404d9c.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4404d9c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4404d9c.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-hrsa38q9Au4jZY+Th9IsR2G5Mm4t0FRAh73l+uJoFOXpaJ/4b6jaCfD7ofzhZhlKIZqP2undCTYusFcbW9mIeQ==","shasum":"a33cb371881847d8668455c48a5ec4e06b0dc809","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4404d9c.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUVtXCRA9TVsSAnZWagAAwAYQAKJvBkMe7OJlemlRF/wx\nLPvFuatunCGgGviIpbcqf1E7vClxnYRKgFV6L1QdQ6mp0Wq06fZOxBSRvK0+\nYReMscvK3tP8KkyO9sJ/idqGGSqbkFzG2J8KZ2DDrjT4pbwtuo9JXXMOLSgn\nLCVArOVxvGh5l9zIySGMp8/hR6mfI9cDoU9/JsEmawkCgjQCas7H0+wufOFR\nBVsmi9raEz/N9xgkToKAb4vEPp1I9nUmjmsEokEJE4x2/TefuqjDGL/1SpMd\nLkRJ3sHxaUtTHqo2789NltEgJYHuE4+FbtkaD3B1MwBFOFVbDnKpZbpY4ila\nkYJ/bAL5W+cq4MgP56588SCS1eDEb4EJh0JBfl6TPkHRDLgZ2VwMipDq6dp3\nyH3H0z88bejP1BEdmK7gyyZ3LEekgFy5baU7Hs6447JruOB8Yrm2J+zzyolT\ngDc2dEIATEvjLxFpURdYHu7ZvftReeBdJb9WR4H5P4OrFXso5XkE5qwcn90V\nXLqBddprBLZwkwSFDKsHjnreHcSDsoC7PgaVbJ06R7eIutEQbivVMml+TDxJ\nB1tV+6S2KGAdinnbX5mFh7ifxMTAPxcpAsJTwLQuEur79BhY9tZFseZ3HFVn\nO3SYc0aYRdflCZ2yivaWaFxl/qeVHJIhBLZEjJhqbROCl2Srg0cgJZ0I7G8z\nFIyd\r\n=n8dS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXCnu1dSaw/QietuilRooGEp3dkO0ygGnzIjyWB68xEQIhAPUFuRpGdYbE0DmV/KQ248lkqDJ4eVo0K+r0FrbLaJR7"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4404d9c.0_1599167318599_0.9702640505551798"},"_hasShrinkwrap":false},"0.0.0-canary.b53def8.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b53def8.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.b53def8.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.b53def8.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b53def8.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b53def8.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-GX/McDlRPsLhjoVKIfTilndWEly8c4H1ugam7fYWlch12FdPPnxzA4nQVJ3qUBDnxbVY6S0XfjcRDO+fyuIvoA==","shasum":"3e3c1a24a9820c8e8afef3bb7559f467b2acda2a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b53def8.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUV1GCRA9TVsSAnZWagAAa5YP/AwKze416CEF7zu8H6iJ\nz63aioH5z+wKAkyzvykuV5+69mUXHeCBkL41P4wsxi77IeZy5dFD9Wpn+UtV\n7COucY3WMKe+1krqwWB0vTKvl/Fw+yESIQwjRBotqNoO4fukq3mtqcGfRREz\nzLnvNiXi5zvu6mQLwE7guIfEG6LroadUlqDNqKQ64kljbAO5VTAGi0dGJv1W\nppFduVT7Livc96ulNIT6sE2xmTTputXvZqYykuBpBwStXqpoLE+R4+uRuCk+\nYLjQYFBrIBFSBq+IvGg0/sEcZv3xHndx/UHs0cVaVXNfMPnFyQ0bMJE0zaGv\nYOy7Lg0AKiNI25jjVxtBsPeC0clxm4UlCPfFYcNxM6ODtoaIbYtwj0nFKArZ\n9RGawxOdSF2OCp6dIL1UlCOkAlYLMSMc3F3Bv7/iZFA0G/t7XabKNfHoHEHn\nOKgo945v0nIaDOR/8hmGoKR4z5SQfLNRXVOE1Ssq/v3oy4btm3Hjs3uaLTfv\nRJUWT0NQd85IPwyL1NQgwVTHg1LG3mvqJ+0r790XaqAtFwsASnxWhX97826U\nSEdB2dny76TiRXxj8E460cwSOFwrw1b4QXE2UG83UJUZepPfX7gdxnrB8JXz\nbjqylbdgjntPoBpaLulJZ6Dy2JF5NyCiLL4DtJCyUTXQchDJ+Njh5mFUtKEP\nBZW+\r\n=AHI/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEiHrdzcfDFO4a+owN2chAjxh/Dh/uznBvXsxSQfQiQNAiEAxkPHENxImp84z9r1U6cInAwlI0v/AK+TinQhT9f5HmM="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b53def8.0_1599167813929_0.5611358985760844"},"_hasShrinkwrap":false},"0.0.0-canary.e133fff.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e133fff.0","license":"MIT","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","flow-bin":"^0.109.0","fusion-core":"2.2.1","fusion-plugin-react-redux":"2.1.4","fusion-plugin-universal-events":"0.0.0-canary.e133fff.0","fusion-test-utils":"2.1.2","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5","jest":"^25.1.0","eslint-plugin-jest":"^23.6.0","eslint-plugin-react-hooks":"^2.3.0"},"scripts":{"clean":"cup-clean","lint":"eslint .","test":"jest","prepublish":"npm run build","build":"npm run clean && cup-build","flow":"flow"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"peerDependencies":{"fusion-core":"2.2.1","fusion-plugin-universal-events":"0.0.0-canary.e133fff.0"},"dependencies":{"eslint-plugin-jest":"^23.6.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e133fff.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e133fff.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-hhuyrbl1s5FrANdNDb4HzKMuxmrEev+H9fh8lMvz2gJ0mxPakKSPpGcrkuYk4/t0JNbcGrI9tbz3F85ediXsAQ==","shasum":"2aed7fe72954a153384ab52f8f379869b3d6b5da","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e133fff.0.tgz","fileCount":11,"unpackedSize":40050,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUYbyCRA9TVsSAnZWagAAUG4QAJYQ5gt+GOZrTpFU3aYf\ndgMXO1hEn9cA9UB/9XE1o3Wrzj2hmoGPczgz8XoG+I5VvAHV8IJl/Hlcd3wY\n6407/atMcbhrWB3YPf8oZ5ZigLoOmg0AWYFZQgheb7VxkUynfV1At1jLoxuC\n4JXYVVcUSQr5//iYrSQaAPOznFfhFubQ6o1NqixKFb6Qgrn7lsSw9PxRE7Wq\nHvCnL7buqUDCNTnG8Wjrt6DAbxAawDr7+zx3b1rIy4VUOZSc+VecKLerEfSz\n1RcoFCJvHougbcS+7Fni3qrAhMjndT+odz+3YSoaHJPfZRpI8lsr5mWvbzQW\nAQ00WIqxAY7hMSzmwdqYIK7xAxrKRLoW6H6Y22MjavE/MHv5N8Ii3Thlab1G\n1PSBvEt9GympVLrnNj74wUrPXBpTIMuNg61DQDExzGAB35HbriV/NBS2ULOf\nibySTBRRhhF21lIwFU/KiXG9THwY9i4eH/IrFI9LIl/gJG/mKnx/XDR8JDRj\ntK1Q3cQP/eAb7COVxjlXk1jQuhmNQmVb4UgvGg4MbhDvz5zfeoZdq3BMQ4yE\n6YFBsUe3w8sy6qFJ8qcDnpohdhi/ArYe9HOMDV6HIbsBKSQJBmUIdJEPBbEn\nqNl+70laJ1Kwz3aNz6kkCwsJ7AtVeOoEv1xECiFdCSLIkn7Xrf80x6xjkdY9\nEoBa\r\n=4BJh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzXlKIeLF6QgvN4vDzzxtopKtylb5cojdIeO+YJ2MQxQIhAOFYwbICMR6lxvVod1cforxuPJHQNqDoyCGYORyIsV1K"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e133fff.0_1599178482005_0.13757136127989855"},"_hasShrinkwrap":false},"0.0.0-canary.3915f48.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3915f48.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.3915f48.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.3915f48.0","fusion-plugin-react-redux":"0.0.0-canary.3915f48.0","fusion-plugin-universal-events":"0.0.0-canary.3915f48.0","fusion-test-utils":"0.0.0-canary.3915f48.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.3915f48.0","fusion-plugin-universal-events":"0.0.0-canary.3915f48.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3915f48.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3915f48.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-/V/4ncElsQ9OcXL7Yt2FFymJtOjitp1b2j6jivbLmTXSL9JVuI6GfPJ5K5pOvVxGYawDsCmZgRnS8B/rauaCnA==","shasum":"51e81830d6e3902917258c8f0f5b3755d3e75fcc","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3915f48.0.tgz","fileCount":11,"unpackedSize":40137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUqz8CRA9TVsSAnZWagAASGIP/1laTS1mZRN/EQU0xqC2\n9D2TBovziaB5vjEf4CsEgCduSU66ucVd/lWJ4VZXRwYeFpmjwZMgvbCuHk+l\nRLIEB7THvqzAW5AU2OKT1gRn3Ei6keUr3TfqmgOGyxFm9G8LPGZQKMw2yT20\ndpPWzBSVhOgH18S+OTY/Mmv0LDRQinrsC4bgjDHnogiF7qzWaKcksQyV3P/v\nGimkWIaei21igQNt/p3g+DKG0w//QWGUdvivq+fKGA407JkzhXZjovjiaGZt\nozyTFCq9iUH9kFvJgmdx/f3JD01T9oHaqsi+44ZkNcR18MKJSRZlzJc3sIa3\nMakp+QInTHeMhtlIlXFk9UPoJuADxDHy8BssTimW+iDiys6HPdsO/+uOjzI3\n77kJuGkk5mKGLgguRBnYiJEqnMr5y8PEBwoSDf/P2fXhGgPuf3L+7u1F6Zi+\n2CVaa3BGbmOGh9/XrfQ3M5miizEnQ62rWLFXXaN+rUDWgVTAIVm+J4V/WI04\n3UjsI16eQTIwDq1hY4Fx4go0ZlCf8mZVat+chIQc9j/JC5ZSAMRu1QRW3m2O\nQxIJzpfF+owKraCXLkv7So3ALb6ugWb0ECeGURiIkop/L4sDSy4TZEpX0uep\ne1E0B5kx4Gvtn4ccWZM7X/mwCBgCH+XF5i/0w1I51U8tgrZCC5yPM6nnqzuP\n4RwC\r\n=4BEU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDxBFQhQPQu3HnNnFxflPn/SakrxTF5f3AjM/DTDJLv9AiBE3XDI3kNaYIlYoU6iqtzVIcfLhVJ8u9QWdiQrfDCfJg=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3915f48.0_1599253755627_0.362050723481929"},"_hasShrinkwrap":false},"0.0.0-canary.b3c0cf8.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b3c0cf8.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.b3c0cf8.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b3c0cf8.0","fusion-plugin-react-redux":"0.0.0-canary.b3c0cf8.0","fusion-plugin-universal-events":"0.0.0-canary.b3c0cf8.0","fusion-test-utils":"0.0.0-canary.b3c0cf8.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.b3c0cf8.0","fusion-plugin-universal-events":"0.0.0-canary.b3c0cf8.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b3c0cf8.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b3c0cf8.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-CvQ8FLUehmTsFTZbXAqdcigG8nhEEOPrSacqQx+rDk9dNQ6rR4aPcEt8k2yMUZrwEu2lNWBpcEzduGXqKFo9xw==","shasum":"0065a93c92b493ec29356c51b8c252c30048886c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b3c0cf8.0.tgz","fileCount":11,"unpackedSize":40137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWRMOCRA9TVsSAnZWagAAFhkP/1Rg/2YgJ69Pm93EkVIm\n5mcOCq44OLpOZPVmTBz0JrU+s6bVc0fY6aFBHr6/JLvagqM0pENgTOis1ka2\nODOq4zUnWUy9F+lJ63OnbjTzdVPcJ9THJAgMRXna9RCegzdicWXsqjvJR8mp\nTPZDJ3VRY9tcGJIblR16qHnUG7Jhhmc0dFSyRQ40yFiqk2JEpRpAFzMh2QSf\nnnKnXk+2S3ZMrymdze88VDQyW+T25nys6tGuePP5SHh4OX9ONdQW+MRm/Rn5\nXd9GqNOHQR6128f3OnbnaxopI3/tEEtKlemCy+AMiPG6tENwdrOppehis1BW\nY7lW8tnsWoqup/EKtNCWcKzXoZU3gOy4+ZOIrLZz3Y5NoJcrxn18au+cJNWg\n1eqYpkf6CXhmFReu7q0p+HkDRWJ9G9PITIT9iBBUBRRoNgonDFMefTG1kgtj\n35VkkRP3soKtfagyFTuz1xyWlgJzof7OQaFCAq9t7Qqa82jJ6Wa0Z/G4IG7s\nIjuL4T4lmfHIHxe1fIKT5pJquHQP5iuf0yQU3MU2wT1vwSoepRcnGXiqAZ8o\nIyFsuFytbVbpIvkJbv/TizEzBAcQXL9AH0Xm/kYvDOxD9Upq0sQL7Mxuxfas\nveeL4S27jQhtgDbpOQ49PPCBzJVs6BniBnKkbIB0JimzxugDyyP1vb/o55m/\nDP7x\r\n=XmqD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDwIMF9b9ho0V/r5JUmnNezhNE78SMjTtJZJqsY9UOFCAiEA0XkWwoinvrBzUXKj8D4a3i2WtbwyLc67PB0pEz+fY8g="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b3c0cf8.0_1599673101965_0.33169716159812856"},"_hasShrinkwrap":false},"0.0.0-canary.42048ff.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.42048ff.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.42048ff.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.42048ff.0","fusion-plugin-react-redux":"0.0.0-canary.42048ff.0","fusion-plugin-universal-events":"0.0.0-canary.42048ff.0","fusion-test-utils":"0.0.0-canary.42048ff.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.42048ff.0","fusion-plugin-universal-events":"0.0.0-canary.42048ff.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.42048ff.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.42048ff.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-zmSqJ/SxYEYzxT516f5n2QIv7F4fGsG7NOA78HO9GnjzDm4KuZ67P/aKSD4xvU0YPXAyejQ/N0uqXpS37I4KFA==","shasum":"16f3f6d2377ef2239edf4b01e3bb73426679dfc1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.42048ff.0.tgz","fileCount":11,"unpackedSize":40137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWydzCRA9TVsSAnZWagAAfmEP/1BRBIt1pLqaiPPOI5O9\nHIvJBhhs37rh4+gFFqaWv97A2YtFyDwPkEUZl4NOCYKWWTTDBRtYesQ8umuB\nQ7UEc3cupZl42tyhsa+r+wvSipTwSgYRxtfTrGH953MD/uqFSE/eSnkXDAQ4\nuoOSNO8RUoTVNOUd+/os1OqZS/qg8Z3DsTlZVXeM2Fp2XGa9gvPrHuXWdtHr\nkxXb3fHPFI32/NSQfvyJ5yzg4Fu6hI1tlkxfWg846e3uBqWlbuBuXgprKuWT\nPmt0b6kwZqor6kKSF7cOAo/Zj1Ooi086NLPJP0dUk4lWZagTw3W6i1n53vF1\nEym+YHZEwoIkH3E5iukw9V9a6lDnDTmXit8UWG2Wo9Wm27g4JIglctGp+tpl\nP6b19P1M+4WUHCLX3iggtFc1/tFWNCv98oXWbtVrAKLss2ylWDeQvi1cdNBh\nm3XVJf8qoCYTUOkDR2A6UU5hpE9UDLYxqOKzl1i2PFmNsqVgXyEgQUcDBv16\neMVg8hSCZ9OJcaPMUG5u9OZcm8586ssjHrCyu8fPeGHTVcZgBso1RJA0YSrX\neETEABWiw625XdSEko9+A6xpO0OpuwKLReMunxVi691KtVuGbjYnoXjWFxM4\n2AGZTXovUGhF64v1isgg8mBqoBzLaggZM0u23/CXjsVPHY0Qp4Jt8sn9h55C\nKtxm\r\n=U1t1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCmj674/1KSm5LBbbPa2xS4gYDH2iVs5JI+joHhFcHspAIhAI5Q3F8jMLrJVvEycwQOfuDuh9sR2Xjw4A4xUR/u7bep"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.42048ff.0_1599809395342_0.9162765994863658"},"_hasShrinkwrap":false},"3.1.6":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.6","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"2.2.3","fusion-plugin-react-redux":"2.2.1","fusion-plugin-universal-events":"2.1.6","fusion-test-utils":"2.1.4","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.2.3","fusion-plugin-universal-events":"2.1.6"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.6.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.6","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-ip7yAJnlRvZFRWEpV84IcnNLlKFwZZeFfR+aua7td7xxtdYT6c1+rZOy0iNlwN3ayWsEQEwj6UH95UghU3fgHQ==","shasum":"04e29b5a02d7a7d571b16da517bbd8976e1a5da8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.6.tgz","fileCount":11,"unpackedSize":40001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYp0SCRA9TVsSAnZWagAAOSYP/iKJj3FA9GOBj/oRWAAc\nKmYCHetKm1C6KgKTOcoQWx+Ptf2QC4BdSz8kfRwFcvHcQzbKRWeL0jfhYVog\nW4cYMJYTnQoAlz2Y5kUA3WuoU3mwdR8VwNmWfr3LBVajFUXFJK2fMASI/7Cg\n4rlIr9wxq1I+jc6Qlqlvb4O0hrOPsVZNQ52GPibvCeFMnmP1lvwtwNX8t/H3\nS8drIPIPCHEPrLX055WULteg8d+jUQk3mQHLylzccX/o/OSi7hGBd5zJejY7\nkvJTvtB4yYWijP2wRUbQKTmdo/HGvqZFhRzWUDVOdFzhZHyCas4uGZjNKeZ2\npdcBZSs+I4h/NENJyG8I5kYgJXYrcGUnZDstHtSa/CQZ0r/vxsZnNJ1fqBWU\niZNXlC3FdQGTjwfOuWBa46hKCAJIFYaKN76xzuhTgPxO3nNJhjQJ4ANliHAw\nQM9RxsmUETNl7psNp6Em+6Wngapz15Pn/aug1ikGAZLTxpDbTj8FnHeHdy78\n9U1IfbFfxtjQx/kZtRZH3qfyVfVd9f3688gVPKKYucGH/g9TMVu4frr2NYG6\nHIgW7lqj7lEVS897gufaURAECTvCDI3XbX3Tqwkhd1Ck4A72fkjI2GoJFK0X\nnBXC/PHnw79x/tz6ddraUaB9s72R8MWmFzoXL/XZMWGeAQrAgjtq9+QUWf8N\nPMbQ\r\n=mxLt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZUWeYE5DypK5stWyaklhkRGNmgsLLHJ/UU+yYqIYRbgIgRZui8nw7jY8QUei88ghDzPw69C6VxND3tqnauxUMSSE="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.6_1600298258364_0.7019224182743353"},"_hasShrinkwrap":false},"0.0.0-canary.4c67dce.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4c67dce.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4c67dce.0","fusion-plugin-react-redux":"0.0.0-canary.4c67dce.0","fusion-plugin-universal-events":"0.0.0-canary.4c67dce.0","fusion-test-utils":"0.0.0-canary.4c67dce.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4c67dce.0","fusion-plugin-universal-events":"0.0.0-canary.4c67dce.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4c67dce.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4c67dce.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-iCH4B48PetZCeCtvpVH4n4lZBN/8JptqIGDt6uS56T1bNancYj6oqyoF8p1Mowuyh2L4XAbAs+vcdsVUzNy9Bw==","shasum":"8243ae20e6eb53d7a717c05572119868c3fd1efa","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4c67dce.0.tgz","fileCount":11,"unpackedSize":40120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfa7aiCRA9TVsSAnZWagAAngUP/0VjY0XqYAgSnyS8odj0\nuuNwsmvsNP1E7e2+vybIJchHMmXTw0Py6zhiCslHKbfTtbV5d65fhaECKQEl\nYREuIX3PEqlfQ+1B6jTPTcQcx+KRrQu2IjHek4UMcdTBkJVIW6KAM4BDRagn\nWq55q02UGcU/YpDqj7kr90mxVaBuuhkLr5Lc30utY5f52/sow93T4seXvAak\ns911vgPr6kwT+PQJw96dLK5uUspGuXzTQxsws+iC0AZmKxHx5fRm76KmXkHB\nvWPEMj121uPgR6q1atW6O/sS6kXZFFwLGpv9vJGMVb7ODXptMuvRjcU7jZ3V\nRneKSWsGrGvlp+K01lPpXs7fgVS+n9b5gt+pif/As3EGDoB0CS+Wrb99mPVQ\no9rCpcubxzR5QTA71CNtv8PM6Ji+N1Gar2TsSpza/wsVeI/OTiZkw1kiPY0s\n2eUoF1JmJnPKJGx+Im+JmYmQrvHCd9Nu5zoPgRV/4ljJBIV2YHN3XEkAHUnG\nR5t5H7AO/7jdttLf33cMZpYrkkowpz3xmkqVTHTnTLB8qOcqAmrdDR0x5wdJ\nuSMVAYGfXLoQ65IotNnC+zwzEC/Xvmy7Jo5jeZ1ga4+lNrvRaP2gC37eZgxi\nyBKESejYwLeil2YRxWfnnuTirIpZLmx58XpZEfDMLW5VcRXbQ5pFSEUzehvf\nkdVa\r\n=jRX0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzHTS124GudfFUneIoehh+QKpfGyHXQqETQ1DV0cW0qAIhAL/1qxaC1NtUD3JHuD2WAEHHtDTTIibafFW2vNKaS4CT"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4c67dce.0_1600894625697_0.45544409582515644"},"_hasShrinkwrap":false},"0.0.0-canary.4123cce.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4123cce.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4123cce.0","fusion-plugin-react-redux":"0.0.0-canary.4123cce.0","fusion-plugin-universal-events":"0.0.0-canary.4123cce.0","fusion-test-utils":"0.0.0-canary.4123cce.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4123cce.0","fusion-plugin-universal-events":"0.0.0-canary.4123cce.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4123cce.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4123cce.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-F5U/kg62IPO0M8nhLjkW0gPHtClADlD8wv4DUIZStvKTOcmMPRm0vWL4uts/rKBPx+PvjSDk/tMzOTe4vEdeAw==","shasum":"ad32b40227b575d434ee45463e43fd847a72fde7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4123cce.0.tgz","fileCount":11,"unpackedSize":40120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkfICCRA9TVsSAnZWagAAmwoQAJoOF/8WH85tPSp905iM\nTY3LW96o7oTfYMXO9Lcy1qwhORHljf4q7aQwLUor6oo2rhZOuR6aCGFOfGP2\n/mJvDVXbyPWcYYLKxow0JlTYeILK3uEv9O+gO+xAJEpBXKIkk7LyHAXSB/8V\nG30JoE2Q4izpW1SEpwyg/Dnhu5a1Zf2xIlRC1vbXYOtdLDSGOg9dgPp++N/y\nKpDpLHzoPV27KAUGYk4GSwoAOPqg5zxsjsi2czM736Syoymm+xvoLtC9xyEr\n3OF4kCaw+wSiAWlQa5MKbLQuwgm54BimdxFs0mqSlnvxaTQ+Mf6oApc71VJR\nPpvXdSSiXM22F9+JhR+HYUeDcqILb4V6npvaCr4T8O5i6EnOTNRTanuU6uvC\nb7R7jXFAos9UhjN2kWkdZI77+38KMZgTVwNhndmVX+U7d1QNWp3ktPXrF0dT\nBL0k0e+xpwH4QbQH60y5oXbX6i1sHaEGCFcHUP1ngRBqpPH3r9nNoMeLgk6+\n3abHqYZWg1K23SNfBbGHxGl6vJWxKvtSyhrvIFrnwbgVOkewE+VEgk4hgeWA\n+Qx3+3a3N1ZwZbGQIFhj5kB9RBeZ66crrzyq61KXWH9WyGodcJcoZNn1/DAW\nBOcqKVfUUjalI5+QBLMtHrzliCsk1mRnigNus8J20E/9+H2nc97uwXmyR/L2\nZGSA\r\n=/ko8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHQGyNzdpYwm3JjOLE/PnbUPBGVmeO98QBzD4aJhoakAAiAMT9H30IziiFL9XMYPnY68aVuJTCHmUy6IMC/bWvpmSQ=="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4123cce.0_1603400193607_0.4929741587003147"},"_hasShrinkwrap":false},"0.0.0-canary.17e330d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.17e330d.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.17e330d.0","fusion-plugin-react-redux":"0.0.0-canary.17e330d.0","fusion-plugin-universal-events":"0.0.0-canary.17e330d.0","fusion-test-utils":"0.0.0-canary.17e330d.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.17e330d.0","fusion-plugin-universal-events":"0.0.0-canary.17e330d.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.17e330d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.17e330d.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-v5v9j1k37rsEEpgZ0lKICVxKotQ/iOkkjId0DFSkYifZ7lifu7yZc8cGEl61VrJZSjMoxbNeFv/P+cCjQzWesQ==","shasum":"2f74e0c306e5ccd4484395102342a19da0e6bb0e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.17e330d.0.tgz","fileCount":11,"unpackedSize":40120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfl2a0CRA9TVsSAnZWagAAqfEP/jdrrd/jAcOh3iUgz17L\nPUrtZFSgBmi/jfAj4uXG1naD10P9/silXSfekvd90J4o8ALuHuSD4ivUY5OW\nlI5jV+EZi3k8jZE2YgqNvKlxa94KDBzvMj5TUCNlSbrZjzN5ooLt0JkwH3kM\ncejc1byYEEiyK3DMJCKOlf1FFpFz/WvS8ihzY+XY3U7C5iYiBcAQfcWnaoby\nDqITEeAH8r9ta3k+Jp//zQtjvbUrFPs4aV+53euzwTehfVUlrbQ6wfadF2Ij\nNblzb3zT3HjrflyN4js4DK4jY9zaVEy8u5yLYpMoPd3Yb6pbkDA/cgPR8VXc\nyw6mIlyllMI11LFmJTdVh91twWlFbEI5OBEFOTokS/9Ua2DVXiugPZ0yXPk4\nYjCixBUCTAJ9enjYG+IA9Yz2G362pEPid1PESNK/rQeQ+ji+Q1mvt7aZOqD4\nQlhOk0PLDIEN9UW+SCg6WcLcSPNEg8YR0gckvvm1MK6FX+hIklKSuukLUX1D\ntuXSmXRO55BLCV2gZpcsyqw+HbITnOLYnrFsKHrgCLlnYxeCsOIkkFxNxJAs\nPH46Nijx393oyO79JqAATOnLzx93Y2Myk+stYoMe/Pj385gqhcnPvGgWKzTH\ntCNkoc5TiezgaApHECAZF3MaT/2zlgq4PzN56f//6YvBUJZwzz1iZHVX0q5g\nUbuo\r\n=6e6r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwAfso0BiXiuoswYYZivhiTMhzGF3KOUHdl3DtjrOf8wIgOaG6qWs02VzFQFuuiOY7Cp326Ah4CohjnUfQiPBovA0="}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.17e330d.0_1603757747984_0.7407186427919292"},"_hasShrinkwrap":false},"0.0.0-canary.318c08c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.318c08c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.318c08c.0","fusion-plugin-react-redux":"0.0.0-canary.318c08c.0","fusion-plugin-universal-events":"0.0.0-canary.318c08c.0","fusion-test-utils":"0.0.0-canary.318c08c.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.318c08c.0","fusion-plugin-universal-events":"0.0.0-canary.318c08c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.318c08c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.318c08c.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-zoTMReQsOW+0IaHOqqz284kRdtAuDYJGd2QZxxv2frSFvLxf2hyJYheQEyGXXnIUF36QNQchSek5g/+h6i9oQg==","shasum":"28e1266f59fcbb02da5d16c483c8d4ba93dea33c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.318c08c.0.tgz","fileCount":11,"unpackedSize":40120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfnEmKCRA9TVsSAnZWagAASpMP/jkyGUFh+kZ6YnO6+kar\n8IKchO1/pw0oXUrZ++P/Fcm2zeC5qmnWa+sDtYigDAFouuMpLbfM1zvc7CVU\nmhPedBg6qZ0BeoFZSGze+/lkRsfO6YILuwnTEalhSWZ8Gi1DV74KxVcqod24\nR2stwB4VlbUPiRaa9PW70/vBN9QKiNvF89mYfh2130O1fc864RipuCMuE10s\nMT4Ect9RVR86BQ7f6rT4F1M9487q8VmeKVdPlt/YEtEWtB6TpokbFSdUwDmA\nvuizv7Zy2qX4ZikZEjo/2N+rELxpnPRRFLbuRR54DDuu2Xl79TZAD8Tq+iYW\nw/9z4zxYgWnIQampwM314kzcZxPvyKIoQ1ddeNMTchuU8QmdaJRnxUGGmegR\nPbEPdZikWKgB9/REL5dcKD+jZ4eTQLWML1eZhPKXTnqyDABPioRZ+O0XZakS\n50uHdcU2rdU2UJFvXVMgtNNcKYzigkRKsXZdOKGaZ3bxK2i37IHmq4lt+mp/\nGndZf+Sj5TyTvbkWQ34kAT2ZK1T0uxwfRVPASfhFpFlCKhMvcAJ2fXGkHXoE\nWVr1PB0cqO8e6C6y5+74I8VwMEcm70MLz68Ab9Os0H1vQsFQgkh+Tt6wu8pb\nO/XaSJ0B9XuvOjSlsIKSMlqehgbxV+PAyhwLph0uoQcRsZRv9pvjEaPIe9dx\nk7Ob\r\n=pIZj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD06e8Kc7oKA5uvrK9y7xXS2U519Z44k24yE2/qM/7rEwIhAJUsoY3Zh2TD11Jdt+/Si7JNw3spcn4YfgJ+Uen4Aka3"}]},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.318c08c.0_1604077962165_0.27815210545816815"},"_hasShrinkwrap":false},"0.0.0-canary.e74b783.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e74b783.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.e74b783.0","fusion-plugin-react-redux":"0.0.0-canary.e74b783.0","fusion-plugin-universal-events":"0.0.0-canary.e74b783.0","fusion-test-utils":"0.0.0-canary.e74b783.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.e74b783.0","fusion-plugin-universal-events":"0.0.0-canary.e74b783.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e74b783.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e74b783.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-7TR0mZN9yujgS+YI1KHnoqM/aaSLN7rGHPcHGMIgk4ZVMl+MhE8xCSXhBXSW4aF+/wpl/w4xEMBflBfp1QFrbA==","shasum":"717ad5ecedaf7ff0fc4268373c91e7fbc8937701","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e74b783.0.tgz","fileCount":11,"unpackedSize":40120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfovs1CRA9TVsSAnZWagAA2l0QAKG89dlcLqGusrTLDIsf\nxWgzKUL6i42Xt2qBEojjhSGpK2FKA0tieJBxpPKlpmyMsCknR+6pdo7tzO7J\nw5OLaopbP0/lgV5Xffqb6jQnjmS9fDXU37aUrSh6jTMLNQaJOMF6H3/bmcDP\n2uIElfz3b4iVDwwQ5xaNNIb0H3b/97WGNtXlMj9RWfJoTTBJcmowyo4+/sw2\ngMIl1AiuAy0fTArGGdNkBxigqvNxFtbHLwaz9vu5LO9p2UdMUzUhNBPphhGG\nWlh5pKCVBUhbunQTLaZsYGa+N/ztPIp34sRqDhkimomtq0YHmXJZKkXY+VPM\nYRi+xs+6RHps8Vuj0H6DPiFZJ/AVWqvUzxrEknA/3ktb+pDUQyq0qO6TUBAQ\nBS9mj25UlHRJI7eSFJFBuUSo4ruVENUGnDWU/F4VvHIcnW3USmePc9TQn86I\nmuhnbDQppxbEktQfn2/ruWxmfEco3KrPUXcEFrNTw+ynxXf7RMBpK+dxa1zO\n7XhnGXzOM+uuNVmmyYnCSWyChW/3peQC2Ch2OUn2uu4l7DPBSALFjkNo27on\nu1NM1raW+Y9cunz9aitxS/PfnsikpqfGeG4/r49sS0vA+hzP1cvgZMljpFzY\ntZkwKjcxVwxo0Y0uCJwG6ISRTM1kQSN7Za8DnSkoXOeen2qeEtr3Ib3y2nbi\nyl3e\r\n=rZOJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDonay3raokCKgf89TG4AnqIfkkxR1V1ETGuE3fGsA0zQIhAM6QOV8STx2/xsZsjz29APYjE0zddyBAvOGjrMpzfy42"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e74b783.0_1604516660808_0.145222410667033"},"_hasShrinkwrap":false},"0.0.0-canary.a33a9c8.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a33a9c8.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.a33a9c8.0","fusion-plugin-react-redux":"0.0.0-canary.a33a9c8.0","fusion-plugin-universal-events":"0.0.0-canary.a33a9c8.0","fusion-test-utils":"0.0.0-canary.a33a9c8.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.a33a9c8.0","fusion-plugin-universal-events":"0.0.0-canary.a33a9c8.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a33a9c8.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a33a9c8.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-x7ZWqeB5vYWY+BQE6IhAvtl1eVaVezxLWqNyozR6/EKEh+iI5UpCT46g7u4xx+OxiXYCBow0sh6G4sRkiGT3dA==","shasum":"b6f183306a77df7e3abcea4dcd5e7602648575a2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a33a9c8.0.tgz","fileCount":11,"unpackedSize":40120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpar2CRA9TVsSAnZWagAAn7QQAJZLQEvMxTw7JTYCRums\nGW46XJDN4h5kjuM2hBk9sWB7I8168ZeTPnczoq4aMuu/OEunaL+/038gD4Ba\ncB86VXBP2byqXolHO0xd5hjLj9kMnECCZuUW1hMDEMnaJ/+2ArJI6nQFIlPo\n9hm2TJXW52vRRi04G3Ebx2Du+w+PIA4iyGHek6lkJsHiGzxdB6alMHEPCK9B\nMbzCuGqrTq9ms4spjXA+Bkxk49pjLSJItuNISX7XmrOMgZ7G2Q2YmeUL+Z8H\nyRTVI2VPVYHdsW0vRbv6xMPb1LAEeF+MtLhJIkVGBql369swMKFFh6OrXEFJ\nBO+mwbKxeskW1DvbRUEVpsiAUQpExqtFyQCfmq399+lq0oVuA30/13z4TWsU\naMbzxdqQQkLT9HDw4eLCGIJXediuxPoMUGJfvalJoTnQYNBrumNRnnyOjt3j\nPpMAEpEHcSvkYEvu+ppD7jr0B/wjtI3q1LOFMqJXqkK3L2+JcQisNKK4IAh3\nBHdawm715b8uhoEeYrXzuiagURMDESEkaiDm9cITAlB31PIlnwgr49DPkvpL\ncGYXAY3CS+SBcJrQQvqulb2Zx15pDff7SDLswauJrs9qTIQTdhYl4j7RN/YX\n0+ydr/nVKdGgiT4xASSyAVTpuGx0v2ge4xk0RUsU9SZjg9SHhjTYGeAv4nVK\nABKx\r\n=50AB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICX1EhJmYDw5mZv0UTCh66ap4js3iNtK9GKRfBbLTN00AiEAs634zuoUPIGPtEXfP7DUdqjnzW0vZmt+rRrQ5mAvqGU="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a33a9c8.0_1604692726105_0.8826563320538203"},"_hasShrinkwrap":false},"0.0.0-canary.5a2a7a7.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5a2a7a7.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.5a2a7a7.0","fusion-plugin-react-redux":"0.0.0-canary.5a2a7a7.0","fusion-plugin-universal-events":"0.0.0-canary.5a2a7a7.0","fusion-test-utils":"0.0.0-canary.5a2a7a7.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.5a2a7a7.0","fusion-plugin-universal-events":"0.0.0-canary.5a2a7a7.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5a2a7a7.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5a2a7a7.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-d/I2D2ZLsyC1Bl5ngFqNINa/JEZ8w49LNS0QkfOM2p+pLPmKKRYaMdX+cwhx5hNyJUA3CXuWZhdt8mLdHZuSqg==","shasum":"b3d3bfc63b9c1714bce65dafd033ffb6a76aaf13","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5a2a7a7.0.tgz","fileCount":11,"unpackedSize":40120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpeTICRA9TVsSAnZWagAA2ukP/iOxxJ+U4J/HGiRdfROV\nXdBvGary5oW2UYtUQAhHQEEvOu3Qg2YXcFSircFCCyPBTxZgrbihnprqXCKU\nA50gE5LZTGuxKgjAx8tyW4Y9IVEXHHOTFSSGTRxZVdzcKpA7UlolkaXna+n6\no3Lkb+o8T1rS46j45C/NU2gW5f3D+K2vEJoVpHhEiL5j5OmYqh9nrl4QF9gb\njNPzO03bVVBGrTcjYJrMNZmpV+8nQb7jI67nx6LC1TRwYicLQ6hsCDO2tm5a\nTPqomJ0pn+1CRdtUJq7i8MIPxJ67igLznRA2npiIwJJS4u67+y+9Dw0GptSy\nuz6LANECBpu3kdOp2K2XfbK0kwdp5MLrI+luHr2s5342TauWKbPKKQr5cci7\nZm01GYaH/Wm+wcQro++qHbr8/V6xq+HT1hLU+2hqYqYwI9rGi6ZCpffk3szH\nv4TntukDoy0Z7oJ3F7odsGfaF3Xm7ogKQPgMpKMvi4S6IK4seRHf7WHEoiGN\npSzjfYgANiPq2SnF/gleedHlRPMFFw4f1z0JtTJiTRu1+YiC6oQOnstbnJLJ\ns0i4IrxPOluCsJfvnFFzFnCC4CPYh47LSNQPh9PXPnV90JVzG5ttU81Mpuu+\nr3Lgb3bMfYXy3/ct4cMDU/wwonN3ldQ7NslzteUNePEXaKHVzAnw/Oq+ROll\n3LD9\r\n=IpZV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsy7rOB4FYE0niZ3/UXbWASHVZ6Qudns1/PjbGJ41U1AiEAhkWefNPtXNqqwUFY8aCflp1BM7k71/5hhzmLXmUxdCw="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5a2a7a7.0_1604707527930_0.9576613185025493"},"_hasShrinkwrap":false},"0.0.0-canary.77061d0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.77061d0.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.77061d0.0","fusion-plugin-react-redux":"0.0.0-canary.77061d0.0","fusion-plugin-universal-events":"0.0.0-canary.77061d0.0","fusion-test-utils":"0.0.0-canary.77061d0.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.77061d0.0","fusion-plugin-universal-events":"0.0.0-canary.77061d0.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.77061d0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.77061d0.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-8dBEYo2OG3+A0XheZZ8twqJTwwhGDFjeY81SwsMtmitsMmMVCKuHrBZhrFr+WMfAu2oM/M1RwXZWWhKE8E+vKA==","shasum":"c93815c6a04abfff8613299d9f9d3c4ce339b1ea","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.77061d0.0.tgz","fileCount":11,"unpackedSize":40120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqZLqCRA9TVsSAnZWagAAPKQP/1PCX5wg8F/1cxMA/zLI\nzWzgtcqCDuUqwWTczcmeTeMRMfFGUgldkkCuP9V0PUREjl3GtA5/AwRLwTKZ\nbpCLTBB5Qqep9klpdw1K6FIiMEq5l0sC9T/SBfS9AYWMOQPj25t/wvW7mA6Q\nlA2x3nyuXjWXmunUlgSrjCbReU8gpJEO2BqasnLam5ROybBcmcFp1fdsbhld\nuOJfmSafYrt7RNhA0U781H/hmTMI2SHtZkGsL4kaqFYe27FX3EyabXxXjJq2\nvPA+ozW8tcZ/B7AGLO3mm6Y8qPGuEdiotG0chN8Z8uQGfBpWC327/G96K/bB\nEvxmCn+KeFmZANhJs3rxmDtji8sJ5KS8QqYMZnnl5YvYrwqyszF/DZQKklcq\ngkAOCqgMNQYEjaArEC0wC3de4wO8TpPxcOPP85ozmk5q0vJKTdzRY4nS7rJO\nTZBPd4LGsCQ6g3F1rAHhrA6vs/SmFLDRMKMRzYmiHE1YcvleVSbb7I5h0dAf\n5ptrGSYQtf3U5uxR6G2zMlHj4slalTg1CK3k1GCCIpSvu9Ufg5QmVx2XFPC7\nvFiG+W6tvs7SEwsyx+TxAAea3bN1fG8rq7q7xnGolDUP6d309yWC5Dh57/NP\nZUlfH0lipu2krtrajkTi7UD/M12k/5IN2mjrH2n52tc03Xi8SV1rS5inbQpL\nil6v\r\n=g1n4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9zpYQT/v1Fw8zGuBkAv2K89GrEwv2U3ZceMJxO9DM7AiEA4BBzyv15wAnqMRf6HaQWFZTiG0MYOXbAsDzLKhjHMOQ="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.77061d0.0_1604948713755_0.37558263530710656"},"_hasShrinkwrap":false},"0.0.0-canary.89ca12c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.89ca12c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.89ca12c.0","fusion-plugin-react-redux":"0.0.0-canary.89ca12c.0","fusion-plugin-universal-events":"0.0.0-canary.89ca12c.0","fusion-test-utils":"0.0.0-canary.89ca12c.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.89ca12c.0","fusion-plugin-universal-events":"0.0.0-canary.89ca12c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.89ca12c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.89ca12c.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-SC7VruoeBHSmfugyzM+eqMKOBzQzAAA9jf92+y7eON47sUjUAvD+rEoFWC9/vHQPDOSwjaVofPkvIEPu6yzuhQ==","shasum":"540187c9940a7a214c9e63a7afac40f1a18f3976","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.89ca12c.0.tgz","fileCount":11,"unpackedSize":40120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqu2UCRA9TVsSAnZWagAAuOEP/1HKj2WlXM6OBxH8BASO\n/GwvnWLQNuiP8odQS554UijURxxjvtaW5/pQpNdMpfCncJUzMAsVoRrNhMOA\nj1fHtr26uPryvMYltzTWGShsrPtIj/GZwqJPFpLUU6jpmdym+2NUjYe6fuTu\nZJUG3EOjTRK3Jg/TFQha2exbF48sbomMymRwRQn8I/yWI3XzCKDeeqTBOFig\nMBHn7LZeOQlodsBgjz90ntdW9KoYk3R92me0pDHIWvkMjQDJunKoDK3fbg6W\nF5LYUaejm4zAzO9CAtUZbfQicHjG6GM1YFcMRuiXvbd8VowCl0D0Cdn/25ZU\nIgq0964VvrYrR1UPuo9dSLe6/1cTOZiIHwxY9Vq1XhT/4cNXiDVpdLvaf4vu\nG08iDOjRSu+CpkA7qV15vujOgRrZq4jw+zW8U0F3TmxwpOIsETbVWTFCUjUZ\nAYxOIFF04Xh9HoCuUGE5awXpS/lAf3iXCtFUOUDzT+rTkFt7cO8bfgyfoCgt\nEVx7lwrR1J/S5Yl37ZfRemze6HjHu3PhMMYiIo2ctuswoO2ztr2stsdp6FRJ\nY6JGGmdPOL2OuK/g0593RmBThC1GAevUvNrQaTiv9Pkh0zTNXbl4CxnN/AXS\nNeZIBQKbRaaMaPqFRwjMc6urgN+it0iQ3aEDdv26wg9WyfU7frUjNISWYD0s\nfAro\r\n=yv/t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfuRH3eHLO3JK0oScIf6NHdZSWhzO1veZ8k1BnMVDiFAiEA5+yihV0G1V8JXzTRg/o/Lchfi6YAkM1AoRA7GsNEbsg="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.89ca12c.0_1605037459535_0.082655915918185"},"_hasShrinkwrap":false},"3.1.7":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.7","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"2.2.4","fusion-plugin-react-redux":"2.2.2","fusion-plugin-universal-events":"2.1.7","fusion-test-utils":"2.1.5","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.2.4","fusion-plugin-universal-events":"2.1.7"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.7.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.7","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-2LZZCMh5kvMCPNdHMW0jVAsDGY7lgwCG5lcNWFfqHF+OPZ2SR40yeJkAi3Q4TRbB7mdxP38e/SsoCw1LB7hDBA==","shasum":"64b2e83d70b5e8ce352baa01cc9bae91f5851b7f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.7.tgz","fileCount":11,"unpackedSize":40001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrtrQCRA9TVsSAnZWagAAx84QAJmLRDWSrE45aZKpdlAE\naQ3hsZa3auc+h2L+EM4864ROLR492Sw8meuL6olmobvgPWo5cQRihtoTcAmJ\nUTMTp0ay+WYTw40IJ9RS1BRPynA7JAMOU5BpkY/AVtxPveDODl/8h4LKRHRs\neteqOrjKi+0N/TM/iN4J9s8ZvQo8Ih1ekyUuV3uG32oYJnrpouoEssWlzYev\nvPPbxMAuyaux+xzAnU5qODxtbWS+ohfmM12boJS/fTsiNYZV1jLDVfEnUeDR\nZjjyE549lqigoBaBMWxDae3M+5wRFTdt/RodLUVZARWdaMBGAVpc6S4Oqgw+\nTmXtyL5tK2F6wvpYO5HNea6wb8oaFbOML9ilcOcO8r3B9c5a3qcOXtRjTp5i\nLpT80qYS6lGf0iRIxmbwQxWWsAlbMy59fQLBfmPLG8XnVxY4Og/mHSmgGrd4\nYZsrOsEtK/CjBL1lCt08RxGfkvH6EAyra2YxfNLbeBB7+0THJ8UZdnYjLugb\n8vbPn1Qc8hlj851lTnjt5nZ7y17PUHWbUTk745pBjtzocY5EKASSnEJCit8b\nfBBcOtkp1WnikeVgxrFL9cMX0BvEZaQe09/v+4Ow8WKOCBQ+mbglXgRxVWdr\n7kd64k3Oc1PCvR+WptZL33VxGPOjnsz6HxYo0cfC3GvDtkez/jvIqhSBcoCB\n7eUF\r\n=0IJk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1a6uKjuga7OK128aRlt6vCkz3PyxQdr2TFOtQWHmYDgIgf1pjyviJ3cUzdPtkhOAPtTPyTJqE5XRdWJUKEEkDH/I="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.7_1605294800283_0.2285966809081894"},"_hasShrinkwrap":false},"0.0.0-canary.770d485.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.770d485.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.770d485.0","fusion-plugin-react-redux":"0.0.0-canary.770d485.0","fusion-plugin-universal-events":"0.0.0-canary.770d485.0","fusion-test-utils":"0.0.0-canary.770d485.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.770d485.0","fusion-plugin-universal-events":"0.0.0-canary.770d485.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.770d485.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.770d485.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-2hQlqDRDZ4VPGw7JBgzl1U4Lx3SMdNRISLT8GTBeDi+2SHiVtoGs0IrGDrL/UWRxlOfofYW+PJoerv3XDxEk6Q==","shasum":"baf2426703ab2c9dfbe9c908233641429d7bef84","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.770d485.0.tgz","fileCount":11,"unpackedSize":40120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfrvlfCRA9TVsSAnZWagAA7ysP/AsISjUv4aoT3YAlVIDn\ncEv21DmWiuirFpoms6LPXnGf60WTkqAM3PhO8D5u0FFw1SEanyyKd6wsmFTK\n837eaatbzFCutlnGmVcZQ/tfKKNWPn2CNCNwXMLGLnKWkepZXoFfJekLfIRY\nFpyZf8LeAVh7itWA/zeR+Q2uhoodAZBIkbzzeLDidubY7Eb2nP9k/7oHLu+v\nmIwoq84yTzm/Y+fmWCcWtCbY86lv6zMXH+9gMfx7y27KeS7BxA6thdbx+Wfm\nKlA2bHNg/1Na39J+TnyrgiGPHVaWEPM0hiYifUNznfnwy2Ix4l0ZcVvTNcoe\n6piWG+x6UcO5hOF5iMZwa7uf1I7XUzC/yoFObnDejNoO4Lu2J2A/BfjEIfgS\n/K+g5OZT7d3e7nR2RY88wp8IyzCa8Z4JWImM/5FrIljCLUXNY5btXV/lfc0+\nQVfrYArgH6w5ro6ck5Rtz89nzk72aY5PZs/TFTo9XVz8NnJ5XzNSR0MwgGvZ\nSeacHVdOL9Twe2XBpsHqDc/mZlEP6MYwOnl9tYgqz9TGimpyPDxx1kUdDUgW\nH5t/lam+nG5E/tOZ535c4WgHsEMajSw5GQe2xyD4Xx9WD7Vn+tFuYbUyQ8JZ\nYwZRD0TunOWKyeW1uJlSOKMuNeB1B5JtOdIgoSWUPz/4bkIPcAZcJuXgE4Rq\nTByc\r\n=hOD0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjZ/S04JGqk+JqHNan6QPefb2SBjOTXk3ch9JhjiwBVAIhAIFPA0xwrc+JdnnM7gQtN9aUXc4kA0LQhIjcjExuZvBi"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.770d485.0_1605302623041_0.6347241894781925"},"_hasShrinkwrap":false},"0.0.0-canary.6d664ad.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.6d664ad.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/plugin-proposal-class-properties":"^7.8.3","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.6d664ad.0","fusion-plugin-react-redux":"0.0.0-canary.6d664ad.0","fusion-plugin-universal-events":"0.0.0-canary.6d664ad.0","fusion-test-utils":"0.0.0-canary.6d664ad.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.6d664ad.0","fusion-plugin-universal-events":"0.0.0-canary.6d664ad.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.6d664ad.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.6d664ad.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-FFJ/YU2in4/sDphayOgqQkepOoXPVSYX6fLxpamMYxdt7hy6mTYg41C665NhBIRxk1HPDBr3ONGRfUPQcuXwpw==","shasum":"f43dd647560d62d5d8deb7d061fc7acc6ad46de7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.6d664ad.0.tgz","fileCount":11,"unpackedSize":40305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2o78CRA9TVsSAnZWagAA44EP/0jkj6aIi1DeZN2wdXbf\nqghSEc1l8GR+snx9pT0TVzfO5KAr2NrpHn2ZTbiqLSlslB/xstuf9DOY8Jno\nPu8T5368WdKt7V5PqYr74ckhuDyyIyBbCKEQWT3k7oqSXmZcAwclpJ9fJgG2\ngBht3riKv03U4LWiFe0pN+z8cgo1Ey0uj8BOpAqLMqtiLmQNMZXR2PrUHkJl\nQCW88/vTURangFDXgqRZJ0KX68K8kLcMwQ7oTxD4euaV2LP4EU9ypzV8rb6c\n1Xm/+vXhszoxHLKbcN+XGFDKRHKxWuoc7db8fqolPOYQRYKvO7oCuB+cRrVE\ns4/n6MMP2n5OU6QngLob8H7KBUiTPpGOMO/E7Zk1Nveeo51VBNZ5k5NBAOv2\nc7Ntd45ahnho0qg+XkcV/hWCk4caqnaBAAC/u94+F+7T4WR7ZgW6y2aGerYf\nm1RHUCWPtlv3YOxgv3kXmvOO5GDgi82oEWIf0O+RhXj5XoIkQ8LD1EsY9B2l\nIw7CMQrWWUUSzUqZONfPYMenk1QGd6YRfwuOVxaTEhmXMUU9rThm0t5bp/Qv\niT7bXLrHJnRR0DcpiDYfpp9pQc8wnJbgLJz/YMRgTh6Oh8yxhG3chnFBOwK8\njANFMOogtbzIGNDAgsW4OEV9APugUTBBfsPkbRg22wfqJweQaUH+AbUVZO1R\nNf7J\r\n=fK9h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDJnDa2k9KOssmwIR0uGYoZEMNALizuf7NN7LrzZSIa9AiEA4lklkwT1j8RkPw178AU3pivKO+4Q8un43wXNAirO+90="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.6d664ad.0_1608158971844_0.04928528990371417"},"_hasShrinkwrap":false},"0.0.0-canary.579111b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.579111b.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/plugin-proposal-class-properties":"^7.8.3","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.579111b.0","fusion-plugin-react-redux":"0.0.0-canary.579111b.0","fusion-plugin-universal-events":"0.0.0-canary.579111b.0","fusion-test-utils":"0.0.0-canary.579111b.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.579111b.0","fusion-plugin-universal-events":"0.0.0-canary.579111b.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.579111b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.579111b.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-cOemVhgpDaYQbc2BNo1Mc6aSQi0Xa+df2f8T+PSX2/zC8AG4ceJ8EclUtnk8BxltWuO6+YqTHpBKnfWlxUYxWw==","shasum":"f935bc34e2ea9596f925bcb5ecd741009df6ca8e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.579111b.0.tgz","fileCount":11,"unpackedSize":40305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2swUCRA9TVsSAnZWagAAxuIP/0fopesahATWs1ojeeNG\nZa7mLvCvhjxylAX4ussAvcvLMkceTTHYZre96CnYpIxeHI9go20krthgldeo\niNhmVAknkihBOhFDXAvC3zS0AcseiK/U18grKTU4sGBeTyVMQr8FSUw22PD1\nySqY34ZIVHtiMmB/AY2rRZEIGl38o0GnaZlkr92HubXDnSJfvT/A0J/hApJN\nBP7pMrhNgNzs+VNeOCE93ygNJJ1HK0yuTmhLwHEC/ShgCFLvcGscLb1t+RQD\nVoYRT4D5KamJvzPnKVjtwFeHi0gXGBgYslTwcmIE8i8gNG+OcbNroznZ/dXJ\nMHKDJmhFKxq+ncpD/o3gX0ttVpe8WxbiRPimlmkHXOpzQXyWti54pjxMsecB\nlv18y8xIeaLzlTAjXbpXwK+6aA01saf/9D2SlUzREqyogfgB5RdwDXGSFb8A\niOi63JlEutKlWfBI7Hw9qK7Dyei7F9P8gZ9o3wbktrNCAJPlj3mCt4fvaUCl\njJUawemtWVVBNIKw3iGUK7WmnhGGDZZ1S3t7Aul+cbGtJ+IB2JbnjEi2b9LP\nJdn7sG11emZqnlEGFH0xo179OrCiDPn0D2TJT0nmoXTTtdOFutwLBQ3oQdHp\nw2vwzrvmRkIYk07bghCSRrZvkujlMyT2OI+ZPqw4ZB2p+O5yak5/5nIs2aYI\nc/ZF\r\n=9qRw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAKnbP+bItbNTNmRRarelGs1JonHGDJF9c1ArIGnfLxGAiBnU1z5qQmma2dfJ/hKb31sjAXslauzFE4euplTgqqV2A=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.579111b.0_1608174611710_0.7998109355192942"},"_hasShrinkwrap":false},"0.0.0-canary.2eb76df.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2eb76df.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/plugin-proposal-class-properties":"^7.8.3","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2eb76df.0","fusion-plugin-react-redux":"0.0.0-canary.2eb76df.0","fusion-plugin-universal-events":"0.0.0-canary.2eb76df.0","fusion-test-utils":"0.0.0-canary.2eb76df.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.2eb76df.0","fusion-plugin-universal-events":"0.0.0-canary.2eb76df.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2eb76df.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2eb76df.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-LTn7jGe3GRccgl+5s85cs54fWZJ9eS0HCdVImZyuBTOTJ8731V20vZvutyT8680wX/wL2o4adsqIj5dVy2wu4w==","shasum":"16ea5c0344a2e8968e5a28dc95293864f8c41b0c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2eb76df.0.tgz","fileCount":11,"unpackedSize":40305,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2tVPCRA9TVsSAnZWagAAeJMP/RmJXrbSX2K0b+3foltO\n9v4B6enFB46XOSIBMAkIrUaaXEu4CIzLsTFmVSIUihrFnDptewqEfHiopT0a\nA+5gYvIBChAbTNflTeV/5yP3/FBwFkq2s0krYNgNtrkQW0KE+iQvfS0q8e9G\nQro6LdXOLv+046DuqjuNnw8I9bO2a6SQ8aQSeZD0FYITNp1Zr84xVoYUKfAk\nGKU44vqr3L0LP+pi8b87I3OuTYfH51oyyP2x4l20xkrD/GE0Y3zQOacWj+lz\nLW7zWF7bIdLDLcUg2us9vEpA92o4d09PiyBnx6OvK9RwoNRvfbhRsbrGhj0R\n772f3U1WmOuJLPWwEtBwlwMNdIVQEaNizbvaMFv0X7iysHD1p2F8bmbL15s9\nsypL6LD35Ps12ywhCEGNagIF50UjvJvalvIr0PQEAtsLv7uPkJnAeVUvleSc\nYcgZpFJ+edAwkq6kHGKweLHDPyUV2AT9rx0TVvrHFsrObwipZsUid8zc4Hs5\n0ToBwpoSIqN71fW/9VyUWyYg4UMqjhmba9M4bOirXAAFFinGU6mIpRI+MXi6\nlvTlKIBHQCqx+l8qUpr7IW2R8htUgfya4/i24/0rVTBW3zq/FaI3Rp4w/Wo/\nVgN22JRd+tMGmO7FL5JmfOTd5mDVayv7p1AK34BNmbHePrj8BRa/Npsa99Rw\n2PdQ\r\n=t0/F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBtKaGj06Eepm0z7WX8GXNNKbc8e3nZpLPaK/VWOdXfxAiBH6LIrh08FWlZjDpxKeSVRUMcpTIuxBIKf2n1uLeV9Gw=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2eb76df.0_1608176975276_0.05631755117908255"},"_hasShrinkwrap":false},"3.1.8":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.8","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/plugin-proposal-class-properties":"^7.8.3","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.2","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"2.2.5","fusion-plugin-react-redux":"2.2.3","fusion-plugin-universal-events":"2.1.8","fusion-test-utils":"2.1.6","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.2.5","fusion-plugin-universal-events":"2.1.8"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.8.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.8","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-hnqt3ktaZHWVqr/xnAi98gHSQzI8zjx2MoKoIXQpd+/l5exTeecP3XNRRqOtPh+5MpEQKxz0zGEs8eA9FHvavw==","shasum":"10edbcc3ddeb7a3994da9c75e71da6036263c468","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.8.tgz","fileCount":11,"unpackedSize":40186,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf89fPCRA9TVsSAnZWagAAMbUP/i0H0RV2VOC2Zd3tjmgM\na6bV36CkFygzca7dDOWOW/r5NEuDl0OpFQBBMiZWFICMbAnykqIMDDj/lrkJ\ncKv6PbOwAtDWgZdDfXIgFHdaMn19h/AVwTEbRp/2ycbu3lMim4wzbPSnh4PV\nivCtoPHLiPFbsZApNLmdZkl4ZBO23Rimylqrre3RZv4NhDz+hlgbcwZQknXb\n2t1/TF1KInsNZyhTaVLr2bUpff7Ga3YTTV1bfBbRYlybFdyWbnXGjgEwsO3T\nMJ7DeHo0XUf7n2DZcdGEBHP9cnra9zJsGrEVj1IDNgrVRsMQGEwzE59KIvBa\niMUrCfa5WsjS8eGFhEvv0rR7CMfIRxhtqsBpJEeMKY9jOe/kzvQeSU3DQsPC\nuL605BezLHTcdrPxq9y7HaGiwshGpT+JJwQlsQPAnSVeN2dqBbYnfiuhwx2x\nu1nSDAUVlvmhr87eAVi/nlU/o/eRuGf9AH/mkNhRylxCZtlNJhR3CGlA0j4w\ng/sKWmZ8KIuRkFP4CtyrF2V7BH5OYkKHre0fT+qa24innGNOFc6DLqxI1BNn\nK6YLk0W32wM9Tf8ByQjr72msuN2LLe5hc4F1xDOSOBg63cuvKHXqN036PMQ8\nCCXLZumUmOtaevIQ/5wKI2NP+nDZ8qd4c6qxH2zq7ZUQGPXm2cvUVwq5iBrt\nz9zW\r\n=BUMu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuiDxy3cVmmVZn3o+7/kggRRPpnUD9qXjWh5XTCwi6xwIgMKzcdN/yXFrkDUze2ojmNR/IGUYCn57FJQQZnxIfRhQ="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.8_1609816015221_0.26513501012545926"},"_hasShrinkwrap":false},"0.0.0-canary.4cee1e1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4cee1e1.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/plugin-proposal-class-properties":"^7.8.3","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.4cee1e1.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4cee1e1.0","fusion-plugin-react-redux":"0.0.0-canary.4cee1e1.0","fusion-plugin-universal-events":"0.0.0-canary.4cee1e1.0","fusion-test-utils":"0.0.0-canary.4cee1e1.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4cee1e1.0","fusion-plugin-universal-events":"0.0.0-canary.4cee1e1.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"build":"npm run clean && cup-build","clean":"cup-clean","flow":"flow","lint":"eslint .","prepublish":"npm run build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4cee1e1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4cee1e1.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-OF0KWZ67wsD01bZO8a6mQJX6IAAYzKAvQJF53aR2iJet7sOFxbIpefSYaCkQwACIkLy7IVslTrLh+SjR6XC4Xg==","shasum":"9ee55ea16f52c25b148c67970d7ffd033b1b726d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4cee1e1.0.tgz","fileCount":11,"unpackedSize":40322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9N4QCRA9TVsSAnZWagAAbloP/3n9VqdzOwD5Xfzfw+DN\nIQdOR0GlrOEF8e4wlZFYszmOJVghSseqUZYhU0dkoUtwSawBvYGCkIYkMjRc\nnnVEf2L1MbiKkLt27E+jT7o/ciqH6jjcFmc2xtaCOVgQVG0qpEzvyTgt1H1u\nKZSG1BxL9wzKe24ts8PfDOud8D+vZr2Jr3dK65iJFNcQZ3Pv+1kp3HyFXXy/\n1vKkxd8OaZayUOAHtrvmwzBrn/1L8+5PMIJJjITt1CgiikpP+/bCoEkJGxDj\n9WkWTHvO4NH7cof5r6RfSnccaQgI/NV6T5qLeTdKnKJJ6kKff1k7L/ezHUx7\nZs/2iqgXqUmVYIxNN2Yn+rjZFzgylXhqBdnNRZY08t7/pcbwiSX3wkqonWvi\nfkjNDOpeygQzhbRT2I5Xz5xif8l6/ximYej1B2Kg8X63KOpNE8JEthhrgBvk\nu+ZZQy0RMWwkUk90AZakQ3ATu/QTlrKh3L6hLwWIb2GCI25jjXjkeDg7fua0\n+36vR/Frsj7JRjHy6ewGuCjQHnyz1Hlplk3J2F7VPRGA8O1e8e7RjBxU/MOh\n2V/fA3sn0dwikMkGXLxLdBUaGj40hjtrh7g+FX8XlRLhAOCYGOxNgdMghaHM\n9Un+RbsLn+J89r4AYzBwUwYWaRKeXUuMQXVMiNDdRGTzumC/wQYeQO5lpye+\nU//U\r\n=EjCD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDK/+tQOXncDZKCFm2MwBsl37Ouzbc3gyJ6jqjkQ4WHnwIhALOh4a1xGWTAv7fHKceS8cUFP6qvr/50eeNc8yV1WFx8"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4cee1e1.0_1609883152559_0.9116423911047473"},"_hasShrinkwrap":false},"0.0.0-canary.b936566.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b936566.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.b936566.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b936566.0","fusion-plugin-react-redux":"0.0.0-canary.b936566.0","fusion-plugin-universal-events":"0.0.0-canary.b936566.0","fusion-test-utils":"0.0.0-canary.b936566.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.b936566.0","fusion-plugin-universal-events":"0.0.0-canary.b936566.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b936566.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b936566.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kMclmgwkk4wsoYUIFAABWFM9gkp6jv3a7iOapjPtx4EASsQERH/syPF4SLC4uC96rvyQHk07Y0ncpnAUnKO8WQ==","shasum":"e13ff78fae664d30745bfa0ec20a5c65b4067d62","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b936566.0.tgz","fileCount":11,"unpackedSize":40440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCI+XCRA9TVsSAnZWagAAOuwP/003csTSqcoVsV6vjxfr\nx3VEfEUe/GS6N+qf+1e2wT5TK/z3e4EKECil376bX/acWiK5+rDGI+Hiwkp6\nlDuEMSUuu4EmV2khDwYUacY7/QVGUbSLMJKNGdtwmEP40XjJyxbd0ccw+d4l\ndMrBrZ4WDHPWoVlupk7t8juWef6WL5bkzRUa0gEWzETLfyj0o4a8W8LaWaRw\nCN4sW1fr4FFqMTK3d8y3hGDXSSsBgkzk+9uMwvDM1zicfnAc32Ek282elHFf\naOYijIjN6KLZ1sGDsF9t8IE/ukVegGD3+eRupZ7j0kWOD8ldbBxOk1eLb6QL\nh+lKgOXw9YR6OWj+8iRieppqIQoyaNiBB9I03kTeZnHHS5BgKYUXZmd/zMx0\nquC5tXB6OO4IskQTXLQJIfhDO+kxMi8IbfPxMDW6iq1nx3oYD19L5LUVMwNc\n8FLC1F8JKJbOpqwTrnvcic2gH5Wc+whlVqVXHEIFF8jCpQGOYIaDFCumII4p\nxMfrhlo9D7NX5UkJA1VGaNolNW5lMfe7UlI3mZ/BPZB3T2NS6VHgZdBUX/1x\nnbFnM7yDA/uvhIqfWlcRdD4+V4nE3dCMfJM6WT8R/sC3G4WNOJoo4EhCXMA6\no9ZonuqXET6X3vqTYAui1TId/20tgqcvjLCiT89sZNnzXgMWz1zfDD+rSzBn\nzTpv\r\n=9Vqg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBHl8ervdnd2cPkphxWYvwlP31GFtQVMi+oowhUs1qNAiEAhPp8Fwzb8BDJf/nZkIowN8/TmIr/WXq02sqSMU5qEa4="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b936566.0_1611173782968_0.05775279386369325"},"_hasShrinkwrap":false},"0.0.0-canary.7d3770e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7d3770e.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.7d3770e.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.7d3770e.0","fusion-plugin-react-redux":"0.0.0-canary.7d3770e.0","fusion-plugin-universal-events":"0.0.0-canary.7d3770e.0","fusion-test-utils":"0.0.0-canary.7d3770e.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.7d3770e.0","fusion-plugin-universal-events":"0.0.0-canary.7d3770e.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7d3770e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7d3770e.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-F40fh2zajdcdAsAU70XdbJlk9BvHemll9IxW+0Uzw3Cqu4wwb/i3m6pcSbgRrgyw1kOi7AnPNpJV18SnDuFMhQ==","shasum":"11b8128482467d5dcd3706fc3d74ae1147301e56","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7d3770e.0.tgz","fileCount":11,"unpackedSize":40440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCJlPCRA9TVsSAnZWagAAY2cP/jNwReug5A+VN+Nxv1DZ\n2o7N4cOAs2MuEi7DRqyXnD3ExFF5kytVsa2OCAo4Orhga4ZwW8M0u3C8jmEh\n4cwP+0mZOWMW15xlH5whLfFOcwdZ2j8UTFsW+hTjvbUl1aUZcWTfRz0xRide\nNmCCIynIlLMryb2URrDXrfnzHQTAiKYmoxcfyzs53rhqT/GqI19yrUdeTQY+\ny8j9HACCGlr7wMuac3SVwwlSQl3yDPBkOrmHIoTCFP3L0QwHpLQCCPpZ3RTb\nfT65w/HZaXyCh/yWQYBE72aaFL4LYCqZ1HCu35BSxkfLe+N5s2YEs5MQnrX+\nJvZSq1EpnKcrQ6AQSRqEXvm4ltTjuPsYYCJdyfc2Ah01kCz7rqR623eLwH+R\nHCr+2ZrziT4b7Fp8rYEsIH0XJBeX8WlArBpYz9Mp/YKBUugjqbVERZI/0L8K\noukggMbC/J1lLpb1wb81+eU2XaQbibxwpkCOsSshRyZIhX4CpIZ4p4lx4lGh\n7Kz7RugF7Ii+L50pzgWukFXZYUj2KbA4ZNkP5vqu0M9zkN0xQUr/sTBoocNE\nVj2Jzx4bQ0y2a4IVyiJZs2WbWHyoAlxM7jDg157u+stvEHotcjx4Chm+C20q\nAXuY7lDAIVdNuM0ZLuKxgtnCpb14WDOVvth7HzYNOX9Q5cn09X0Y0G3/l8e5\nTeLx\r\n=Xzsn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF2akLbQIs05IMe7tdFNy3OaAblS3KcVMvdGc9j2d9i+AiAo6rpchucDXD0RWBWJYnsFSlnqZZD1g9ik1SLMfPsL9A=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7d3770e.0_1611176271086_0.1955155110905813"},"_hasShrinkwrap":false},"0.0.0-canary.c848126.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c848126.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.c848126.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.c848126.0","fusion-plugin-react-redux":"0.0.0-canary.c848126.0","fusion-plugin-universal-events":"0.0.0-canary.c848126.0","fusion-test-utils":"0.0.0-canary.c848126.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.c848126.0","fusion-plugin-universal-events":"0.0.0-canary.c848126.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c848126.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c848126.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mO2L5wvapADgiPcDg0YrDiipD9RKaAdP07obGZgYx0PIUCs/LJmXxNaGPvZyYIyIMU2k9DVu+uBC5Cf02154cA==","shasum":"45cfa2988db57e1635d831f2c52343e1e0ac5826","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c848126.0.tgz","fileCount":11,"unpackedSize":40440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEywyCRA9TVsSAnZWagAA8jMP/1LVKXaDxLWVlxXWsqLP\ncmazNiZjqYXOK6wo9xekM74a69DcvubRJIA5qwMA8o9P+qsvaEy6Oe2y+3Op\nCvTZudjZC5+wTWfJAN8IRp2w9B8or5cbHGHU8Xjku7QI7YNjfDesJGLBFvM7\n0De7IyVRFkLLikKEa3JC1l6WA1QntdkUquL0f4+aAwtv0lCE6ncCuHPJ62Hn\nzKh1y0wHMp6JFTA7d3XkrvgZtI78//2NxPIDwu2tHhf2DyffODAbnfwMvaTT\n95WcD9v7bSoaq7Op3EP/MvNMwDA8bI+loSc+qLAdSLsQGkPdLxNl9+crFiDx\nlijZVWjhV87b+6RwDmT62B2BoVOujxyc4oK1V07yqOXqQWdXxu1pdJFFdgYy\nwYLn/INLIJqO8e0aMtGe8WoBoCFe8HoASMpul5BwLYo0niDJZgzlvgF7RL0H\nSmGNNPzX1jsa9H86xzPeFNZ1bIOc4Iypz8iOgejpnFTOLXxcDQfu8ORtDbQk\nftlczaDkQr+JZ6ati6KzRXji8L2phN58ohLJ0xf5H0sTHt2Uy6QQE0EVnt5V\nt0HO9cGjdb8XD0aUBEuWx3tkHsUslTDrtSNajnLQKxZAKSXYR//1Q+tbP9Lt\nXByQtSDT9qj7iuudS9i0sA7udYhZg1N3RdlPsyWc/5+zYaVJMPVbv/32UOG2\ngGkZ\r\n=b9Nw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEGJqr6hkF9GcHmhGzR9LS7jU7xikaLZJMpEHsIvAHtsAiEAlO71cX3FLE438pY5aT1peAE2GjsUK4NVkgX4Fo7HR9E="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c848126.0_1611869233713_0.6326306266456223"},"_hasShrinkwrap":false},"0.0.0-canary.7eef88a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7eef88a.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"0.0.0-canary.7eef88a.0","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.7eef88a.0","fusion-plugin-react-redux":"0.0.0-canary.7eef88a.0","fusion-plugin-universal-events":"0.0.0-canary.7eef88a.0","fusion-test-utils":"0.0.0-canary.7eef88a.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.7eef88a.0","fusion-plugin-universal-events":"0.0.0-canary.7eef88a.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7eef88a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7eef88a.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-eY0Kc3R4l0hcRCMXn9UxuLGLzq5co5KM7fPFL3f9YkM4lTB8xn/8atklJfrGfRRCV9tHKAkUWYHacl4NXXoqDQ==","shasum":"a38872fccb541788eba31c05924d390fd8286c53","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7eef88a.0.tgz","fileCount":11,"unpackedSize":40440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSQSBCRA9TVsSAnZWagAAoaUP/2rF6qRRoACI+iLTlVEV\nS4u+j6XpsKmJAzPucCoLtSv20Nd5Oh1M6s1m+G5Zr3Afk2T6ONC/F4BmakXt\ncsIf/I74QdlakbOUGYhQCZ3qEM6jG+E+aVnjeL8z4fg9CH5r9Q8absDHy2mr\nAGmgxxD4XYkRbGRB9NDP7flJmkKk2M6zs8wV5e8KH1mISP8F4B8+5/DzZHOR\n3HSIy5fHtbrJ/UsmkytQ0u3hFmkIeFAEvgdmRgvl71XYwA1YZkd0FwEXuV4D\nWXNBRHdN1r/aZxsT4mvxbzwvSuNShzD4deIn4oWRGxqh7OdpOBdA1DL+ln9F\ncVSg20el9u/VTWqzcEeu9nfOZU7EIIxQ8xoeAxBRwCtQomXg4NBz13pjfXR2\niBELvoL4yxtEQ5FpdAFqjJQB20hWXRGf38Tk6e/pFmSqG/S8bSuLbp/HZmNK\nwCfWEZ2iuDFIXCI/28OATNSg/ehUltOoeNWjsy3/kVa2QgH5JcuS0ZTvO94r\ndE9/9ZO1M+zfk2ngl0DIT0I2XdYwciqiXafNegWJiOVdlakRMWyA77aKyuwq\nOsTl5O88vhCJoqObXu1HdsPuB41vu0enTpIaJw1YPla0eg8+pENSQsdjAI6i\nPRqNX2FW8inmsbJkvv67r8fKPzAXdCHTwscH7dTEw/26Vo+WP7YoiuQbiKdt\nJpoN\r\n=bTo4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF5RhlI5joO7+VmFdK5czBmwl0NRvwK92zapMGLJZ8ZlAiEAzVBwO2GtAgEJdAidxt5WyYxh+1Cc1icjCDH2RlJ5YHw="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7eef88a.0_1615398016692_0.6514274128986912"},"_hasShrinkwrap":false},"3.1.9":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.9","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"2.2.6","fusion-plugin-react-redux":"2.2.4","fusion-plugin-universal-events":"2.1.9","fusion-test-utils":"2.1.7","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.2.6","fusion-plugin-universal-events":"2.1.9"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.9.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.9","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9QC+QgdbjwU+4lFffrn3WQQjuYdXYDk5ns8WHABKyscXat3z2Sxh1QqZG2ItbmkI9f3xs53WVczVbAr0VEh15A==","shasum":"f04ce27df4904cc55451886e343bd4112795772d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.9.tgz","fileCount":11,"unpackedSize":40304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSrvzCRA9TVsSAnZWagAAuCAP/AlR749CvKpF1OPBhOmA\nqtvVFG3qz259odso9NJLEXbbkVUoNRuIf/fo11bBCpltoHs5wsGMtkRUvMYF\nY2A9a4ltU6SS0MClrLDEnXI3ke1Xv1YluaBeEGoL27gKcImEwtp3qff4JTXk\ng22VLuAyDvBJUw8/NxyiHjZbqcGhoeufmUm+qPjivj4IAJLlpvEpFScBGS1j\nUDwqmWwoanuGP/72v8xhgjRPpMTZWDVqdfERgGj+iH+Grt8U2pgIXr9e6m2z\nJxnyT/cqBJ8yqt3M2fEYhB9ixVWzf0ifVk1CPasH7Dv2GoQ62UnL3LYePhvx\nbn405LLjTjjuD6gohi38nbExptyjY4chR8b2GJq+tNpcHx/OSwsXThkdLDPm\nlhSHaNuC6EmR02UzzrUprMp+mD2J3sO7jhwKTrNoh4/uyZAbuUmPxGwyYy/f\nS5hOqfJeEKSO2TpHbS6XcTMVzv9/doyHR1t9kBffvBSUC1suv3mLScTYivGC\nYRkQKWAoeyrIMJH1H0pkt0Fh5ethh68hnWzLaCs9Cdq640HO2i4mxyJeASFX\neoWq+JbH0cbCEw017Qvp5KeEplIYV4EKFCOhcO8E38fHrIvcVWjzGbFI0dmT\nNIvWip0+Z0eUhgpK39Pfm4TnEdzm9hQhdiohFWpibE02j07umnVekQgt/bbe\nAGnW\r\n=oy/X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICRb47phb72E+jI6SgRW+J2nYdJ5zOupIFoX1cmrGmIHAiAlYz0UhzsGnY8bH3Funs+yWqyF+KDx4NZ0RBpk1BshJQ=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.9_1615510515444_0.9852533697588752"},"_hasShrinkwrap":false},"0.0.0-canary.5086770.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5086770.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.5086770.0","fusion-plugin-react-redux":"0.0.0-canary.5086770.0","fusion-plugin-universal-events":"0.0.0-canary.5086770.0","fusion-test-utils":"0.0.0-canary.5086770.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.5086770.0","fusion-plugin-universal-events":"0.0.0-canary.5086770.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5086770.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5086770.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-U18O5fCoiaY2Gb+IngOFwR34ziGlLWRirfE2ETIVqBmicaUB7dC/EFHO1sCbjGpwRxStpWFDdM8j2/w0fgahbg==","shasum":"76fb22fae2f26a4e1bfc109efa4b5c13cdc05c01","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5086770.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSt9cCRA9TVsSAnZWagAA55wQAIakN3jWZJ3V21ImWU1A\nNerPA+GVureELo8hlOHQCZVouRHwt0zn99y9d9V8hB96c4q/nEYqRnIdmTvL\ndlLiTnRzgUp2ANFqvTL+8TtsdmGlKv2zDGLEQM7RHLXFlLKC8vkFmts/03ug\n6ImCa2Sjx8ue8vE8V5LA49+dURTjr0L+em36TSruuDzBuRle34omDhFuLadD\nZXLJrl4I2k01Y5NUqLCHAObDl7X4vZikEy64tXRQPAA2ApIbaHNryfKNyIxa\nL/cNNR3sXWnWTPhGwsHl1rIC0VEyHzDxYOzbRdh7zMjeQeTt06urCP+ICMhl\n+cCEYqrZRs0lKBMlVSgDNDbr1jCnX3Ojs1obFxHV0zUPPcaDWSQ+UyZyrpFZ\nOqXlCERxbVBXiga82gS1kbDgzqRUc/u/OThiFGTw/duWogbiYFARy/Uq0nb7\nJmhLNam8sYQcGKHWMer0aOM9sLqJoob3iPP4T6sDbqOos+E7bzavzPZVXP4G\nI1Y6zXYGfkKxItcC4pH7PyKI4kLeGcNizGr8tAa/1bbb7eYDgjtbAUw/OUTQ\nwuNgyVtXrnWeXY2WAxYuGJQKCJ/kNiwNIAhgfgbHivGF06k+0anxTCmK+zGM\nXcYPSin005jsgUDwK3GsB0ky7h3ZwitO/dGYGBXKg0smbFSAyDEkzocyWR2X\nKyOT\r\n=2c/X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHs51f9tt+R57kn0sF272c0wrnzY+5CWyv5eh+SyZ4u0AiAjx2wpFW73nO7W/+0WcTtGY4jaG1E3u7ZyC+rmC+8AgA=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5086770.0_1615519580023_0.5598381811264261"},"_hasShrinkwrap":false},"0.0.0-canary.243e09c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.243e09c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.243e09c.0","fusion-plugin-react-redux":"0.0.0-canary.243e09c.0","fusion-plugin-universal-events":"0.0.0-canary.243e09c.0","fusion-test-utils":"0.0.0-canary.243e09c.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.243e09c.0","fusion-plugin-universal-events":"0.0.0-canary.243e09c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.243e09c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.243e09c.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-4zqlQ3U366PmyBVNrOLOpSC4WGO0HGqYt2oooc7/OoQDWMQf4gp72OZv/O8z+YylFXAUzgCNmbtHxDYlQrEUsg==","shasum":"18732af2a4aa785e747d45be6a88b24fb93a71a3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.243e09c.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU+KCCRA9TVsSAnZWagAAeSwQAKAOcTswOzaItQdI/4Tr\niM1ot6PrEILf0kn5Ptyq7Hfu41nAdp/ThAv97orNtXOBaPMARfWz/0dPNxWQ\nTYsJacTph/vjAsmt0i7qFxfcJmHj5VIMMB2bzRYdiKWkwyGetnb4mmQ6pmmr\nhaHvGlHAlq6BZt6Ctf9jBlX8IDS6tRqtBCw97C3bCY7Oid3ep3kOYGhq+iTx\nJHAWcNrnfRfg9nAbI8w2PEDw6Crlp/x6YzX/oo4uisR/4/7y1x/vPJHUWe7B\n66rR/gePKDF+sH7fp8s0XGKOLOAWRgB2bC4TD7oR+J0+Zy2wf17D17gH3x4a\n3NlyAua+qOqfTtkoMn2+O3uvkudx1O/VJ1ABgEB3lTmI44MA83oDcUCLsgIG\n+9NCIwcx9DiFeXd/KRwM6L0SMxjQ3Cm52T+7cQRFR2r3xzIUhPCKKc368qMf\nlVHoo+3lzcRcCZ393f+aVrCMt9dF/7zBmvI0mTY2qnzxDwdbNS77ONwlBEtk\nkxy8ZrvxcRaMFxeCRrBMz49exOCvE+ks22QS7or1LYlm4xbbZWLmi+NBnouu\nGPT/957aHzkQ32qRwH/mdMab7kdzgq5gh6GOle+ZJ1LXYUn2ZfKGDEWYoQqy\nvmYXnYmyXovJ6ZQH3ylhsfZHYz59NtUMQBTZ0ErkQ8O3rWxKGZvZaJQwrutT\n4jD2\r\n=6nrq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDlbYxlrx4NwJYHuZhmMAXdeiNFa7vZU+Id2PW1kL+fEAiEA5FId6XeQO8Kd8/Ig5D0Jy9coZX2r6GKdobm+8gr7z3g="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.243e09c.0_1616110209568_0.4324163297971686"},"_hasShrinkwrap":false},"0.0.0-canary.156446a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.156446a.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.156446a.0","fusion-plugin-react-redux":"0.0.0-canary.156446a.0","fusion-plugin-universal-events":"0.0.0-canary.156446a.0","fusion-test-utils":"0.0.0-canary.156446a.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.156446a.0","fusion-plugin-universal-events":"0.0.0-canary.156446a.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.156446a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.156446a.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-V0WfWOatfuzNtxMInnVkISpJZbBTXwjR50DqtTIihQJ/a1HyNWrW6VX6rqmVxStJq61uMdb5V36yGbCBJ9X3Kw==","shasum":"83068c498ccbe0366f2a28cef0d52acaf6b04289","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.156446a.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZ5y4CRA9TVsSAnZWagAAFkMP/iiH8hjaserXMy7PHL+E\nspbT8eiwd4NHFdNYrzW14834MnLHb1XquBDBImjDywt/jzHGjRBIZGqbZnxF\ncWujqD3y+qZMz2aFst4b2pkcL98lS8SZxh4wbxFvJbVRocf9CKEY0AFNfAAO\nXfW4PsbWR74B7d9kNxIIAhpzZ0UD5alqH2gkzQICGq85hHkPlQN8wyyXswSk\nxJS4AUYuEvcTwMZL4n2SWgViK9n7RCrwEbIUsXsY6vX/hI1eVVLq2XEy22dK\nKLZatftYADvGcH0WDvTrUSYAPgjBnT5hStsfwm99aAfemGo6qAs/C/6SDkSE\nIsOT2Idiuc9a4QfpY6/w9F0RHPqRPBifTNhNyx16uB9unaW2qvuiJeuno7X0\nZqNSzdXwRblNERmem/A+n6oGAE1vpvcs88VGOHtdx5/3qsT/B62ppyOMvznp\nIY63BEwbVh11hRrkalqgW+JXlVAlo+i6y0x4H5J2QjJ+WZ5anJw0qXgR8xV1\n6CDGA8jIyRTcw81AXhX6osFZkwm7GnrklMcHB8hWkIof0czOqMW+CZJ/tBt6\n0koiw/QhPiw3NtJTU8ur/USc0TxeNuLAz+Gz4YlcmHmde1fGnDnBxxtICK7W\neSZ7WEHI2ueTv0tCiFveA5YYBjvyKrQVc5z4Th8swk58q3fzEq+DR5z5+t6w\neCES\r\n=Bh6Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBi2rBQ2GdDLHo1ieXDs4jUIqaD0EoCohMGzxflX4aGCAiEAg4jE75o7kB0hN0odmbZLs+lZqgFEVuK0zgiMVKpzuPE="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.156446a.0_1617403064177_0.8893231058184077"},"_hasShrinkwrap":false},"0.0.0-canary.bda3eb5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.bda3eb5.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.bda3eb5.0","fusion-plugin-react-redux":"0.0.0-canary.bda3eb5.0","fusion-plugin-universal-events":"0.0.0-canary.bda3eb5.0","fusion-test-utils":"0.0.0-canary.bda3eb5.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.bda3eb5.0","fusion-plugin-universal-events":"0.0.0-canary.bda3eb5.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.bda3eb5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.bda3eb5.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-jBy/qvXiVuxoimoD3qVqUM9h22gpJxWbeQzCvFI7b0xZLbLWx9d7vUF0eU1/TTUXEYvE8QPywMWewZWTCULHMw==","shasum":"ea85138ef4e7c1428a67c5f224b966f6651d9236","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.bda3eb5.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbhuWCRA9TVsSAnZWagAANmYQAJAE573HGqNqYfyM1Og/\nzsxwJ1fYuSp9/qdFYxO9V2UwYvbJOiFQpB/zIcZ4nfp5vuwx5Z1WJZbmX3Gw\nQjBewTS5EK/5wAEt6BEGy/hjSrItHO2rrMW7Fh5qos3XPIugNWZ8z0QVY7z7\nwthXv+TB0qweh1V88xoo/A3xpAKS8vNvZw7qDC/bl4lN0dzxJAgAlyXPrtJ+\n/HhcTZ2p8TnTJtSfpNUSDkkJnhEtxRuQWS7eT/HSpGxpBp5xRYFn951mWZxv\nkVFcIg3Y7Hb8EIikckpEaJWejX6BI++y/6vVuHizvQrjQIxObHkF0j77o+US\nzUs53sM3xY+kMYF0/D6xFt8r7ksd03mhh9xa5KIRSdxQcSOxy8GIn1dXZShJ\nTRQAx0lWnP46NXOWwinQUMTHoVwnJuX8yz5NotG/eBc6tBAtjX5BdrvHLdZJ\nHVjE3u+tOazoP8wu4D86nMiiSwpTHgLJvFzFqAb23tU2D9OtAp3yC7KAQ9z8\nXpAhtBCqiEQXDn2ir3biMHSA4Su662ADeMgfGxewrSVQy2Tchem0EYp7Gp8E\nY891+oYnir8sOavUTgwNyVnbYZnVoPXypBdylWUd3aSzUsEYIaKNRWFXWT+V\nnzCXF+MzXfuAE7b0KLiwD7Im5hPg5dvO5rZVAFcajWgtx1BS/+7MytgxnmXj\nQYYR\r\n=LkvA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2YYhKZsVoiplO5YEyG6lrqVUr/rANjb0/G4Y/he8cBwIgAPYJ1xNx37RQpXbtjSFvaYIYOPwPuJQOJzffUMBDxgg="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.bda3eb5.0_1617828758412_0.9592861117239992"},"_hasShrinkwrap":false},"0.0.0-canary.7852906.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7852906.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.7852906.0","fusion-plugin-react-redux":"0.0.0-canary.7852906.0","fusion-plugin-universal-events":"0.0.0-canary.7852906.0","fusion-test-utils":"0.0.0-canary.7852906.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.7852906.0","fusion-plugin-universal-events":"0.0.0-canary.7852906.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7852906.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7852906.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-j8beEs9mLqNzdu9EA5FCNse1ZQXvpscNDusPO3iPMgb7BVKfoprPOQDKzYg0Iv9O3R4mMeeZ5VV88elYc+Se0w==","shasum":"e1507f224c46429a485a9efd8e42dd4af5f9cce8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7852906.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgb4B6CRA9TVsSAnZWagAALIkQAJK7eeU6O/VB6TRqu26i\ngOXp7mZXdHVFhjJg9DN5pRKOZdG7dVpsz9h092l7CxuYY2TrUHDZgX0F/VyF\nEcay8+g+OJMJCYA4e781unyNjHSWTbVfnbNayBM//l7TDR49bltjb/GW6GSU\nPhsk98jjDPpGdmdwHvVB7NftcXivjLoXFAlj9xYs8ZdR87s4/GnPsxGX9IBr\nI+i1EXDRFTW2+fLMhQa2j4kWGrgkLdFfzQvwzNTjg+6Jxd2Sam1siX+gtENj\nPEEp6YaeYXAGqvEZnaCDiDe6pUgQ4yGs6AFGUitySqZQGofRYHhrly/xHcUx\nagzzX7AnsIZK6sGF2Q8XYMOEO46096/TtEPYcHxCcsxJ0v8nd+YskkBBDnzv\nW9wuyOQDpEC1GSXkJfWoB0tnNdelZ4mzWUbsWZ4HNs4DWj4Wdvp0KBNLB8TH\nIeBkUr/CbAg2u9BcSMBRmoAQG/OIyAupoN532imBUsoOD1GVBv4D9x/NDLKi\n8jGZWyWaUoGGeMiXUHW9rmvyYZxDU6/X34UxW7QyZeCbI2OzVfxMz+ahwMWl\nxfphGCUgzhJSa+v3Irkx1EUTTsfqMO7eJ1sFMQQvolbJSG2OmJrZHnY8VU6I\nD/oIrm+RIRx9us/uyExGMK38beVy4y0M7kQQLhlwBSe0vpIgSpnstWq81wnh\nj/wn\r\n=y7AD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDcvjiRxEjXWekMtWBdKGo6fGsy4nxzmeYtmnnmQFnzlAiEA/pL1e1MDR/3zkYzo8YsFVR+Tb/x+KphAPPcOSecTU2U="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7852906.0_1617920122519_0.9410724824719439"},"_hasShrinkwrap":false},"0.0.0-canary.36c1f93.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.36c1f93.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.36c1f93.0","fusion-plugin-react-redux":"0.0.0-canary.36c1f93.0","fusion-plugin-universal-events":"0.0.0-canary.36c1f93.0","fusion-test-utils":"0.0.0-canary.36c1f93.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.36c1f93.0","fusion-plugin-universal-events":"0.0.0-canary.36c1f93.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.36c1f93.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.36c1f93.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-6T3Sp1NqYAO2GfsRZw6Z6gc9gKgsvBe1w8k5eCtnuBglnLkiFgrMSzKPo+4Xk3kVWHTsmq+rU5en19Gbbe4NAA==","shasum":"983d41dc703b9a620149361e921e1e2aacad6460","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.36c1f93.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdF6WCRA9TVsSAnZWagAAnt0P/1vmvIJR5QIwYQ8wX87E\ns8nmhdWCHmzAKiVFv99cp16bHlEswOtaiV3vQy02urYqk5ZoEjq/dTRVJp/g\nEwo0hIbtVCe4DxKxbfvAII9r9gD0GDr9OJ9mcf3xFWKw/KImV6woxKXrYouH\n9Y4lV7qY2ElwtANaRWWEuDLn7gTeCbUrRaSYPjw7eXMgTD8g2UMtY9gosl2w\niPhLDslIOEvvE0oI41wc9nIQSZPEl9RPiieoVaSkkn3xSI532CHB65mMGQrt\nOKHg97bg1HvtuhA7vgkVrcuhEyI3XIEDALXDsILU39VAOGL09htxQ2X9seeg\ndBx2/S4hK8/tgvOF81Lj8DpVCgWLeL8T+3AE3zlhX3O1LTfTle0YsIRhSSga\ny4MC6IyGoZKTp+pYQTby8ZRTQdA1a0eaj7RdOlf2fzvpqqVfXY4m4Bl516y0\n3aqolOSepAa+US404gTYcbK2qZtDxtZhgwuMKUBzaLRF+RIL1E1kh+zZsucC\ntQBcXizwAeSnvWJb5f9S/2WvZsw1rzslGcaSH7JMLjmrYJuup2ZX2YO86vob\nKCNlLmOgphpTaoS1loKl3vE7F5ZNffH5OVHRvjnu1h5mPwXzLrYlhfMn2eD9\ne99ZNsCw0zUxCFME39GcwOlCsw6Olv4MKjqLRe9wR9qrH8rEKdhb0T0m9qHE\n00lp\r\n=Y5gV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFk9Zu7emlGs3nwmQq0nlXCylHhvAkhKREP18VPp6GOWAiEAjxMgSfCkePmrHaCxIFTE37zRwpuidX08rtrTErV4Brw="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.36c1f93.0_1618239126190_0.49777617901738713"},"_hasShrinkwrap":false},"0.0.0-canary.147decc.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.147decc.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.147decc.0","fusion-plugin-react-redux":"0.0.0-canary.147decc.0","fusion-plugin-universal-events":"0.0.0-canary.147decc.0","fusion-test-utils":"0.0.0-canary.147decc.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.147decc.0","fusion-plugin-universal-events":"0.0.0-canary.147decc.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.147decc.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.147decc.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-oXNz8r035tAQ/lr8Tjz7jQ+gnl0k3IZLW28WVn3SS4WtDqHckNKlt7KcpJZ005VZ1lviyTH8JslEmbvu6W0JKQ==","shasum":"50fd39cd2789c3041d0d0b438c3f199b7fe9424e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.147decc.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgddBuCRA9TVsSAnZWagAAhboP/0cSa1M685QCRdA8LWkP\n91MPzACvch0821nn0r5sbHehPmvDQuve5zNXKMMRRNVAv7FJU/9jxUXeWEeq\ntdicLTUFN3rBDQwZ36IOv/jbeFrT53g9O1iR/NGJvQX5pm/9ywqHX6BbZmlf\nWhfrTEWXgI5ZEmGhcmUqbMekcwTL7fiyiP+Xbl3+oCeQPFEMDyAI8XdxJ40X\n0yBraVyqOikN7jKC1+QI+WD3qolbY4V1Vn4vikv6jTRg3UdR+b9UgDpRRWQ+\nAtr3UKsPgmw3VOteK1nwpKsZ4qBAV6E0FsGYw54KAk5H6EPtwHZIg7zQ6Yga\nGgFv7GhZ6+lI8EbskTvi9XEd08ERxkMQxyDusojSfXwsYT5Hj5uIWhbxQ/cF\nGz1fhHSmnOOTaRPH534m1ULQ5lEI0kJmEOY1eCg4hAdCOd/sdPT2UJ6BlgwF\nbbW9R+D7L1HWZBtJYpTVX5wkwoAo7hNwT+ykAebmQ7OyeeHHO5Kphqdxvho1\nNxilQ7snRhZf+22/UBioJersOxuqsKV0Z5EXPq1t4ctm8v1oEkf4Np0xY/ZM\n2K1WbNhG2QqI/9E441TYEuv22sc7+WnjMIoxnSkyNiHvBTK10DztmlYuYQJr\nWBku+teMusklYc2c5yPOQYDd16P85wWu9tDeOEtPMbeJSjBnXvB+aMNaCO1Y\nVmhe\r\n=Pn3f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2jn1kH5LpghC3KiIiFh/HEznBcWcIQVs7BG7qYd7ZlgIgTCr9EF/kzOSL141En/YtryGVvCgWWctgug+zztkGH78="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.147decc.0_1618333805742_0.21608755329699325"},"_hasShrinkwrap":false},"0.0.0-canary.481456c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.481456c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.481456c.0","fusion-plugin-react-redux":"0.0.0-canary.481456c.0","fusion-plugin-universal-events":"0.0.0-canary.481456c.0","fusion-test-utils":"0.0.0-canary.481456c.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.481456c.0","fusion-plugin-universal-events":"0.0.0-canary.481456c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.481456c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.481456c.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mYEtpAcQz+JpusFWGyioudcIqXmtS7Kf1la/RWrz5qWSrW8QL5NYwVMllpPw2zKCO4G11lu5SsRS+7MtJ5uSBQ==","shasum":"36b0d0f0b8f984b8a4b5320a282b419172be4ba6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.481456c.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdhQGCRA9TVsSAnZWagAAA9IQAI5Ap3GYCKI5PSg84d0f\nrpt75O5TiUNLdoZlmHbK+qxf2NMIkKTjtZn0hXOjVH2zJc6+9EKSvqF2iDj+\nzRCoaKORlDPFmwOgc0y6QdpWUeWYnIpLeWsOqywuOVzCIULIukspFNShyy5L\nDnKo/OcwohZfLpfuzPBHIQQT066ObAXIx9o8xgfaEbZwdIBqqilNQ2wtt8Ol\n/4TtIQRv3uK+YtlU7E3HB4fe72JEGYgjGUOF/3RVnDkXU/z2IGo4FiE9KwNc\ngcAEkn5Wsd0GP1XdFcdUz9E4PNVae0g6gcKxmT+r2KW4Isq2P4BQ9UK+b0Vp\n6URRIWHB7vTmYMYsP72AvopSpybW0Cps26x95XvV1QAOGKDU6KH9yOuLZFIX\njKdAzcFzvCMHq8GJ3PHW/PNwmOcP8lgHlkhNlEbFiVUIh/NtoKL/KAsBmkg6\nsZgGYn+JIPr6YQpoE+uisLUQSw7Mpbl3F9Hrp7KCaPo9huQ0W8aSXnpanylE\nPf7MEJ3MncfRl/O459Fm0P8oXYar8peBlbIopNYAGj5JAAwA5UocqMrB5m7U\n/muwQD+UFxh8aI37gxfYC/r8PaK+xomb3PK3zQ3iRl/v9fkAK0//xM+0ySJy\nc+/By8mOhX4iGhMHPOjEkJiyIZZGotT2NWtDyLQCzAD5ybwvRgDYK371yfBb\nYTg/\r\n=nZ4z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdDv5hep7kewh0KVqBcdViA1ZmW8uIzEcEOpy58kGuLQIgBYCyjHRkF0RGQ7qjKV5RtzAN7XQ2l3quhKuCeQVltYk="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.481456c.0_1618351110136_0.7221681157520121"},"_hasShrinkwrap":false},"0.0.0-canary.4d2f7e5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4d2f7e5.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4d2f7e5.0","fusion-plugin-react-redux":"0.0.0-canary.4d2f7e5.0","fusion-plugin-universal-events":"0.0.0-canary.4d2f7e5.0","fusion-test-utils":"0.0.0-canary.4d2f7e5.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4d2f7e5.0","fusion-plugin-universal-events":"0.0.0-canary.4d2f7e5.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4d2f7e5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4d2f7e5.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mEysZhWIkDHx2bkBcLR99fFToxAwJAcdAyu09MmslSBDpmRoBO3eg6WapNPAnKxm8CcLGcqp48KAxTp5DeOwoA==","shasum":"7e71b315dd66f0e51e7a76caf366d046121f5d03","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4d2f7e5.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdiYsCRA9TVsSAnZWagAAVXIP/1g19EmjtUDqv3bs8sZy\nb92zN/KLIr25n+yNkyzZc8+FLX9SlfV4yFGa2caRRqBBcQ2K3gdgLGyP35rJ\ngeJrhNnWXynLuPkbD1U+c6skmf5v0v30MTdsQ788q6rFNlJZYvV+/vb7U7iw\nTL6+XfX4XNavzQ/tRHMh3uTwMoh/zUxDD8O2k7Z1HEOWs3sefZt9jEusTXDI\n9pF2Ghz0gp1WRrRXpu8llq7OebGseJX+TUmTsdOScGqsd29xKW8+9efyE1a1\nbfVB2cBA9nm/sHqadmkNtedrAO3f+d//2efVsm34Oeb0iy6Gl89x2+M5z7qb\n40qC+6pIUWaR3jcII0lcROedRcDKGSkQ7jnqNekr9EH3nmbmLpg7pZOAYdLC\nZYpIBxUujQ3HnTEafLbnzzNbWXNn5KMUvktxCEtU0GtdVCKQhYfWND+yui4h\nHpHBmlHPJHakbkSEc92TYvP0zdVf8BsPAY6zdc9yTvQ+ZZmHFh7oQR/oKiAq\niQbbOQY1jM+FJHdBjlBXyR4waIPbrnWE/SGJ4OOgD7E1+XdC99zqSdP50YFJ\nH18CKw1spZ03MZdvFETZVS9Lq/WVTawMWhN1poCIfbeJkDRInwlgmxGJ0a7S\nmPPy5uA7L3ZqpV6vPHSSf6AQpGWmK9eEhMdZXWmSJufk5cP0T1AN424LKbmx\nS9Y0\r\n=wwnT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRnuGNfrD4X2HTv9UwGOZv48eunpTPhvGZu6QCU5a7egIhAMYECl3h7zIyvWEHqBRALVCnqlRE2jsKeapM6GTM5KSG"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4d2f7e5.0_1618355755731_0.18816031676255274"},"_hasShrinkwrap":false},"0.0.0-canary.9158df6.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9158df6.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.9158df6.0","fusion-plugin-react-redux":"0.0.0-canary.9158df6.0","fusion-plugin-universal-events":"0.0.0-canary.9158df6.0","fusion-test-utils":"0.0.0-canary.9158df6.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.9158df6.0","fusion-plugin-universal-events":"0.0.0-canary.9158df6.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9158df6.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9158df6.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-t/LLeBoy7sMEC26Z7KATiJj+1i70esg/JMA6IyB7N0bUnfTacyOgbkE4ren5M+KS73jPMZ3q9rVH8GOHRncwtQ==","shasum":"a6af72f1aaf29b8266f1ba0cf2c5b9ebbfe2f66e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9158df6.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdvtzCRA9TVsSAnZWagAA6TIP/2XJnC9YLgDMdZ1BxDv1\n+bDieLip47HDUscyu1WL9LMkfmKON13zN4Z2YRcVIhoYAaKXGTMvDL5HqWZo\ngMJOhd1TTK6nR/qpua3kwjIUaNRFmfJ7RT3IAUA2y27EE0oGiAO1pDRT2jM4\nMoruMzGYuV52Yc9YCtzOvTUx25IHchuTpW/A1pB5n573FN93L7OXQtOeBE+e\nVRU9tZjmRJpe107dR/jUiDl2QyZqCgnezOjURKsKTSggETNC30elHBO6KHGB\nZUuR0aTj4aISjQE3e6yP+XUaK126D0CUF+ex7OM9txgjLurAvcSOXqQCEFUN\nWoSQkgHqRh9SXH8fED4ssXnRB7NZAJ7M2KG3Ie/r+Pdk15qCkwqjhSQ5T6os\nuJZ8MPO4uec/oAOJLMebFfLpxqRAycVmnXC9l0/rqO+kHjT/vxb+s88FgPkB\nFQpOrIkymT8pld+DZNn1jhS68P/4NDSt9m8TZXH0oX0VdRiWoYDpxYJH9ecz\nioIuafXdGrFlFT20Qah5reStLZUt9UMOgodjaRyKquzKtQip+TXZ5WEVVxeb\nN9lvKY8t6tfIV7mgSURPD0MjFEHugIgwUUpvFx9YWj2eM/UwLwWFIFsCOegp\nP0CQJ8XWRalAgzmLQPpwWlwjShVOLDTjpgJYgsSbFE1yP2UvtAzWNtsLQziN\n9NlE\r\n=fNwR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIApXHkrC15fFUeYvARX0nnxZkFfiTN/cr47RslXVhrCVAiEAjOOpFvz1hoaaQHa8KUIQWFIBKAeqc6Eh6Ys5F0lOaAo="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9158df6.0_1618410354827_0.794686830782072"},"_hasShrinkwrap":false},"0.0.0-canary.c68f2d4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c68f2d4.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.c68f2d4.0","fusion-plugin-react-redux":"0.0.0-canary.c68f2d4.0","fusion-plugin-universal-events":"0.0.0-canary.c68f2d4.0","fusion-test-utils":"0.0.0-canary.c68f2d4.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.c68f2d4.0","fusion-plugin-universal-events":"0.0.0-canary.c68f2d4.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c68f2d4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c68f2d4.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-PfuUqPF5dHzbI4SjbeMJVlBgoxTsuY6pulDHZDksFXuPcZdXWs/grnf3jLiaz7w7OTI/cfrjvY6cmI7Z2hUaHw==","shasum":"f5b6fd50f60480ede5865551b6c42250bfe79e81","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c68f2d4.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdzxkCRA9TVsSAnZWagAAio0QAJaf/y6oPa1csQBgWoO6\nAp3ohH57AloAFB6+b+ri3aicHeu1azBvg0AsNxzns0DB8ulKGvgc3hi2dq+e\nxxPI/fmqrCTf5pXSz47p1gzeP+CIbHuTyqQJ4r0s5uua5SweEdw/BTGWYK4y\nh7v3madO3rNFAMKvCcj5MjGVsa5cNffvKucC8awbgM/v5KOumOQgTzguDkeM\njBJTOCKDYeoDQ+yQpDD8VlbvuRIYAfhPytTA/kKTRItSIuH3JR8vPWfLaRak\nUDDGw/ZRty+Ulc+xtg2rBOT3qf3HX57VSf810uA0Y/QnFTB6dFDlNHqbfeWy\nIW0uAZ5H468s0nqAJmBgf2sj5NoafsY6BJ2wcIKraFCcbpG7N5nGx9o8yilg\nK9hg/XOZ+7TdZintOaPpvLNn2ypSNknhSBwuo9k7qB/uvjUOOtEcO1DgF8hW\nItS5bf+nf2e8HvKIi4xiws85LvUAJWP8poxVZ5NHes/ysf++jGWz6Ml1cgp3\nrt5bebUd1uIjqtOwflgzdTGhMUB6Bxq7qcP2G3VimgEBlC+FFbmMIFKmWRxM\nEboNqH4dFz6TPx/LTVXM8jTx+wpZxwT6RIW3XxhVela4Y8g0eyt3zDWN/UyI\nQ/Hh+kt0IFarK18ravFs2tBw6GgvNz33LNtrEQSubj5QcTXaDYKJcnnSPFZc\nPFvG\r\n=+xFK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/0h3vDQrEfThP7XiO2zl33V4obJ/iiObJAm6l3EuVGAiEAojW2zS+GXPLyJP0sLsj7pFnMcCdH1XZb8U/Qmt1c4gM="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c68f2d4.0_1618426979915_0.8943089124885455"},"_hasShrinkwrap":false},"0.0.0-canary.fa4dd7d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fa4dd7d.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.fa4dd7d.0","fusion-plugin-react-redux":"0.0.0-canary.fa4dd7d.0","fusion-plugin-universal-events":"0.0.0-canary.fa4dd7d.0","fusion-test-utils":"0.0.0-canary.fa4dd7d.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.fa4dd7d.0","fusion-plugin-universal-events":"0.0.0-canary.fa4dd7d.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fa4dd7d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fa4dd7d.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-gHxJWXAzjRtg74kovcwUjKerTzCnLwYQCE9oK1ZqQ/7LnNzDpMiU+y0EPdKagEUXz4ErhWFBJZPN74dZlBx5sA==","shasum":"5d4895ffa5296eacb4db67e4ed9ff664bd1f47f7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fa4dd7d.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd2YSCRA9TVsSAnZWagAAHDUP/054wP3D4l6V3Skz9EYn\n57xjOltMoAenr9fDsrFHO70wF51BZMxh6Js+T3kwwAI1Fr6Y81OkGGKugMr2\nOSU1lGZjSWrGBciXEtGbkWorDhyjbwuiU93QBwJbstSyHI4LxfPPkB9GcqM7\noHsRBOTaKA16z88GQPo1Zis/9BopRJ/Z2GH5lOwHbC6AN9bQRXQSXklk9Agl\ncZT/Kr8IMn69mznVjyBbOUGADsnY0sE481vLQKXi8t5IZgnHBWJDnWTixBmm\nj/42km7646dyDxjX7dushOZOiq21HPvrm73S65Ggj+4N2Y5fmyQ/jd27fMJG\nXbNJvJrk3x2HXKdwO/OIkmDSJI6dJ9Ywyfo29lnz6T5/XC50xfvFSHG1gDhd\nAdFRaEHKT1R6Wx9vl47ihfTLkrhEojD+9Tky2xGpXgwXUEgnczeBUEP1nV3g\nr8EoD+asHp5Ar5/UQht2TlPtcRR2+ZVlNPDjtdbnHVNyoSy0/F1SBQvAQuKV\nLHpjzBs0fgDHwuCfMtFX8rEV3OrKYPdzoph280h9ZxAdhWrxNWu6e6h67B9f\nL2ScpWOmCk3uW4IMp4ZvF0Bsb3Tt3XYw/4Rj6kGWG8UmijhsUQVvQFjIgOVI\n2hEHvcnXxCgTOlkpkzF6lSnTFEuE4mwc+Me04pNw3kRyikY+ANyGRuvH5Ji+\nckGT\r\n=H2PM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDb46qOTalITPD54pHUVljEeJ9RzmFUjvK+Xgm8NY3MtgIhAP/me7wKM3XngKkfy5LGOLBN5iQevxNwNxBv95/Y5Bwu"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fa4dd7d.0_1618437649739_0.2485282147430088"},"_hasShrinkwrap":false},"3.1.10":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.10","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"2.3.0","fusion-plugin-react-redux":"2.2.5","fusion-plugin-universal-events":"2.1.10","fusion-test-utils":"2.1.8","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.3.0","fusion-plugin-universal-events":"2.1.10"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.10.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.10","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9CkkVkzh+Hko/N84MtQ2F9CLf20YmB3O9gJOrZRXlCTVhG5ZGSsl+hVG1KVK+of016y0pMroXvsXkHc3D8USEw==","shasum":"bbd5d94051b4989fdda0291a0005f9d466d4cd1f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.10.tgz","fileCount":11,"unpackedSize":40307,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgegzfCRA9TVsSAnZWagAA+X0P/iVF0+kBb0t79M2vueKT\n2oEBBBerrjtHA0YKctKPamsuvtogau0RSJrD64wWuOaYPeIVc6qpy5JtARc2\n50RGFZXk/6NDi1gX+1XayuE0GtL2MLhjrBtUNVozCDad8WRDDojqUvvTTH3p\nI8WQzROtWKPg6FnS/742DAYIDjqq6fPsVaD2z659U9ELRqZEx7B9WTbOkttS\noCoHkG0IRXSA1yzjW4ObM6Re5KOc4mbVhdMlrXmjAKOnU/MMvcYQNtwRUlwi\nGj3gbHnl50iEBMOYOEEc/2AvweA0hz3wkahiBpyOw1xgVqeGaLAScDz2F2jh\nOSOAWReCNhyqCSHJla3kQQT2YoMaHOKs848wNUzSc+bwkAnJMHsMCTwv9V0b\nW1u3F+aeo2ttPcTJJjTMMS9DDWzh6lXr2vdBSF7ut26jevonK2JpcsnKYqOO\nBPtmSUzB7vBHQWzHlKzBao+bC0su6RiART8+ijSSQhoB/xiMdfNRDaEjMNpu\nTaR59tL3IiX6qvyVbtreWv0RVCYs6I1r/iObX2PosDav9pI4hq1Tw2iIY647\nPQoWt7lVv/G/ZpCGfmpH5x9Ap/bgyoKFnJo3yet8I55DdPa+8v7I2YI6fgly\nUAGJghpa7iNOipiRqwwWWmOwskVELVZAr6cBBaKSUTGOoc0imDewscv1OXl7\nJ+5p\r\n=P0Ok\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFzeOwO6sKHruOyj3cqemrdH7WeK3UmcUMukbnYY2De7AiAyU6T0htyGN1/gNqXP1OO6vVfK4zuEC5dEwUhEai0l4A=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.10_1618611422959_0.9664127157675269"},"_hasShrinkwrap":false},"0.0.0-canary.60586e2.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.60586e2.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.60586e2.0","fusion-plugin-react-redux":"0.0.0-canary.60586e2.0","fusion-plugin-universal-events":"0.0.0-canary.60586e2.0","fusion-test-utils":"0.0.0-canary.60586e2.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.60586e2.0","fusion-plugin-universal-events":"0.0.0-canary.60586e2.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.60586e2.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.60586e2.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mGX8g9wmubwoOlCpstldgvbxv0iwRzBaOO54XVKIngKi2GtuxeVH3vbEi0jYulzCfTj7DielXbLAogHPwRLVmQ==","shasum":"06b0fa0b6b62a690a4bb06e7938be4933d1152c5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.60586e2.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgooWyCRA9TVsSAnZWagAAxygP/RPNkHfqYwsHMsBs76Gk\nEk4aQDKczdeDnXSPPoJHbnEiyP26NpYYj+iqCtc/SW0xagqBD8O76e2oAqFC\nchN9pc83bwRRhCCAVKOfv63whK+bMKgvgIA0Id0uyptKNSNlSGdco8Kc6QyB\ntfPG5m1UU5ZU6zFoFpXl3OdWmpreCWM/L5wByLmIuvNPBXF5QJWKMFguQ02G\nCpxH/O+hNrm5vDMICXysDQRKRomcMULlr32Z5gj3Pity/shuFxuWxnj1XJ3i\ni1ZQjXp8RjF7pZsK4mgCFxD+ith96ZNmIjABywz+JLfVE4Y5PQgTp6UqRpIH\nCa0LfoXL3ECex/bx6bCZ+ShcrPtFYDGygOdF2yepj7iBv6tOlJAboMrxPZTa\n+oqEinSIFAbeeo4GEO5gzHE8KpZIwRO7Ze8658xKbP8oMbAXfE5cpzob4rNi\nkifsmYgfIucAUCn95krZrJj3yflBmTiERylOCQDJuR7IhpIjDZr3sz7Lgq/A\nm6vriVussVvA5NJvV5pg9tlu+kv6sX6bQvQLX8NoDVtUk0hQ/ytmb1LKPWj2\nSPT3/y4n0YEhcDVxg+rHH4XFqjtsFD5Y81yYcjW3C+9SCYVjsIVERMWsolCh\nPEUqzjG57FCQRxYHF/r+a+nfSb2pZZuWprmXyVZ6pbP6+n4eMCgw9QX5fAmx\ntFza\r\n=DSb4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDW6tnCET//S0uAfa8CsjOJ/40INDnuDzIwVEw0pwuTfQIhAKXzMx5Xy253iqG86JSgoadwHPQ2kijFMuM1qqYuaKZb"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.60586e2.0_1621263793456_0.3462823321425761"},"_hasShrinkwrap":false},"0.0.0-canary.b3081dd.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b3081dd.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.b3081dd.0","fusion-plugin-react-redux":"0.0.0-canary.b3081dd.0","fusion-plugin-universal-events":"0.0.0-canary.b3081dd.0","fusion-test-utils":"0.0.0-canary.b3081dd.0","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.b3081dd.0","fusion-plugin-universal-events":"0.0.0-canary.b3081dd.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b3081dd.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b3081dd.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-UqvSsbAugH1tPjTd/QY0MK4ap/F3zKlyNp48q92cec4X5ts/eGjYgy69xFZ6tba2gpgcG+RL3YR8isGU0XZwzQ==","shasum":"bccd9723b08c9246a3e22ff3d4409b1a2b71841f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b3081dd.0.tgz","fileCount":11,"unpackedSize":40423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgqC1XCRA9TVsSAnZWagAA8zwP/RfP14AzaDbqXYzkr837\n90xpNbHCXvG5lkw97UruJh+iNqO0IFG0L+5W7RMk3D3OVEzSPtJZ+WwiNYvR\nQvOcyPMgaHBXOb1ecuG0pJur1RhAb7nTNweLQUWA0AY3zvfWGKCoxJlvw9gB\n7SHOgiGGUfDPVqLfExFGWXhY0XW1tH18f2ZGEpvtPcu66JRcpMR3XHKJ/1+X\nNkmOS9YxO0c0oouAR4fhMO8yI9hRyWIfSMJBC5FHoQG0jCyqj0pmm2qxrICM\n9sfOD6nvIuno/tQNo6ZNlZWQeB+erFhGXvBdxH8NiWn+fFTKKaDIWiH56IyA\nasyQWK5krNlTnapFhMlOWBqMoX+sibFR06jaBm6fLpx03anXtgMfg9a5AO7k\nfz8MUmVNtw1eTVHw2QVLY4BzAcTx/Yc/USCAKM9PgSwd4QLrygs4VjZX6WmA\nQRpf3AFVL91pthKqAMBhHpGGnVXsM251WcWfRH6+1e73RfodBaSomwaF3fFL\naiMuL5G+vyJrLngsHxblpLFkcTxaB9pt+VrAMa0MtdZDy+gic2NDaw/b9q3B\noDfz/mNE84bo8Bow3So7aULTbhwOIduNEMet9KXT3QHUyNgrxSkl7PcjlZQo\nqeWTPwbaImtSPI65A+TiKEpwH7PlW49XcTN27R5crcWL6AlfAQyq341OvXgS\nSKJs\r\n=nMX0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjhwkPkZcKTi3CjMbLU5KhtBoTB2nN9c6tVXnao/NH4AIgSniACvZ67EkMFeSZgdYrxxcvlZgx7LRpROPLrp0z9GU="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b3081dd.0_1621634390837_0.38168739463882395"},"_hasShrinkwrap":false},"3.1.11":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.11","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"dependencies":{"eslint-plugin-jest":"^23.20.0"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-eslint":"^10.0.3","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","eslint":"^6.8.0","eslint-config-fusion":"6.2.3","eslint-plugin-cup":"^2.0.2","eslint-plugin-flowtype":"^4.6.0","eslint-plugin-import":"^2.20.1","eslint-plugin-jest":"^23.20.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","eslint-plugin-react-hooks":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"2.3.1","fusion-plugin-react-redux":"2.2.6","fusion-plugin-universal-events":"2.1.11","fusion-test-utils":"2.2.1","jest":"^25.1.0","prettier":"^1.19.1","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.3.1","fusion-plugin-universal-events":"2.1.11"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"eslint .","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.11.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.11","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-3jLvnbcVnuPyI5fNLXN9xRPP964ZTsioOF5uRkqH3kCSw3nklG9qbD0m6wSuO1UVxek7JOXjmwXxR/Os4e/M5A==","shasum":"f56ea5a8990a035310c9236a965130938d2e0052","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.11.tgz","fileCount":11,"unpackedSize":40307,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrEanCRA9TVsSAnZWagAAVuoP/2oRTZDCmI/nJKNYHouG\ntZ0WNyMRI0juUVwbG5akljvb1UVta4JwB6yqNUbK9EXJSCWBaKkvWrJi4pXu\n5AyJjh85ZGblDWSJ1OCpQS8cocqGHuY+pXxk7e2/EIQot5+/XA/ZW6CbPhAK\nb/zphWrj0UHuQM5g0cXRmhO902vssDvWGe925F8RUCNCZWWJ94dtdE9XeCsw\nGxa17eAHJ9Bs5pKtyGmXxELIe4y3lk8quhUa0WEC76XcElkz1pRNVp/rKN+8\ndblshccD4Fr5DZMmpvIYTHi0ZS06asNjLizGKL9/oFGJvZprlutkGgojet3i\nSnWsxeRXj0wN8R/N0h1gwyS9wxtfqEvMQx7kHLEdflggOO9nt52bkQlRBy2T\nqiR1yubafJ2CKGnA971UXOnGYHH4vQLNchcPXcnDuJw/SfuMX1GoTt4fF4ca\ngJ3eBDFxEIUbcohBoTYlFdUA5dfcp6ptVIWxpiNHm1Xp4aHq3vx1mxB3ru3N\ndUCZrMhb3YbYSu0ZnMMaDV6Q1SMU+htRlI8pUhxivc7xe4jybyDoQnqHlCsq\nn7ub39l6p2crIv+vZf6HxLKGFB/vRj64jgSjHheozXR96OLUryy2EBSL1xrN\ntLUj2lsjJC9H/1K5nA9RRYcmBli7e7BlgBWVjstvc7G9haPkaNjj8J/K4v2O\nAvkc\r\n=V4EO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBsW9se9T4/fQrBuE9izMi+9nNReRY5RofPteyA5ZaC7AiEAm3X0aFkZdUeq1/IfEZYRT6yuQzThEYfuIQudmI+mmzA="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.11_1621903014634_0.17920173872757883"},"_hasShrinkwrap":false},"0.0.0-canary.dc6dd20.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.dc6dd20.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.dc6dd20.0","fusion-plugin-react-redux":"0.0.0-canary.dc6dd20.0","fusion-plugin-universal-events":"0.0.0-canary.dc6dd20.0","fusion-test-utils":"0.0.0-canary.dc6dd20.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.dc6dd20.0","fusion-plugin-universal-events":"0.0.0-canary.dc6dd20.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.dc6dd20.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.dc6dd20.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-1XixsCJS+W1fu+VPH5KyyAx9BIecxR5Og/GyPH/7DX7KHj+55AJ4jqKN1Bx7T4s9t1ZK5e4kfXQcxyaSmwIlCw==","shasum":"bf6e8aa8f5f4da169b3ff4e08c6bf098f92fe858","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.dc6dd20.0.tgz","fileCount":11,"unpackedSize":40183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx7HICRA9TVsSAnZWagAAYoAP/AyQBbTNEsa/Q4nx955S\nzBuLHUkes0KOj1nxFKJhkraR1AcYNl2nQVoX4OGL3sHsWil9CGbPpTjjP01S\nAqDcJKvHAl5zNhetgzbqMVoU0PDWgVj4wBdqDE1AWjPiPXmDE5Uy+cOwqb9u\nKZqSwEbl69UeAdKU0KAX5Pe7Dp6PcOKuAs+izXJFF0yjxP6DwUvQsvOvADRW\nSpqMmnV/i6SCpXLQ9c6fgahI82IaY/vAyl+SywCvT6URU6VJjIw41dR8tFN/\ncwBG6JbYfNQnbLT0gxM9abj1OS0eh5BiUMOBskbn7f4+5PQIxyXQTUsx83Ej\nhX+Nb5NxHnVRqSsPp3uvfolpalJV/RL+QqZMgUuxfIWhhJFz76ifeepTTmnN\nwKIkt+4Hf4WQ4tgxxmDUGNdd/OGLI8fcOidXyp8BPARAcRvgiJX1TqjoVd7T\nld36wWHU8vznC+C5F8UzmDJZhvk0GUPVoqury1ThwG53cAvD5zSM5961btw3\nKhhRWaancWDwse5HO7I5MVnm6gmjjFDBBa8a61uDQ48mTe9U0QcL5Rt2tQaj\n38AnxOXhRsZVOGNXsvh99xMp3eWYoxV7K4QgoXm/tcU8j3lL4hFBzveyVu/U\nSbjVltE/glg1RCWXhbe3mkuG91q77fIg7ZXYB9iMAJxOL7+Q46L72/fJmb9X\n9YO7\r\n=wfBP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBpN7yRIYvi0HivRaZMUAzW0cxPkyK2YUawQTVotpw0gAiEA0jlUazselOX73Y9EIa5g4zjgo1uhLRBpZKgI0aStPLc="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.dc6dd20.0_1623699912063_0.10532544950482015"},"_hasShrinkwrap":false},"0.0.0-canary.66de151.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.66de151.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.66de151.0","fusion-plugin-react-redux":"0.0.0-canary.66de151.0","fusion-plugin-universal-events":"0.0.0-canary.66de151.0","fusion-test-utils":"0.0.0-canary.66de151.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.66de151.0","fusion-plugin-universal-events":"0.0.0-canary.66de151.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.66de151.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.66de151.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Tw4kwRnWUM16+7UdYBUrOmb44xBh0Y9X60JJFFaBJ/oVAjVgHGRFT+yWmVzkmF9GTVn9GXVrJL3dvlKiq53cmQ==","shasum":"43168f46ef02cd6ad2deb403d1197c3ef9ea5d68","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.66de151.0.tgz","fileCount":11,"unpackedSize":40183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyA9LCRA9TVsSAnZWagAAB1IP/0aJVEcYxMHzogwfsnCe\nJ/steXn5zOhEkdI833kbiVDrBR9tZbM044yzAwX9t1RhObbu7ef8omSiPRg3\nQT4syiTIgdFhjG9FXJ8pf4kDvjLsmRc+b46aDut/D2fRBqN/jNCbJI4GeaQ6\n+ykObNlscRmqrFDJJkXpsTW23Cj0NQJ1PUn807lbWaVltbwHcyuBP06He94q\nFw5FI6+AiN8Tqw5yCv/kgbIpqeOVqbg7gOzTigfGE3MytuHmA8s+LcHs5jjX\n6HMVia1zrOwgMjj13LczFN1dFKdhP5wg0g8ThSq0AP+EWqoFPQ/DmMmcEb9V\npEk0gk35QJfNx0jzC1z17hX0ZGkMq006u4/m8LfTivlKfKnPqqaR/ckrZgKl\nhsU/ZHzw2BnOqDI0Fk22FKYrk+U3W5Kw/CC6+8HUpdb5OUjEBvhXhV2t6dzR\np1Wy8VwPrelIe5cuz7YUQEergKIR07AFQNaQq2j66DWugaaYaJeYgadVE1ob\nAyN4uIWclr3tZzrpfJBsPXziPZw4+nlGpuSTG0cYtIZUT53i+wMSvcXeG7qR\nQBjjOpg+F8UZDDC663oafXA5JUtLfwpH1fMx9axY3qu/uH+4o/mq5DYAyyGp\n7TYdf44zpHhJB4vF7yz/ASbGn5xyXR+i1ZmSk49iMSXYT0HdYuKUTvQG54Zt\nvCU8\r\n=uIk+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTR2OCzYoWkdV3OBxBTz1LxKvyETxOyxEMKVbELIJA1AIgUja71Zm8uc4jf7ARjK8/+7jWfGQrgxmDULnvwMvyBEI="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.66de151.0_1623723851359_0.6747684492820538"},"_hasShrinkwrap":false},"3.1.12":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.12","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"2.3.2","fusion-plugin-react-redux":"2.2.7","fusion-plugin-universal-events":"2.1.12","fusion-test-utils":"2.2.2","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.3.2","fusion-plugin-universal-events":"2.1.12"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.12.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.12","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-c/UaZStujOOgDhyEFaLgak9HsOHqRbLZLDx4uKd07hHn6I0f6fIiurPgzd4JITBh6ZVLYo8UX1wpEeeJPc5IUg==","shasum":"75ce56214f74eae5311d307522a2d3acedc9d6b6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.12.tgz","fileCount":11,"unpackedSize":40067,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgym9pCRA9TVsSAnZWagAA12MQAI1rWC1OtzU3LJ8Z9eQS\nlRLUN4KVuWHGpdSrG2szTV5cfRc6whuvzHDg00JOxPNMkT608UgMlga1AlKs\nkdMCRnh9cqRIBEnX7c+yVXs7gtoRbjkhp5Eo5xt34AXOscByVlxIpKcGvyab\njvfJypw3nEvV2BZ1cMw2MvO6fnZvLqgA6s8WQmTk0PyCH66Eiy+ssPJ61Gh1\nGODTMQnvh7BZuFtXd9o35UkznJ9Nasa+A1kX+G/Ne1sF80gAe43BkBmhOQoQ\nn+p9VOCZukIaUuEeXgg6iQXercjNB362JqE7hV+lyE2boO07+K9O1dapWom7\n5zW2Ooi+5ifX+7jgiRhf1hXwmrBuB7mavD1Y5DmYb0WyeQUT5dD3ghJQwx9f\n5p0zY0hd/FupIJe5B7BtLIFHgMO1EAvJfmpDXd+/2gzFh+R0O5/7ZKDtMcBz\n9LRhPUXezOWxGJUbHzpqv6vhNbuM5VU3B5BQb0XKPMs0OiAhSucxQxkjRjvB\n7+M6C8Z9gG2PGJHDJA+KAu9A+y3tl+g5oIvT/34zuJjzyI0ykdr9aT8LMXLH\nPsQ3ZfTVgUl9Iojc2Nx733SRt6mR1YVhWix7KWTcCBtXQ+6XOLqiv7IQzerE\n/atWJwa4l5HNDP41vPYNMDUN8H2WgVILDT71NfhSz5LZse7C70+qNQ+2SjCT\ncv7q\r\n=lfNr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIPYW6RffiZRx3PIXn5nWts9LiyaogRVi1liMGK3c73gIhANwvdQstYyEwXet+LYC+WEDdPJEVimJmI7WI+iMMCAXq"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.12_1623879528673_0.6220334543543551"},"_hasShrinkwrap":false},"0.0.0-canary.cc30c9b.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.cc30c9b.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.cc30c9b.0","fusion-plugin-react-redux":"0.0.0-canary.cc30c9b.0","fusion-plugin-universal-events":"0.0.0-canary.cc30c9b.0","fusion-test-utils":"0.0.0-canary.cc30c9b.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.cc30c9b.0","fusion-plugin-universal-events":"0.0.0-canary.cc30c9b.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.cc30c9b.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.cc30c9b.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-IKRYUXdnk0x3PjNjBRgAfQf27pSHSoVyvpWPeFBE/mxeX6H6HOfT1LkZsJ+QsoHVJfPiYEtahUvbW5i1TutXxA==","shasum":"9be809ef722161fde9d7d97be09b47af84f79ad8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.cc30c9b.0.tgz","fileCount":11,"unpackedSize":40183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/2QtCRA9TVsSAnZWagAAAT8P/0z0G3ItBj/cwH9gTcRz\nJTBG9faRhZL733swGTFjawUHcFu7kjqgz9FOE+jDYpwiQeoKI7dNlgIgkIDJ\n2gFq/hA9fgUdypbQnAggeVvm0boZJZ9BNDA8Jo1myKWlq2mR8RLsCBibEfLo\nr5KtMLnRAb3qDMYZkRNzYS6baYgy+hKtSvPiUV5u5e2CpwAXCpyxhEs+CsMJ\n5hVdavCmb6Ka2qnEpclz2ONT5oscdWE3vaWZz7cvFHq4JIftaQgZKfxlB2km\nRWMWvKEN0QA6HcQ8ZhvXcbjfqK4ihnYxP/bhpcXbsYsOpmjhUEsD5VwaPKQY\nK2EDrWXhLQDjzhdqIhTzJseUWeDlW9R3CdEtnGAs9nD3rOiebXpzLCg4HCtl\nBjm10HCJni6mnxZjYgWgBCneX5CzETSNi2/k4nE5hOaYqRIOeV/1NhIV90Xy\nMni5vmPWA1IdjmOeStF5PO0DDyZBGMq91vU0TyMxDk6hVew+MPv0/hQB+xjL\nkApQcfJXtSEXtJy3IFeoOS8HqDzN8N2M3pMOxg+VtrI9DbhXUqBdc1D2kxPt\nuUk0PH87fEhRbgucbDR+wKkUTp5jim0Mb1OWhxPKqBEc1yG57By0e/mEKYwK\nv2snpeACEZPMFSrsy3k5cW3SgwGJdvnC4H3MIGXfiIAqIYFuzacRDGRWcpDk\n3fMZ\r\n=wSzE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUY8LZrlrwf3gDNvcG0K/mFOFpVHRlB8vmMXAJJKXZpgIgXIYh1y5Osrw78KaGSzMVjHT2hiUkrX5sqALX0dJiCW8="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.cc30c9b.0_1627350061160_0.2508689448292969"},"_hasShrinkwrap":false},"0.0.0-canary.e5a3019.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e5a3019.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.e5a3019.0","fusion-plugin-react-redux":"0.0.0-canary.e5a3019.0","fusion-plugin-universal-events":"0.0.0-canary.e5a3019.0","fusion-test-utils":"0.0.0-canary.e5a3019.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.e5a3019.0","fusion-plugin-universal-events":"0.0.0-canary.e5a3019.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e5a3019.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e5a3019.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9QC6VWwVoRR+QBdPGjr+DN4M4Tv2GxjodmIj/30NAfATjtgDGG06CUztQS3qy6FAVjrJcJMJpawSRA2P4We5dA==","shasum":"95804fe4107b2efbabc318db25895510e280c55b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e5a3019.0.tgz","fileCount":11,"unpackedSize":40183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAJjXCRA9TVsSAnZWagAA4hsQAJdWGB25UleGhOOSphLn\npjPjmXWdeAps45yIMArmXg+gi19T621SM8bsvRbWNtIMIkrWjKhp3rtgtsaj\nbS5KybKWn5JbmmKhIcrZe7hIZszQl962lFJHKmZsP3NgSYDssF96IgN8TpyU\nKr1DQKetyiLL1wbuQDEfTsVnfq9VCNHVug1o3kNyEQuuSJudaFz9OHw0V31X\nh0c7pK4CGKZcA0AExmhFTaRlNCXToo1p9zAdAgIGJT1q0ZwLNEtwAWt0RjMk\nntO0mGBx5kp4KphgzbtGoQRe+CyW6Pgqo/wemcRsyTDBX1cj4RXjvPeIHoWQ\n5ZgP2FuC2ioVts3q3QDD8ibTMpOUk3quSa1gMld/Dlsqklxp0972ff2dK6PX\n0TXEmc1Ac5/A+nIGJYdd/UwdnA8885b7kGR6RcgV5gKEpC7bH6SWx/2xiWHJ\nUzj7LCeqxSnamewLoy7z7raGu7/45Xlo7mGsLtne81eMoF1FhUCPo6vRxsGc\njAsRKnpvgPU2CjjvzJDBUfS6UA/uKrkJugeARJHjl1Av9Nr29dGocsQqwQlM\n83QwbPnD2EFdmi9GeHE/StXV1avXXnVtegHn2r+iuSLBunHXwlqt+uVNlUfq\ndeR/D8igsAjrpQl3NXSXHsRH0EyE0uW1cpa8Jn2VujjdFEkY8cMvonWsf40K\nrl26\r\n=otxf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAy+eVAt9jV+1vn7nEVkPJ95wS2y4My5apWc9cU2nKejAiEAkKBAwg697hk3+CanlVyKJ8I8H53pvLElPqVtj6uIwJI="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e5a3019.0_1627429079152_0.1973111540452932"},"_hasShrinkwrap":false},"0.0.0-canary.74b8151.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.74b8151.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.74b8151.0","fusion-plugin-react-redux":"0.0.0-canary.74b8151.0","fusion-plugin-universal-events":"0.0.0-canary.74b8151.0","fusion-test-utils":"0.0.0-canary.74b8151.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.74b8151.0","fusion-plugin-universal-events":"0.0.0-canary.74b8151.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.74b8151.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.74b8151.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-JK2yFVYT28/zZ85aDgODO2PpjEvumwI+gB+5jwQp9bBQRJnYTjkPYcccfuRvnm6HkO3yc0EUnlDXjysg23EqTA==","shasum":"95dc3084ce58c39bcfae0f4c22d23b8046751b50","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.74b8151.0.tgz","fileCount":11,"unpackedSize":40183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhALRYCRA9TVsSAnZWagAAd5YP+gOYgzeX0IMVblT1LBjz\nLgiBzoOWHUksjSOPcKtILD2ioqvp9YRrGsTMI8iVq4ZOTRbp69uAwccrGrMA\nMpsa521eWbPYu5qtN88M/NEsG3uMN/Nmxy3gdD5owPRCD4kdYKc6myUN+uzB\nDVCNOfUJE5iaaTz2CH0RKSs8KlHd4PA/O38rJDenWLGbCCKMveEQ3fFtLndi\njqyiKRv6wIC0zIcx4O8yBtcfbIv/IKmIizeo/mCFFWlTWQn7jxdgWfblypar\nDe3MV5Z3T3a3UZvMWdnyeui14hQCB0o/Y2ZhK7CWc2YtllWKFtwNfSg59+9n\n4tbv24uvMoUN5D0mPmVLW5VGXX+i1LUWIgCraQEbr8asTxeecw8u+1RTOy0p\nU9XBTPS/Zlh82szCB1XCXcDy+o2X68q05pb7Z5nQSXuCUDiOBO1cKuASJHi5\n4RrIeiTVU60lEWYyxjav/Hdld7fKZwGnkMgH1Hvhz4YiOXOrweMkm/TPeFqT\nu0MJUp1XcLa25TGJcGUjlZK1KrmUtmWuD55cWDqNx4v9rx921BlJ7qlarI1Y\n9IrwQh6mJjGHyyj+Z2gg6Z24WJ5pPujG6y1DFl2DBP3D+KxOmmflzksz3bgs\nw5mfH+T21BtB2avqJi8InIaj8U0q6ChTBtHLP5au/i9MTFyPu2CDamLyGcAS\nQLek\r\n=BAk2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEiw6lFsqsnYqNLD/aypufvLI6WA3cX5WzYo8Td2BKrcAiB8LRIwCLcv+wKSwLmNcHZIA1M3v11w3eAQsMkuSU76Bg=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.74b8151.0_1627436120288_0.8089434846901609"},"_hasShrinkwrap":false},"0.0.0-canary.53b58e6.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.53b58e6.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"2.3.2","fusion-plugin-react-redux":"2.2.7","fusion-plugin-universal-events":"0.0.0-canary.53b58e6.0","fusion-test-utils":"2.2.2","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.3.2","fusion-plugin-universal-events":"0.0.0-canary.53b58e6.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.53b58e6.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.53b58e6.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Ozk6i13GmH5CRHDWxY8le8Z3BlNhBm9xHsUB/1Oa3+v8T8VUdJnjrcHisLSeL0LjoRfOG8sWlXkOpw8BrGczNw==","shasum":"6261f6a3f541c4cd3572b8c4065716fbb242ddc4","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.53b58e6.0.tgz","fileCount":11,"unpackedSize":40115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAaE5CRA9TVsSAnZWagAALckP/A+jqqCm2we8yWtoPmy6\nR2/2xH5zohK4tNlS7r5pC7udFXlLk7138SOw4hsjNx00CROoV/wh5CDa5fHo\ngQQKLKZI7vGo2SXOfSCffvUC2aN4aimdNyyGqubn4V++sW3EHS4ZV6a0wZUA\nwj0shXSFFR95aIjR3Fdtj5+AcBMwbBRvpoDfQ4+0eb5gqRlq9yBQwoiOM286\n/FqWN0aQaHaBmghKCSvTCdZeOi1YkaEmJsakcwwjF97eTfQUimJnjz23CBgC\n+I0dNv8IBLF0dJ51LcRQhfGrAt0gk2aGDDdC8iQhWJ9MdPcaUwOHfwewW2BT\nWP3NqbwuMv1H8x7DkQhIM70Td9ciY6EEDSNZX9I2XHuXUx7RXYgII5fM0LbW\n6HpFjgzPGx+SW61TKYB5K5qY30uIvmksDSg3qoI/DSoqk6R+K9ceVPmsDL+H\npAg8TWx8LQMd/V2WjGIhAJs6OjquNmsCr3G8o89KO6TfYcztiTlNqCYq7ZRg\nZmfRUnW9To4bNIAAccBo8Ee8O5wkDaC/AOeVNnqNeESimmIz2vlyUPxo0HKc\nSuc/U9l8YoDlwQJlub+ABszxVY5yWdYlpzAcyN049kLmWHepTXBObNyu+8Fv\nGlTpQVX2pZp4jymoIOoLYrH2J3ZPQbJzFhiDofvzfxaRKTcjCdr+VXzbZV7V\nYROT\r\n=CGkM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAbhH2ECJeY9bj03gWohOJGceT4khuGAT30bhVG7FQA8AiEAt9DrppLx504Yt2V3i9vjOBpuF7Pxk72oe0WGbBw+92w="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.53b58e6.0_1627496760850_0.2768538432967036"},"_hasShrinkwrap":false},"0.0.0-canary.53b58e6.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.53b58e6.1","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"2.3.2","fusion-plugin-react-redux":"2.2.7","fusion-plugin-universal-events":"0.0.0-canary.53b58e6.1","fusion-test-utils":"2.2.2","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.3.2","fusion-plugin-universal-events":"0.0.0-canary.53b58e6.1"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.53b58e6.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.53b58e6.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Emvv5cuuAUoODaJhw/E43v+N5laGKQp2vSYO5yq1rWJU9qXp3s//KnsfQhxCMrcMMv+wdxpJJuNHNLueKZ3nmA==","shasum":"d6ee8a8a103aa153dba3bdbeeb8282f7eaa3c88c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.53b58e6.1.tgz","fileCount":11,"unpackedSize":40115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAjX9CRA9TVsSAnZWagAAgNIP/RtyL9VDAQgt56pg2BV2\n1aRGuv8Fk6Ly5lAbnW6nDV0C8DTZAjP1v4WCOniAkKROMHadtRtiLxRRkQ9y\n4q5/H6prjqrs3pn2YjG/aAGwtJ2RtMoT0oB7YlVcjOFh195YCNQ6G42ihXXY\nvnv7ys8N/PYL5PLxvFaUduYchi1f9cJ34Av1k9cxCdeQZI9SUGFrNUfIHsiX\niiXm92vD2q1I2XaSKDFtNgkjH2pTkzq/AdLg/Gl4UIwRU4XNMpzgGyeOullL\nh1wCSZbot/QZ+iC1WPrHK9G7RIOo8kmPr/AOSpCEpexOvNgmT4tJs0xndQt/\nOwxv/tswcyISIzeKxYvmGTP4K1G5nMk6Csg3zc8UI5Y8xKwa8fs8Iy9vRXLA\n9BNAOjnyHB19tvw6zh1+3UfTpitiqu4m96AmcbqMeGbia3wfLigUBcS9QRNJ\nPb/DzieF7fDnV863MzKgMpgCcSS83tnVeJLAo/aK427S4XDC8BGYvnRRjwBQ\nnGrK42yddeISwDATHd2NJDq4UltTbycmI8zeuzTujkAEMoU7uOlLAhmmamqM\nvD/rCKsBoI61ro9X/uPf03q5/RlHYp3a+seF1AMiaNPMZUFA5u2MQCwB8QO1\nCqk6no8+2HxnD739tP4dZJvcD/2/ogyNTh2xUbp+KUKW2/6FqQISJm05mdVJ\nakwm\r\n=zB3C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbImQpZ/emuExPvpI0xPVnjLTYtezXrDXG5//BORY40wIgBEE30ZDFCUfdiavG0cFQfqwtPj4Yf71Cp+SzkmAGKXU="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.53b58e6.1_1627534845669_0.29635055046631376"},"_hasShrinkwrap":false},"0.0.0-canary.d9ecd19.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d9ecd19.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.d9ecd19.0","fusion-plugin-react-redux":"0.0.0-canary.d9ecd19.0","fusion-plugin-universal-events":"0.0.0-canary.d9ecd19.0","fusion-test-utils":"0.0.0-canary.d9ecd19.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.d9ecd19.0","fusion-plugin-universal-events":"0.0.0-canary.d9ecd19.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d9ecd19.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d9ecd19.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-HJLmHkYI7h1Q9R4cTaH9pmNHD84UV3s2k+xsW8TPHBVYw+EjqCPj+DJGAx8vBZXniy7HuZE3Il+jt4GhIQR8Yw==","shasum":"5eea596f3ed65d66aceb8c908e34e31ad182f16a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d9ecd19.0.tgz","fileCount":11,"unpackedSize":40183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBEwKCRA9TVsSAnZWagAAO7MP/iBich983duYOcDyURqE\nWYN1RNqpCAw7WDBlraur9p/YJ4BiyloLmWNp1plEERiHmHVzAEcZujTMa4LV\nNK6H1l8pOZ2euphpQ7NKHb3L/LJ6uKOpxAWMoHMZTiuOC4qE4kD1K6inRvI+\nHxV2gTx7Al6szl6M+h0jV3+mAXgNR1vY0c7PYERfdz/6oaSQ6XmIpMqpNgD2\n+wO7Fz49X/v129xmTzJsMMi3DAQDcsOZBUTIfZFUwOJRJiOkJbstLmi+xulz\nTSOtUgMiayzEy3P5sdXE7uIJB1HfcXtNSyTeLa9mv/0n/6Qr3NgJTD0cSMex\nCtIepsp80SYvX7jm59O4Kcb5ldioZI5qZGusAbW7JCNQaJZRzP2JhzL5pC/t\nU6Xs4058GpJgoj6Nm2P5BSQ9DrZ5ok3j2Th3PX6KcgB9QwDK5PM8AWrWAUUW\niQqXH+RyaaWeaLQNS84xtGBd4OKr4TC1a3eWyEbDyNMNgS/Gsnv89BGZbWXm\nPf9OzuVggJx6BJsGyhYMH0fk/mOPwhu9+az+gwmEL4AgyBbguSdr1VAq7eOJ\nqsAqYrbDI7yYwB4KYXBCXOHOUy0sKqsduLpdBreqlX5lMAtxvvJ5jSquCFzf\nAnDVQW81Kjd93KGH+nOL6DqjFdZXpkIew9KzbXmyAzc/CTwDqrP0486wiNng\noG7D\r\n=9fsj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAvK7BXha6iB21IiX+DqfGb6GOXeL9gacS6/HifAtUkAIhAJe9cA/T5APd9la+W4uDpZdWZ+TeKICnxtxMxniecm+H"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d9ecd19.0_1627671562171_0.08358395955822417"},"_hasShrinkwrap":false},"0.0.0-canary.f0b60b1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f0b60b1.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.f0b60b1.0","fusion-plugin-react-redux":"0.0.0-canary.f0b60b1.0","fusion-plugin-universal-events":"0.0.0-canary.f0b60b1.0","fusion-test-utils":"0.0.0-canary.f0b60b1.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.f0b60b1.0","fusion-plugin-universal-events":"0.0.0-canary.f0b60b1.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f0b60b1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f0b60b1.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-S3PsRLcEMFzeTCJa98Jc/4BseRSVPdD5VKxexaLmr15hd0HT45ltbPNl2v04xLk3vnW+QueaYYX6MwfPjVdZCw==","shasum":"32320188a57ac14b13cf646b617cf14426ed4cd3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f0b60b1.0.tgz","fileCount":11,"unpackedSize":40183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFZ8qCRA9TVsSAnZWagAAfaQP/3J2lHL3JrGyLAzh3aoN\ngvwmYO+2pYY2R33P4X0bunFf0VGrlKp3sFFN+h8gd1VJOgZThH/kRNq0PlXU\nBwVeq4YQpQcEHTDKvciIj9R+oxKHGz0sQHkj8cLXbWoWJjDz71q0mzl7/xfN\nmaZXuhzdoL2gXBNJs7ca8yi/vgNt4BSuI87n1Bia1QBI/ABjHGAogcblSZ+C\nmZwepOrpXzxiJzYqhQA6NrFNA7BqnXMwSFkwvLlkWAOO6DoijUQ0j8f5QupT\nCPELijoALzDga12IwR2pl1ZFKQ9r4OMSAmkaNHBrfZIxm8rtjjDsIQnXGA3R\nKJGK3C7bymgDs/aVRPLWM/iTtvQ3GO6tBZRHCA2Vy2altrhHv9zhwJ7NHwFd\nZWgQD8GcrGklFzkaLeF7bkWpqw6ymjfvLASa85g1oMV0ZjTWIfP30mDZoyaF\nRdZJWuDLKgYBWZkIFaKK6+nY9MwqEGCm1WQsNXdAc5Y5gPPOZ6iFfA+P6pPw\nS+SXC0/dAISB3rOc0agzQxharAgeO5PBkzAXJ7lzT8Scb9GnfbZli1cw4dOO\nJMgx2EHOiy1vMYN8V+NZJO/EVXaWH3yDOihbduDi5y09cNcSuM4SoJ88PdaK\nFxFdcHpvGt967va+QkgXVAMybzENJErkNykGbmdnqEYTGh8VsngsEuu1xumX\nfSYm\r\n=ghm1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF5d7V/bceDSSIB96MjygVq6nytw/SBnRpv8+E/vY0jVAiEAww8NS42rNMs14kn23dIyHFin5aWh6YlQl9i64pT6H+I="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f0b60b1.0_1628806954027_0.7108312593343504"},"_hasShrinkwrap":false},"3.1.13":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.1.13","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"2.4.0","fusion-plugin-react-redux":"2.2.8","fusion-plugin-universal-events":"2.2.0","fusion-test-utils":"2.2.3","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.4.0","fusion-plugin-universal-events":"2.2.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.1.13.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.1.13","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+7jTPSFkcPydF42p8XTPvB5+xlNjjVpcC+UYWzXXyXvohL1RA05jCoFa4e99o7O4vYzchDKRHg7BZd91Cdih8Q==","shasum":"d32840fa6e3b9b129a01b7cf579b01486201f350","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.1.13.tgz","fileCount":11,"unpackedSize":40065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhG/RnCRA9TVsSAnZWagAAiYEP/1vaJLoyz4rqSjkogHG5\nLaeNY9TX6AE8NiRcyv1bGIDziuvc6Osvwrrs7U6gg4hvbzdG01jVaoDqU/Kb\nmAzZz9tHXvpjGBqxvUZXCdOGHykc4Uzs+38ufetm3T50ij/flYrfJxZqvTuF\nOr8ejKtGtmnrqS2nIoaXL8PMONoQLC6/KZ+ChYj6ASJVfQ8QcUwSvR9KAE9a\nkbB0kW6UWOKqXG9Wpi26AZO96y1t0S1J7ZBm4KVha+0qXIWiZ+zOzmy1jlID\n96NYk6s9npe25PsPiDRuf8qgZ/m07TUrgYarhE9AODL8oXkc+4k5tv1B++Oz\nPt/D66h+HhQpDC8alyVtFrfEcjIrBDJggxCu0teU0h5ZubiYNmsz+95SRpjG\no2Y5UC+90jojcVDzQAtzH7cc2Fbceq5yt/vKzBlMldRVWSFJ9zIR9AVLSEm1\nwXhY2KdhwmwoVVfgtWCqC0sY8dxXxmgENvy3XR4mtUxGdWNyjP23YbnnpE7b\nFhTQp5GP3iO9FdFvGkB/YXehzuDC6zOOBdVe/ApzXZMHE8d7WmfSvSA9nUse\nm7bv/NJtwY+MYtSfIeioruUeoiivUqq/amm9lrUNYQU0lO7a0QwLNfVxHZbq\nt6ljER8qz8VUOLYaxVy6GmOs9zdgpYsBREkUSmNgBQtsPWKVbZ69COjVagaW\njaWN\r\n=Nlt4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID3nuABw2oBYajUxEtvfSu3qvzxb/VMgQu+W0k4M9+ZsAiEA0jBfIaF8Gzizu6eh6xjqqJX8a9+S3++wP+RWMiOa6eM="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.1.13_1629221991477_0.7852192553995063"},"_hasShrinkwrap":false},"0.0.0-canary.0833d86.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0833d86.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.0833d86.0","fusion-plugin-react-redux":"0.0.0-canary.0833d86.0","fusion-plugin-universal-events":"0.0.0-canary.0833d86.0","fusion-test-utils":"0.0.0-canary.0833d86.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.0833d86.0","fusion-plugin-universal-events":"0.0.0-canary.0833d86.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0833d86.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0833d86.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-orZl0ikX74Re1LJpauQVgL0xIli7w+M6eDEJbQivatsZi8G1RcvbxugR1eHJG/CvCKT06PMUncG1M0LGdYmvOw==","shasum":"46233952689df3bef4d94443a1d41f41ff89eece","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0833d86.0.tgz","fileCount":11,"unpackedSize":40210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLm1ZCRA9TVsSAnZWagAA0tgP/ArC02TPgWYHYs/TYTHg\nw58GdEDlGRY1n7Z+QpjPEMHwoFLLBQrzKYF0sVGLHnX3v4pDMILVh3oHvPvM\nbJ78wePbOIYbAF0gzgTYHhsUzGIAwOo5myuwBS/xhohafrUkTgnpSrhPqa7y\nzWHGFI2+Trb3emcmuVGVuNSLISS1Q1CCSnT+bkKTISrjS9TK7FkhVt4/HxbL\nvpSloPUCuNA/fTe1UrnPNGffzeCnt8++hzzoQxb8YVJdgIzldkSI8X+paPTt\nr2dRqFyncDd80NSzj+XdbnK9VcbjKA7k1JXQM8yJhWEvOX4O9s/lb9hMJd37\nCNTbpodIxnMyuhRaIkp1d/vN5OmFov/RWVtYK02dIsh2xvm9z4GLp1hOHu1l\nCY51isF8t2l8tP4o7M22YFkcq7PSTiz55oPa4p4a8yLWZoZCEYvTkChew2oP\njLBVx8c2JCBY60VzwB+8h2mmIzhkjvDeD1vvmGLeooY42FId0s+J2o3yXfVW\nEKtExTdF8Cr0trVO4S/o4LDWtslZQhFW3VkpRfWjAkY//XrxsGMejI0ZhRDN\ntBDTYjWnSRV0oEZLSZy1N/80awRG/7aKEBnkbpG/MkCTDObKweDAlfziUC9B\n9mpbHcwDxneGcuWW2tes3UjWneC0NIs+iqyciraeDXUrMwsc2hZNJFWG9P9Q\nb8EW\r\n=ZiTO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIERkcJXBd8GJ5nQTXCqdYGrD7hZ6OhYvmtNmyRiGy9S3AiBOBF7UUBRo04IdoDZE4B16J7Pg9XtoYNiUdT+vV8Be8g=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0833d86.0_1630432601096_0.6835744511419248"},"_hasShrinkwrap":false},"0.0.0-canary.009cb5f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.009cb5f.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.009cb5f.0","fusion-plugin-react-redux":"0.0.0-canary.009cb5f.0","fusion-plugin-universal-events":"0.0.0-canary.009cb5f.0","fusion-test-utils":"0.0.0-canary.009cb5f.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.009cb5f.0","fusion-plugin-universal-events":"0.0.0-canary.009cb5f.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.009cb5f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.009cb5f.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mCTx6UhylLhASgvN/lxLJ1HWxcUTNA8DEok8Pg7k1pdnz28awCG2BAn/ADQXmML/drMAiDnAoAdlo+F+vcLfnQ==","shasum":"cb647d605411daa0e5c0a739d70795dcdbcc93d1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.009cb5f.0.tgz","fileCount":11,"unpackedSize":40210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhLtWiCRA9TVsSAnZWagAAFxgP/0DTTFzJnCcrDM2XJgF4\nBLMk8a0UCeliVc57bct/ZLhg1wyD0xv0mTm1cZyYDf8hXlh4w0RGitrIhIDf\nufffN3bUElVFww2q1hiUZ1qI2BX/yrpye0Kj1Vr0KUVbfqBmz4RKL3KI+Srs\nMPnpkJqlsAuBvSB0fCcMLUIrRRoevKU/dCOhahSJcEh0111Q2xUfAvegf/2q\nq6PXqOE29ne0zxA14XRr2NYBP8hCqzNOfKSjgNH4Xs+MW1GdSc3WU6+KHMBF\nUPy/Ahvc4PS5OIQ8CGy6RbQnEy4bBNaeuwnjvxcPI5RuYh2BB5xi5h7rwhDx\nwr1lidDKv0M34+NnAiNcMZz4lHGQuq/g4jaqa9/Qsg0BLZ0TBtrBY52JiqP+\nUAZVc25BD0wB1irXDW4i/VgmZ0rO1ct+DcCu06OLBLVa8Tt8ZZF/aW5jWCrg\nsavLD1DFfxbbWIULVueSxRu7jC+W/J5SNF4G9jDwRS8eo6R5gyU/mEh0o2uv\nx7gnnvfau9CYp+FEv8LUfMSIZUii2gW0Lr3B8trFA4VE5pYDWNGIVoPRzZM7\n1eW9FIrR13GFUw5fymZlTcIZgGnHpylqsnCgiXYnV8BqbaFwCOgYaAMTdnK4\nPEnKX68P5G8h+ClOC7rh08Ib3j6oI+bvtfy2uPHNri1QtmWVm7OeFMKnYhxV\nc5Y0\r\n=1073\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHZ8FyBGwx5LFPHgx2qe/A6b2dMW7YvAHFMYjNs023P0AiEAorL+JmDbl1XL/A0ZN0gF+9djxBghWWhP/eAGNQFpQk4="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.009cb5f.0_1630459297957_0.6681345073234792"},"_hasShrinkwrap":false},"0.0.0-canary.34f1f86.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.34f1f86.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.34f1f86.0","fusion-plugin-react-redux":"0.0.0-canary.34f1f86.0","fusion-plugin-universal-events":"0.0.0-canary.34f1f86.0","fusion-test-utils":"0.0.0-canary.34f1f86.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.34f1f86.0","fusion-plugin-universal-events":"0.0.0-canary.34f1f86.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.34f1f86.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.34f1f86.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-YrhXHNKYewc6lr46dp4VGcqtHCqDYl82UY++8ILmRFYbL2B2TSv6gSFvnhFESQmYxcyYS3iRlEVIk1Ur7DXiTQ==","shasum":"3ee1c4718660afc5d59612a246568e8915561abb","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.34f1f86.0.tgz","fileCount":11,"unpackedSize":40234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhL+trCRA9TVsSAnZWagAAM8IP/1UBbrN1JFxom8M0iaue\n7+0NqRLmSk64AwkYUaxys3oxZMzHNAaiGbVbhMv1Dw5b6TO++6W3SS8Ey4ch\n+Zcj/HnO1hz9YtA907coqZTfXjVT89NKFAEYk/KzS17yuhj3anq8ER6gp0LB\n9aQx96X4qr5e2AtZW2QUUo5XHPlhDXeD1BfLDvjQlQBTWwZpIFrdQQPRuo19\nMeU51aAzv5RfZGmSyco4NHv4oA6MQrl18CgipAdF2qA9y2+Pzt011JalzmPA\nYY6xDBE7DUbIIl2VwqGbR7s57YhCfO1vRXDa5DAyX+POnGdvPRQNnIwYR8gJ\n2DC8YJuUne5T7kgx4V5pO3n2rLL1Kk73dR7R//3B8m96wLvGksrc0VrlT2FV\neXRgSX0ogAvEVkHeSWUykIgd/g9dJbn4XuVKrL6fHJwcz5oq/D3qXAGL/5RQ\nGINwEEwTBBoC+lg28xtgVpYzX8HXC8WfAJSwvzpJOBqfBpwv0d0FblodIKXW\nKuOigirVvB3VKpMi+KLJtoovnSnN9PK0I+sBYqtiyKC+He3QaHff/hebRvyW\nBPtOO2LAqe357vJXq2meN5apnyIzmqpcxlSOkhX6LIXutXYhNVPGdkBYEDqF\nbhoH62ZAp5LPGTN192aD6mnItxD1lmCCUdCNeQUGr8vhPrZUl0/QigysCDd1\nU9Sw\r\n=KaAd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHFNI8x4QynA2W+Ufa0oidwbkrTcxV/p6Hj7Qdh+HRjdAiEAsxiZTsi0G8XWvOosVewAO/3WdDaA/dwCHLChDTtAHb0="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.34f1f86.0_1630530410909_0.4243419286748471"},"_hasShrinkwrap":false},"0.0.0-canary.0f75d56.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0f75d56.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-flow-strip-types":"^7.12.1","@babel/preset-env":"^7.12.1","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.0","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.0f75d56.0","fusion-plugin-react-redux":"0.0.0-canary.0f75d56.0","fusion-plugin-universal-events":"0.0.0-canary.0f75d56.0","fusion-test-utils":"0.0.0-canary.0f75d56.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.0f75d56.0","fusion-plugin-universal-events":"0.0.0-canary.0f75d56.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0f75d56.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0f75d56.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-EG6dYa7RGrdhO4CgxubtJRQjzXM2xrEKW4QQsTPceKP4sAF1bhseaua05FtPrT4xgEaNxR1wfg6vZJKWQVqaxg==","shasum":"9efd7dcdd5d505d7b0275859fb305c32833817c4","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0f75d56.0.tgz","fileCount":11,"unpackedSize":40210,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhL/vsCRA9TVsSAnZWagAADv0P/iggbPQxo+gEE2L3g6aU\nTFmirYmEmg/cEMoByzfOVyFwZUKT33Rchr4D3lac+RxqS55a8cMEgwpYNmlT\nXIwRLZjBtpqYTC/Z7Kgs/0qJNDRG9VgiBE6CuMTQtMDZkMc8CbAGZfehTRp7\n09+0p5gZtyLUoiHUiO1ZSZc0AfHWYNpvPOQTmTajiPDrjbEZ0Qa41fVQ9uZd\nQjmTOldPjr0U+x0fOV9HsWDO3ee3cFh3DrpQ8Qew2lwWBUTihFSEui8piS3j\nw6WCiaOPWAdyts8Nx7SyIHTpl/Inxi8l3wjAeFwhDff3lXBRgu/jDJKqamKs\na+wjc/HPik2IrSH5Kd52PEwBnzSHC31nwuRwGBt6px96fFEg3g7zqF7uV7ZE\nOdzWwspbal3EvkhboUi2+eR/Dcn9ChFJ4NlzH0s3kiGlyhQ6X0XMkPB7/QC9\nyVAUjbCwI5yxewXx285UIzJpHa5IhNUwyxPZnIaSlc4j96oge5AKFn2Hyo/M\ncaiefhZnimGKDv+4by+p5V+K1Bs+YLk2QNWK7gKxBjfY208OK5QAMTGaJcYA\nF5Up2iEbl8UUse3dLnfGR784LBI98PfAqVr3SIyqtfMv2RtnXXoquSsRxjgR\n5f06SSpLcBOvdTyE7g2qOyzRINP3kVs6F7Jb1RNsTpEX5eKCZcVXov8T15Kp\nhNsi\r\n=E8Xx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEvCELBnVx1qnJhXWk4g1ZOODkek2WwW+A8WNLTKMktmAiA0MIk+gnnk5/A51F5T3IW+cTAyJ2a0PNgzYYPLyYNmwg=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0f75d56.0_1630534636608_0.16826139730432832"},"_hasShrinkwrap":false},"0.0.0-canary.addd6fb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.addd6fb.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.addd6fb.0","fusion-plugin-react-redux":"0.0.0-canary.addd6fb.0","fusion-plugin-universal-events":"0.0.0-canary.addd6fb.0","fusion-test-utils":"0.0.0-canary.addd6fb.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.addd6fb.0","fusion-plugin-universal-events":"0.0.0-canary.addd6fb.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.addd6fb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.addd6fb.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-7ots/FDq5d6HLfpw+2TjwIAxPqlwxYFEJZ33I5RRlAklHD260LAZK9tnge/xi2K/fd89BixpYVDkikDkr2vEOw==","shasum":"9c8c3c43764c990ea776e9d1b51671e329995a0f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.addd6fb.0.tgz","fileCount":11,"unpackedSize":40234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMCDTCRA9TVsSAnZWagAA2YMP/0ncnsifcuXjkhGtn4AO\nQE2nMeae9hCwSvzJ+kiEtryVxscBoy1xXE3fJxdwOG/x+QWhYZye0cmxl6L5\n8q9UUVIkVevVM/kIaqLAfAa4aYj1RJjJO597WIQU7wSIxMsFs9bwLuC5fCN0\nVnl4fe/eQxSfEZGZHtEbcqrwAGMcUDn54INt5WTR4jbVZ7T25t64FK2x4KKG\nfF5kZqx5HXcJIHK4yIFDqXBq6b/UZEDenhZJXMsrnzt7ug2hfecD4KPfGHR0\nV7EZH/QMg50dqna5wvwRoR/lnTkSOwk/AetPf4r/Lx8BusXReU8/6FY3FQeX\n2JNMOZ6W1GR3/ToleCux2ZZWpfAtG13ZU1sFGahMsMvc9jGFnDczvZdODY9T\nwISofiAje+89DucGT0VJar35sLrkbObVHfzBIk6hvVICs7ljtSu4c4Kz1xyZ\nlBakjj/DwlJl04zJWb6+rB9YLja3rqFj2TbuJ4q9YrMVC6Vw1l4HkKfI3FKW\naOf5Yo9bsCcp7lxsGDUvS2jG4ymheOpBD2IVNysBMOe+VZ4viryi9bamdjqh\nSZi4+Cvh+Zf3mCLuv6MKX1/EwJdT+w9qG4xscRm3N5d5/4P96C4YCwV3B02l\np7CsJtnP0kHf0Hp4M1Eg7c5/blKzF1PSJysFv+Cy0lczfU/bXYdphaB9h825\ne3WL\r\n=4zVe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHpebkqVdNKTxsS8Rt7Z14UUY2G/7UU5dTT3tUdeImuUAiEAgHb/YbLfOR3gQrTERN4bFHH+ZiH4uxOe9DHSRrj38Yk="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.addd6fb.0_1630544082987_0.821204665802433"},"_hasShrinkwrap":false},"0.0.0-canary.e938140.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e938140.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.e938140.0","fusion-plugin-react-redux":"0.0.0-canary.e938140.0","fusion-plugin-universal-events":"0.0.0-canary.e938140.0","fusion-test-utils":"0.0.0-canary.e938140.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.e938140.0","fusion-plugin-universal-events":"0.0.0-canary.e938140.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e938140.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e938140.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-p3VmJLJL4p8KnJMcsWCQsYvR5ilsIT4nv8sF4FXLCErrl/n0yYeplQV2T+Z+8KOh9C7DHgUpXcv/S+tKjzQutQ==","shasum":"074f44baac8a6a7cfc410c921aba3f94120c7c4d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e938140.0.tgz","fileCount":11,"unpackedSize":40234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOPFlCRA9TVsSAnZWagAAQ6gP/iDphP1isE8utXpTXncY\ndcmuWLJtrzLoL+k9t8WIxucOlKQ/AB64xVPSxn4dFA2B8NXOAIMRKaQzfoTM\n/hyKkAct3nIqp74izHC+V4aTLQOTWrC6nLCNMHspHhZCOzrXGTuJ6K020Equ\nCp3ngFgwpvbqmOHkDVaiD7os5JFmuB6VQONu25a/AKH7dXHw+3U9g6avYE+G\nfzeFISJC0pGwI+nzmjMRMZfy7qG1ox2D3Uop+hPhuVveoQLzCFXGaGR3YnAn\nLXTogJnYjdXoRF5brva//I8K9zWS7Ko/83BwdxZQqz01DHlu5JZEW/ob41vu\nXrIkc9Wlz/NbM7j5oKT/HnMlT0rQHIpGthMXjtOYrmkTRwtFT09e1Es3MyjY\nD683A/Hy8biGVwmRCs4CmHGGRgNEZ8CMmrp5sOyFNQ9o3f6ubNH03sfOQXPh\nqLuEJlXz8uxFvucp0bx/upNQvbbAgSR7ohZUKeHpopA4GcfkjvwBdHZoVkkU\n9YUTU/tP5HhEScTjYgAG3X6ZnvGzrU0ZECFN0x0zjqLs98hC1VnGWc6GgoHw\njOh02jjJ4RjNZ/MdCIDxKtWCMgxqYDpD6nUYw/5YZ41T3SkmF/F7ow5uAkXW\n3Ar6JUo9s4KifAIB+NY3T8BcamYxrK9CMnbAKw59xtEVdkrMz8kyZGOOlvXv\nEOc6\r\n=KOdH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDw8IwIM4LZs9k2YS815yhz3kIRjRqGcIJHj6kYc02K5AiEAuOQF4Z3n4eSWAF3vP6Ls1xWWGhep6aZROsqgEhwqUWI="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e938140.0_1631121765650_0.24306522132721886"},"_hasShrinkwrap":false},"0.0.0-canary.04ebbff.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.04ebbff.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.04ebbff.0","fusion-plugin-react-redux":"0.0.0-canary.04ebbff.0","fusion-plugin-universal-events":"0.0.0-canary.04ebbff.0","fusion-test-utils":"0.0.0-canary.04ebbff.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.04ebbff.0","fusion-plugin-universal-events":"0.0.0-canary.04ebbff.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.04ebbff.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.04ebbff.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-2eMTrvE5ytihoRQOKUkQLlw4ANVUNBpe4j3Cv0W/2J47GDXAxeOxySij2P9K1XQaqMY/CfgmZ+opfKa4U8wtTg==","shasum":"89e0f5b9aed3b94ea4dde1601a925c48d1f6b72c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.04ebbff.0.tgz","fileCount":11,"unpackedSize":40234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhO5H1CRA9TVsSAnZWagAARS4P/jZdjvtsmCkV5d8xY6qe\n8xweFyM/NQJMhHdvM7wBwdwXRmTMBzJ1cZqRTYsQ6+NMCOfYKZBQZUallF5A\nA2WZIoiFvGNZopKDWGhhrDgwZsIqlIq+1Ls+eYzBAC7zyoYCkbz1spGUBgSU\n794ZshN9pN+oe7o5aGAuSQJVJuSwTRppVcJIZw+Vt40f3/B3xKNQJXKfxNYe\npm0HHICUzCr2Q3z7jqYafzV5amTwQVxod6N12D5et6HYmL7b7Ft1cmAwI8ux\nZLlmVGCWq11ruSiaY9EqGWhatNy146rgCzxBadfntiVQ40iboBt9uRGEaSsy\njn3t2mfAfpLw2GSwsCH237+73KG5T9BXePvxuzi9kFbbhfUwWXtA2hlemEQi\nEPdHie/jXoh/5wYhKPKS6WJYk1pjj7JSmXdLr5UMJ4wtoywC8yEIwdD4Ipuf\nteCCmERaq36cNs1VmAYSeeiNTRFZbAxNJPOrnC21ymU/hn5xod4jWklXWAg3\nxGKTCPjg52CwuzpaIqDvIAG+j7hcc6eK7RfXnT9iXCfFKOYcXyL1UuBOWSre\nhGd6cZgOg0SoMmiAdKtMiZG9hwnXcz/iT0tPd5hfzR5ABaR4ZN0ctsWIK1OJ\npRTJgg8SGiZDnYEc4JGSojytau7p4wbIo5HpBzxDY27ScM8hv64kLv7L//p5\ns7+n\r\n=FYVE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEHM34uLCO02nMuP/J/m+unQhi3T/X1+m19HBpLIBFB8AiEAmZHkh0K4QvB/sL8nW3PvqPmN3fRrSWMx2M31nh0G4oo="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.04ebbff.0_1631293941095_0.5303071370709838"},"_hasShrinkwrap":false},"0.0.0-canary.77d64ce.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.77d64ce.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.77d64ce.0","fusion-plugin-react-redux":"0.0.0-canary.77d64ce.0","fusion-plugin-universal-events":"0.0.0-canary.77d64ce.0","fusion-test-utils":"0.0.0-canary.77d64ce.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.77d64ce.0","fusion-plugin-universal-events":"0.0.0-canary.77d64ce.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.77d64ce.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.77d64ce.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-7/nK+mVj8ecbc5TAwAP/D4SRyafAyRCRNbrhXAMU19IQZcNMBHrtIcxiNYYNOL8cUbbLN7QeyfVODQxE1HTkVQ==","shasum":"9b350d7fc38e6a8c0f8c7541511cba4164e38260","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.77d64ce.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQ76uCRA9TVsSAnZWagAAkFEQAIzOaiLOSE/neaCSJ+by\nscbvgFCPy2oH2AdZGdj7smQRxNOGt0fKYdsY2EBd8PlAtbphcQZyVnC1FNXW\nbaLinVW9/SDovTAE490JaLB3X1M7wCakzYQJ35O3WRhlKR9b8vdcRfWeqVf8\n+4Ru+k+hbKkRfN1pXw6iaALrCJLIpJt4SVEiH+M+qI5TGwVpFdspsIyVo45C\nzbcIz1A/MFI+TexegfGBUIAuAidsMveWZpeowf+05lPQBWGoj0/NK3HcMSUV\nbcqEzpT3e2RcVuy6LPPxtBR6GI07/XOthe6WezM/OrGMa952UVGv3yquwNQg\np7UjFKOck/1exFBCJolO0iWRqkZ1eylIUeuzA4wiTwALDA/jr2X8L0rG6fVQ\nFUuRNqC3ZzQGPqCpleXCtqCvuSUhAD8mM2n9EB2nuLrWAeoGZ2FlEkcYjckz\nLgf54+hdPO0KuGWaSwVn6UP3lWUtxKi/ayEsGlcvdnN9e1ggS/cjJUOrRojP\nViMYavAmF7PTIJ5pKIluyIP4rUfj5mxeCK4yEOTKlXEx/lEJmPuMgrP4TZuZ\n33eHfsjlKR7jvqrvrLvw6v3k/w/nNcOPZxDNBQUAqs86F7B7aTyj9ZoG9wEp\ndyk/+cCveUdH9/KX3RiQAlELBMxLykS0oeaxP/h4vivP+6dG7aoftGsxcOAR\nNXXd\r\n=iAI3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFAS/67OOC5RsfmQResy1PXbuJc9TZtLjuuuDaTF8XkEAiBydIm35ZH2aP8pHoBCWqCyuyB548JhOnNVrW4nJbk7BA=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.77d64ce.0_1631829677955_0.2429290564863662"},"_hasShrinkwrap":false},"3.2.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"2.5.0","fusion-plugin-react-redux":"2.3.0","fusion-plugin-universal-events":"2.3.0","fusion-test-utils":"2.3.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.0","fusion-plugin-universal-events":"2.3.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.0.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-yAWbz7eI4PasxOa/p8FBlfhSm+j9QDNNO6J6WNu0caagh74jOOo/zaCWab9q6s4w187w8g185aH41D+cLyzgZg==","shasum":"64ef9d65be9c6b2739871aeff0a5864c0062eca3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.0.tgz","fileCount":12,"unpackedSize":40849,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIUP2d3oRYkNxSFpG48oDwKIl7eswXWsROyAlkDAX8igIhAL/Zv3lrd5t4XFhLhzGLFESt77sN7Q78hoy3g//FHIc4"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.0_1631897926292_0.11232165608679567"},"_hasShrinkwrap":false},"0.0.0-canary.a5335ef.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a5335ef.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.a5335ef.0","fusion-plugin-react-redux":"0.0.0-canary.a5335ef.0","fusion-plugin-universal-events":"0.0.0-canary.a5335ef.0","fusion-test-utils":"0.0.0-canary.a5335ef.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.a5335ef.0","fusion-plugin-universal-events":"0.0.0-canary.a5335ef.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a5335ef.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a5335ef.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Lj1fC52OyiMt8VG+Mxxbkmjttr/LNagapKP5mlogAaTxmLE2cUcKPHTTt3z8dCALYcReN4OsNbF0U+CnTmrktw==","shasum":"f8ded74e875044488f7d59b7896477a26501230c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a5335ef.0.tgz","fileCount":12,"unpackedSize":40968,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFKGxZ+mKov380QSrM2eqiAt028tM/o7vC9w0V4rRsbSAiB1i5Ima4kQDXRPUtHWn46cTJo2h26fuHu3xmoWLrvu+w=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a5335ef.0_1636408533157_0.7110441374931826"},"_hasShrinkwrap":false},"0.0.0-canary.99bcfaa.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.99bcfaa.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.99bcfaa.0","fusion-plugin-react-redux":"0.0.0-canary.99bcfaa.0","fusion-plugin-universal-events":"0.0.0-canary.99bcfaa.0","fusion-test-utils":"0.0.0-canary.99bcfaa.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.99bcfaa.0","fusion-plugin-universal-events":"0.0.0-canary.99bcfaa.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.99bcfaa.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.99bcfaa.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-9j2RoGhLoLlnYxkG9Ex3oxII99PTP4zOOOj1v+n5UbcBGGVSECInTYiUbi1sgmpQOwJZwTZrisoTyLdUQ+EB2w==","shasum":"b64068fbf96a9f4ae13671e718ab2300cf602801","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.99bcfaa.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkuEXCRA9TVsSAnZWagAAbQEP/3kJ6dvuLOg4j8y0SmlS\ntgfs052wogUZcetCTTeNlfGyTQCXDBIk77zUwR9lmR02hHTI1uP0qKkJK9a7\nycifqylsPYZLT3ioSU3xF7bi4GGY2ua7cYlVpzZdI2YGtMvlAIeyOBACoUP6\n2/Nu/MOmwN64Sz/nZVp2aKNlhI3QlOi5xW5SXGp6ceNNUITs2tAHIm55QWBP\nCIyJbBWKy289VJDPWR8UopXhZaHn1h2MuXfGCyqaTKgAW1X9ptpkaLFM+KXQ\nUguhF2MhS/IB9Bk+BljKKSOdeRRfr8uWUzzp2U7vx9t2myLDsf6ZvfSTGFXL\nxMqgAcueaYX73b6ARBI60iAwk9YwfoRU0PHF1p6kdf1nGmhuvt6hyfl6MqXa\nDNNfwoJmp/itdLXGVhFop1NjIUU/omxdaXjpIkzpFwzKi1Tbj6FC6Th/nihw\nBcpu1z+NrWYG3xrYIMbOeddmLdzsPMBSsHEtjnkswy25LPzj0Mb1G6r9jlKy\naOa3EmeCAQnQ8MNsC3qSbTtSHKaiCGNlSWH1KvsUiN6uqZv4MfNlbIBMMEwd\nadbuNh6JX9+nnV63d5T9DBbEmU4V4qybi2i3W04MkCXo9rcq9KArMdsGkHyr\ncTITDl4bU/kmi4iAl4eml420Df7D52GNF/zxmSkq91zsqAmNqYziqFXgITl/\nEPh8\r\n=jgY8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWZ6hHsh24QfPFf3kUzpE5JUQfLRhYlovvpE7YCV2/TgIgU/VrdHUyeQT8x1zRGfWkKm4CwgTp5vz2/MdXe0PiXYE="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.99bcfaa.0_1637015831483_0.0003950509149019954"},"_hasShrinkwrap":false},"0.0.0-canary.858e9e0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.858e9e0.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.858e9e0.0","fusion-plugin-react-redux":"0.0.0-canary.858e9e0.0","fusion-plugin-universal-events":"0.0.0-canary.858e9e0.0","fusion-test-utils":"0.0.0-canary.858e9e0.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.858e9e0.0","fusion-plugin-universal-events":"0.0.0-canary.858e9e0.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.858e9e0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.858e9e0.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-nidrMN/YwDmazXmoe0ZuLz/W3sed2ehlSlfEUczOknryy+U4q2frrYtyGVZ3DRq3L8fmwh0hxv3quU+sDnwKlg==","shasum":"b0da329c8746328f879c4098d00eab5a1cd13d0f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.858e9e0.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhkv7fCRA9TVsSAnZWagAAMV0QAJn8lvKO/qB/J/PJORzO\nz0yxEFW9s385JBfpN3U2IQpSLO82R1umxBlyD5wzaTPeKPHYLTUfCIU8SnSY\nJLWgPalYGBpxQkHLxkGFPIRVEXsOOcXkpMyx+rAvISP1X3l6frMe2d73K17z\nQtIqMqWgVfdyQIqLcvxQDJNbUxkJM70vagTaQFEJIO/XetHFpqn2FPyoPbRX\npniXOirmsYmqBRREVTl0wjPhN9ndLcyCOvNnrie0XE1LZTHJI8CyZAXfZLMm\nuKRf1m/d8S/HsUGAwtQTw29Was0dZLkVNkm9U8HHca+gDsxaVc2aFeJxHRw1\nyw4SoztrFtWUQS8NbUTmpsVrEQihW8Yfs7Ua/GG6UErbbxxEOmnN8sLfXTOg\n9l7tQ5qgMHdiYjLy6ILBQe0EJd6rklYMMyGst1KKErvAGhHH6hQlBCK17/uu\nysd/8q00aU75FU51e/MHL9d40idkYbt8SB2d21jgPN03Icfllrplw5Xi2RsX\nLQDZmRKDyl6Ht00MZRmbw0dL4XuWxD55d//ZZClAECFGC2lUf4eSVviGEZst\nnNSzGOOVqkZxYZMQqM9F475NqaFL/6nCdIN+/g9vD6fG8ybFCCq37/wpnKmQ\nCWJToYVwEsN51K9ug0fHc7G533VoX9f7GNzceZUK9dqPBxjJyWvd4Exmf8Tv\nQKaN\r\n=LOOT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtf4Rc33V7iPsGdH7cKrNvwh9Lpakrr1NvJoy/KcOpxAiEAhdcR7ncbs7j93KKD3G+WbFWP9JP9moFzazWZrb1BI7w="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.858e9e0.0_1637023455081_0.10039251860860476"},"_hasShrinkwrap":false},"0.0.0-canary.940ae04.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.940ae04.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.940ae04.0","fusion-plugin-react-redux":"0.0.0-canary.940ae04.0","fusion-plugin-universal-events":"0.0.0-canary.940ae04.0","fusion-test-utils":"0.0.0-canary.940ae04.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.940ae04.0","fusion-plugin-universal-events":"0.0.0-canary.940ae04.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.940ae04.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.940ae04.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-2T3tv/WG06RzgMyfQ+X4dp1OAsPhAv32AZ9y/s9HHTeBXgu9RZNNah6AugJXz3C1Q3JCk7hi5873X3VVKXdiJA==","shasum":"774e5703d34433bedfa94e2518ae248cbd917af0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.940ae04.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlEnECRA9TVsSAnZWagAAjzMP/iEI6p1hOZT/2LPq0+WZ\nv19Zbk35dmUu9ZFiP7XiDrB39hSqsxR21SlIDoYMslI9xovOkB1XQeH99E9y\nsFZmM/4f5IFT87R4yaY6pLiy8NG/3UVd2+MGvRv3/wXxJaae/4erhaTW6CE3\nkl8lrkqOinZM34X64P4DrG/35SygEQysFTJlomMr+B6ieGFv2cSEQRm/JE0O\nbotXjIUdS1N0UOD4chEY6t7BlgTDz6VRzJlgx+zzWjIblqa6FH/lrqQFAKyA\nqI9gmkYMV3Yyo6CvpYMEQJRTpoOVzsl1YKt5et5/rr+Xr+iku/DDYkUnGjaW\npkBnFPYzeGYnkVz+PyT+hwXmy6KfGjES+onRd1oE1NdZUk1oK7l4X09JHGrz\n3lYV/oHY/WCXNqIaSpsLn+IyismjjuYr9yDTvmaTumv5Tt8MqAHvnOgfaZhh\n8j0Z4cRlShGUfh/gnYaxkDPDHAOJNxy0XVv6gc1R8xj427NKuxxvYoTAFreW\nkhsieLqLbg3MwDGe3kw5Wmr3rxDT8D2eQeLU/cOSQ+hRTtaNgLeoQAjABYDe\nyPTXiznpLM/5pPorAqL1azAS9AOj+aufXrBpaOXC9w6l9vdq0cx7ZbVBEPvL\n9heV7ky5O6FrztKSIsO/Enib2lDazc9ZnosrZKTZT1NqArLVW0zUSFB1FNF4\n/0Ap\r\n=/iOa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG6pBJpL2QR+DpvUdS7CYJMqx9SFoNx+QWLWdFor8r5TAiBb2E9FJfVkrjg23DCXkv7jEpe4RanVRCsxdVK6mxMxuw=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.940ae04.0_1637108164376_0.6029505647053743"},"_hasShrinkwrap":false},"0.0.0-canary.61befa0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.61befa0.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.61befa0.0","fusion-plugin-react-redux":"0.0.0-canary.61befa0.0","fusion-plugin-universal-events":"0.0.0-canary.61befa0.0","fusion-test-utils":"0.0.0-canary.61befa0.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.61befa0.0","fusion-plugin-universal-events":"0.0.0-canary.61befa0.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.61befa0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.61befa0.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-1Syp2XoSiTaNU9Csi4k5ztjVoETr6i51ARTIcsux7DayzPV3FlLd1miv4yg8Ju+RVTlyPszl6IjvPkG5pEl+xA==","shasum":"8740a6cab18e7253d06b8ccf9ba1581aefeb79bf","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.61befa0.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlXjWCRA9TVsSAnZWagAAbkQP/11DgzxmH9b0LNYvbK7n\nya6zNtg1QbLhOTl2JM03Y/3f6zqD/kEifaYHEY2ChcZoS6fYhV64CzcvBNKY\nCUSs2sfdJKHxM4if/pRpnvVIVR8kuAOYe3vdm8+OIlvE+PtvkDA/m0n+iV2X\n6FUlRR39IS2yy+vAXn2bJ41KdTA7f/kEhc5blyw6N2MAp/8Vfm9KImK7/EtU\nhvGVwUluO5IEk54sodPg1UjP3XgsvF5bzngp1U8DBbvKlkI6hk6965Y+qVbM\nZ5QFYFBmi7GSmhO0s/0WznXGpz38tUs1ZnGyNjn7xaQHqmn97XunWJqtwnBF\nz8JQ7OnwYm8Msgu0qJXLiWcVt5pwg6WEBnP7s1QUzjZvr666ezdGBKZuqiFH\nM+mMwYth6jzrn11Jhe45baYQ388rgGSMYq9hKu0tHirwjt8CdpxfrX6wnqyi\nBEIJBhNU6hbxPHX1/O8pEY6mPnEHn3dT0L4dHqlMp59OhzmQeQXOvOBLV9qR\neC3Ksds17iKpidcc3v0N0SSw9bMqXLVvsTawKidlg16JreeeZTZ1dJqqR9+Q\nzv54QIrAJCNOK/yFqmZJ2Fw/QFxQWuo0rGFvtlu7z8S5W8CH/6CKTSuLGLuf\nvxwYN0i3zUgI+0FVQJDTn0L+qJ7XIn/XMaJXAsViyJmRS/CmlL28oY4HsRGr\nBFU7\r\n=hrUy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZ7ZbJFcZs58Fy8JHBqvkOpvvtpfYBfLy5JICBeqRayAiApoIUxHA52m/jgpOxJmx/QOow9NaqGKru1hstpPkXn5A=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.61befa0.0_1637185750455_0.434490530476368"},"_hasShrinkwrap":false},"0.0.0-canary.358ea34.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.358ea34.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.358ea34.0","fusion-plugin-react-redux":"0.0.0-canary.358ea34.0","fusion-plugin-universal-events":"0.0.0-canary.358ea34.0","fusion-test-utils":"0.0.0-canary.358ea34.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.358ea34.0","fusion-plugin-universal-events":"0.0.0-canary.358ea34.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.358ea34.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.358ea34.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-LlkN8ygRipa8SvEc/XQUMVxe3fxxXOASGtCAmA5HqGfepTYj7CGBGf4mieFqfaA52l7BvZmOsnjuhAVYY1DbpQ==","shasum":"1d0b52480589ad7f50b76d7e8c23d742aadd1234","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.358ea34.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnPmtCRA9TVsSAnZWagAAzAAQAIWQrh3vwJ/fz0l/83pG\nPr4KvehcYwPLkxfUfgBdeyolUqN3YJQ2laGe4oO7OKGnuXJXAS44ZpIB3xAf\nl/nG5XB1wwxMWlxzbOygfT/dgAdq1DDzaPHKmzDiXPiW79wS752A5HIHiWq3\nruriojnaUhDg77A5L/eYZs8rf7tD3KvQtt1Yz0hXv3OAIRInv/39r9VeolUQ\nXTaJegI7HuYgP2t9TxEeu0tqqXaoykxIrzkFplx51C1zF7k7hLiaB5V/wEGj\n6h0gB06I/ZJ1eEqQAmPyx/UX8DwTNFZcMxFHbSkW1mRkNUDB5qBP5GGGald5\nY3sEpTZbVlvzal6UO+EPd0l1V4FJmX+L2A64DLIoBuhX1vV3nZMyKsm5pONe\nEYAk6PIL6x5Kz28Hs1z+YnFeJeLkPCxCBCCUbRoeAWDVOetX42syTMezIVkD\nnS4po5COhvhEUuE1B7VhLHFghLi5Ydxc6XRHfxMxsO+U/+Nbkc0x4UDyS4GT\nvzH+hHuJfOJqKxeIOkegpmzJevQFWvFdgRxlVIw1YDJX20RE9KFOKOEB/8zt\nRbkA2fs9aZAZg6CP63whVZfnwRIshImbPK9AKV+VbewOjKg7Z9oO3qU0UDFZ\nX6uesrnFMonBWj7/ckQZde5+URM171vA2AE603U+VwmAozyCa4cW5VjiDaGZ\nT+mX\r\n=QPv1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDURt2rCw9e6aNBjEi/TIK+8UysNkjzHvNgUHqP20EJ0QIgD66LVRBOgka0jQWFCvGEemrPrxbJCfYADBxAJqXKOy4="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.358ea34.0_1637677485226_0.27904360857926536"},"_hasShrinkwrap":false},"0.0.0-canary.0585b99.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0585b99.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.0585b99.0","fusion-plugin-react-redux":"0.0.0-canary.0585b99.0","fusion-plugin-universal-events":"0.0.0-canary.0585b99.0","fusion-test-utils":"0.0.0-canary.0585b99.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.0585b99.0","fusion-plugin-universal-events":"0.0.0-canary.0585b99.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0585b99.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0585b99.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-KWjAuqzY8/rpkJaBSaCOgb1GH9zZQFY129n91OlvqBpbZF7rWyBeDZu/lvEvuARRQHeFle3P+6xSw6MwGnL6CQ==","shasum":"3a89dab55d12b64d54f769e0f2051d9298ebd884","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0585b99.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnUXFCRA9TVsSAnZWagAAvJkP/ikMUlaWfsNUn8TyjIor\nhT5sdWXKeGtWrkazhAuUJtWEPLLnQLHhoOJ4m+7LY95nfkWbRyWNol2DUd7T\nlm/7vlZenTgRA1uTwyAXTUVUXiZpUugIBEHGd/HcS2xwdZG9W5Kl4jEG7Pkq\ndhfDK41fCtMmyg+2JNkYgER654qmjCGVFHPG2UpMc0hyrne3L9wsjsu7OEtY\nN1bXgZ6LC99S3FpexxC/5MPpIRkn0mn43Ih48ig281QltpzdO2RVWK4kXXuS\nqTk5bLuZ4yzIqrLIzbxeI2SGMUSPRnjUfOzT/pa9EyqstJUqhNNJe5Gqz3QB\nyJaeXNVYtzmT1GF6SBqkD0jetz3IJxRACA2rXco5hnJxtOYrx1NocGztVUE0\n52C9aSdZdOKWDxuxdKve1KnS5zYus41MKDt1BIzRK13BVtSZ1taPDk0EXwZj\n0AjzGfNUAmZkCOvXrADK7hjz+axrvSAYsXf2mlcVtzpnFNjn7DcRcUnowK+q\n9nlFsDXv58KsneKBOOMHj6sOtCpjD0Wx3Q7HgV/BL4kk8cvccxiRa3cdMsFh\nJUoXM51f0G7ilqKt9BojlcwSQ1HJreIq7t3ipWsJx1gD4Pft+HCEwiJ6LuKy\nwTrYmvOmu/PExhHI/6beqkLFYGxKSWGGxRotim7b3jZhb/zTjtyWjC9/MIHv\nmCJA\r\n=zJWs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAD5tlEfDlBm6uoO31aWN9sCGFxaJQqxu6e6cZ6aD2h2AiBRx4744XzD0wUeN8dl2OaHzcV9Y7Lpc8SaOm0E4KdLFw=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0585b99.0_1637696965823_0.5311494924335958"},"_hasShrinkwrap":false},"0.0.0-canary.4d4635d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4d4635d.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4d4635d.0","fusion-plugin-react-redux":"0.0.0-canary.4d4635d.0","fusion-plugin-universal-events":"0.0.0-canary.4d4635d.0","fusion-test-utils":"0.0.0-canary.4d4635d.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4d4635d.0","fusion-plugin-universal-events":"0.0.0-canary.4d4635d.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4d4635d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4d4635d.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-ez7vk9PHSCVAPWiR8WIQBrSrrkmPBVC4DZJSpsRPLNPhP1AxyqQ0fe40a99EOyRSTlkYnPONAwv0pSvyTBK9IA==","shasum":"383206e541b572e76a313e2bea4741cd4151e824","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4d4635d.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnVZ6CRA9TVsSAnZWagAAjxkP/0vQMJMMeyHCEmencaL8\n3U+zLzoDM2qUDH5FvQ5PTYs7+PbnTn/nCzv8zlSu+QxrtRU3sEZhhnsrwu+3\n5lDjXje2hzmr4cu3XocOu/IONUDbbrRvJgc34bZ5IWrf/QiA7zXL0RMTad87\nGVN6BFTAgQBVjeAXova8cj6VJFyotiUc3HcMPp/2ZlU1oEuvAkAhUYfVQjVD\nuKPoKNNp018WCuDyNwoq2C0DTtum5qN9Df9X5YrcSARKSjqqYeHvAb1tI50P\nKzDSIBu8G0b7YMXk/xqGRmsLQCLg0bmv33WkFruiquF2LVUUJQiSIiLJhoge\nxBJYixG0cO8bCInCI9x0cfjT4B+1ESDT2zpsedzD8nS4klcUMTROtEzGNziu\nRyhRNB6CEPGejCJplzj6e0Q2eyGscNquWU+qYKbbogAHJWTHjN2pANxPmkjI\n5sHegT7fdC6Szj57LD1sKOcMTSb08AsdGqOagQdQQdCm+WzZM0p1h/I6SURp\nB9cCe6J6wCIIb3WTTN36TX2tPTLTxEAEQWx1c0L8ijwgcqoeqolxBuwWm5Ep\nM7LPJBsRtMVR6eAbCRQ73/qCEKx6h4cA/jNNEeLguAzEUC50KIk6fbjwwu4V\ndg0NEe8yBop/9IbxinQeDkMfr5dTfKQuEthsZFvAQoXssfTz1fjJ8pOcGUuS\nqAIQ\r\n=Smr+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDln3RPRBpHZaDBu4xbcLCiaV8SS/vi39XIT8+meg31igIgKtmrD7q/9hLNEw0K9FV1FVEkRaZC8UmFuuS+S20ow14="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4d4635d.0_1637701242545_0.7350725384185535"},"_hasShrinkwrap":false},"0.0.0-canary.4457a44.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4457a44.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.4457a44.0","fusion-plugin-react-redux":"0.0.0-canary.4457a44.0","fusion-plugin-universal-events":"0.0.0-canary.4457a44.0","fusion-test-utils":"0.0.0-canary.4457a44.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4457a44.0","fusion-plugin-universal-events":"0.0.0-canary.4457a44.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4457a44.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4457a44.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-gZEQofaGyawx1dFW+oxiGpxMBi7FL9SjMGjQNvj0loqnUIMuIIKgyzFGqI3u4cCMaze43fM3XV1yLHXrzmKKUA==","shasum":"0a80285388cc09fa4588f887b194c94bdab647c1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4457a44.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnVvnCRA9TVsSAnZWagAA9FwP/j1y6g8zSNGtYsGkB9yt\nwoWGV4HW7lZrT7GFfJWGEHumpyRJGwqOVCKErGYR4Ov2TGvOJMs/E5N42paK\n84vZmqbkngwyNsambVv+P9Edvp/MHQIgvdRBjHRyAMH9YKXb3jCyG6cYUG97\nve7iC0uHCODlJyqya1WlRFQz+/JaJtG3Qv/n35s4U91k8JZdqItpMzbEJNeF\nu7bHfkaOHF3GWoZCtwffHNkK+WV2RtSFmw9UQb/0m80PqcFyomovTpL3ZcTl\nAOr1NK2fdLEpy62BAf5JOLvEtP58+BXuKbs5+FmU4PudhnYXAlwpeQrHG8KF\nwYkkS1p/tO5V3Vl7cX6XukxFrKBJ06zjpSFd+WrS7SItXKVDVgPjJPFvXY/o\n7bZpzP3tGpIXE3qv1pC5xF5NjQ6GhCYjFJkYRqT1KJTgBIHET0Ohl9i0iG0q\nq5cjreOyge5JlTlYx4eqgu0xoF7VC9moRStXKn9KPVDliMN0s4yGZz/fx06Q\nAwuthd/VwbABjfs181353wIlfXLbl7BojLTWwtdwPgneP7tPdmh3tcwMeIl8\ns6BKLkAz1UWyX8Vg5CzDM9pjQPIMo1XRXJDl7MKeFZv1A20kAXC2Yh4j/loY\n1HkqZsHSgpoG/P7W8cnfLuebCbhJ6tgNwP2oMgjGyV0UkHcC29e667a/+16K\nlxwK\r\n=fVVF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAuzZL/jk5JeesXl0OlAoOFesbChI6/Zte5IiIpQIWrmAiBXZ/joaEP74ZbLhph+uE20T0hIRX5OoedBFWrqcBwYLg=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4457a44.0_1637702630980_0.8931084847208786"},"_hasShrinkwrap":false},"3.2.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.1","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"2.5.1","fusion-plugin-react-redux":"2.3.1","fusion-plugin-universal-events":"2.3.1","fusion-test-utils":"2.3.1","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.1","fusion-plugin-universal-events":"2.3.1"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.1.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.1","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-T4N+N7x4MtJ1XDU5smEfyTRhExi159Cav9jZMGMJ3MT+30VdTkaRJTF8HY6UhFzMcK+cwcoXnAjEDbkxfLABVw==","shasum":"c6aeeb88ce232929c98b07a433372cc20bb5e63d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.1.tgz","fileCount":12,"unpackedSize":40849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnr45CRA9TVsSAnZWagAAcokP/i137MBZFdOVPYZEsCBg\njTDjkmMPUDsGXReIvvldrFAnaUhGNCLjWFJ9vzAqMkMmLRuKxqKi7H46qoT/\nl8nv/PWDzpS1QTWCXuW2MAEgvics3jmmTBeqvhZqEihvFWH2hj8SIqVfibWt\n0xONe0gATo/6C2PU74bGFDsX4V6wVX4IWT+erLFcDekAi6w6m+D9KVRh/DiF\nB0j1mOQx7Pg0O8eYsWzTLNPadu2S1DXvL4hKlvFmMla5Ps4YXJ8qokRIGs8+\n4YY7axcGqQwVyoEzm4fM5irvvgHIkTev5xhXEIoeQbfpWO5ZwMg91lHJwVOe\nNH2jj9IevMx0yPwK2vyrSPqkLrpAVOgJhfF5EIkD/Pu6b+iUziv1ViB5/p6X\nShJpowT82PRFYDIkPkKQHF5ThaWU/0ZgWqRfgU74qwtVyFxye33u4NJ0sWHe\nv7q180HYXBSpKBEb1ekhnTu3Diq88YqWZhJxXGBip+Jluq/56O7ZlVQyBoNy\nV8nG1WnD828sSDoz3CdXjL91FhtmHWcgosrMBCEJqNENowOdRAPgHQir9fTx\nAsIRIeeAA8/AK6aNvgLj0X2PTyIyrZNyZL0Qg3e/7q7AKQZmyPQwPYwiAiV/\nqMW5b97D5V2Ozj7AuJVY9j/7ZKEvQKPGDep0WpAtrqTV9YkR4F3tAAtTGY4s\nJj4z\r\n=vm31\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZBMFl7dPDNYEHZLomlCEOq0w7DQq7smR63m5lFBj9dgIgJcqeWmip5wOFKhdtAQh9pQsV4/Bv0bEDssBGs+JPcek="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.1_1637793337572_0.4110904207796673"},"_hasShrinkwrap":false},"0.0.0-canary.69a107c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.69a107c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.69a107c.0","fusion-plugin-react-redux":"0.0.0-canary.69a107c.0","fusion-plugin-universal-events":"0.0.0-canary.69a107c.0","fusion-test-utils":"0.0.0-canary.69a107c.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.69a107c.0","fusion-plugin-universal-events":"0.0.0-canary.69a107c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69a107c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.69a107c.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-BBaC5VHaQ5nGeDKqDEgztqPUOAwwuJk41T1q0lSNbnqhu7IiSi4zFsSe1pk9YepUfvlsj5x8lLp/q65htSWvKg==","shasum":"e91f2fa0c1de2657182e950c53c6e16c082c40d4","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.69a107c.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrp/9CRA9TVsSAnZWagAAmYMP/1N63Bo26pqo0kAOUguL\nC5MS8AFGI+oQVURdY/SeEZOn37+z/kXb2Y3/F2lTnF85uDJoR+bPcg57YFDm\nJNvRoz29vQbPGWkwcEV96wVk+ClVUJCebvnfn3P35aUCxLgq79iZvynYL3qW\nYr2AyeO1+t9F8GrPM57DUE79MThrxNbtgO0SmgBY5NEaVHUoghD3kTW5BFju\nakM+f0ncqu3o6AmUEFBIgCzTWCWgTad2NbV0HtKP6ENFg/EE1RHvjXPb3+at\noODm7GUIUDe5qE4oCcPOrCKC2q+vyh8hKIxFuXmQUzSBmD+Hg1P+QAYcFtfU\nYHFXLOlRaJdk6wCh7KyJfJn3zA90vcTT/WzgiomQ4GXLCwlLZAyNVIsfEFFn\nY9VPx3X/wDSoLKxFGq8VIiNjBAt+C9U47fQB5WOyfQk4a9VNYLB4d1m5Cn3b\nKkmOfk2XG8idAjL99P3d8ZkfhVxwjFkRV+wYNsTc0/kT4OUpV39Zr6YcnYAi\nks1VMMR+T6RShkgEuJIGdy8XXI3UXnlDLnNCYDoDbOqplp2BiY7vrExGemLe\n5sdIUuUQU9+1cGAwig54n0mpqVAyYyi0X6fbF8sk8PxvjTgA3cK0FpyxCRCs\nSzuRKv6oGztEl0L39pmNVsNjeuicbvu+QA6+5I7RZB0msv0oHrgCQs9Jn8nC\nNd3I\r\n=PRO9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHqXgt4ernO0wFpO6P0xE+AgAo1s8G7b0K539LTZkbh5AiEAlMa3FheL33Z3kxlNzWqG8RWU9QaIygMK1m724Fva3w0="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.69a107c.0_1638834173751_0.37048993150826437"},"_hasShrinkwrap":false},"0.0.0-canary.c638cb0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c638cb0.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.c638cb0.0","fusion-plugin-react-redux":"0.0.0-canary.c638cb0.0","fusion-plugin-universal-events":"0.0.0-canary.c638cb0.0","fusion-test-utils":"0.0.0-canary.c638cb0.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.c638cb0.0","fusion-plugin-universal-events":"0.0.0-canary.c638cb0.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c638cb0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c638cb0.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-XOz9wMayCRUHfG7iKql+3SkE+A1AULHNs8XxsxWTSe1nbahMGclEgxzUjjJq58QjbfEZsHNsY4SPxJ7JDH3hpQ==","shasum":"cf5cbc39cedc05301570b2ab0f9f61082b07dcef","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c638cb0.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhr9cECRA9TVsSAnZWagAAaTgP/04DfwY+9z3TjG8NhAdF\nLpuTvl5mnMmsvQGqUveEqhczGsTlRAsVz2Kai+IUAFe0uBwoAc6ZJidV4EqR\nT3XVITnCgj0Y+8F4XS6wa7CvDwW8LFfvnYnMBToLhDfan96C74Jk5JMKLOkX\nZ58yqVAX8czVqdTutcQ/VJWnHPiE5WNlGb34SibRA+6I4PLBmNwJfHpH+EN5\n36YcYG0I06Yel8SxDU/IAyU825nXp7vtIm6eeuZDHz5RBsL5XmBVidgtOSJg\nvsiJdVgLSqLTJQbYJ/CSzI5a+cHUwDP+iK9GmEQ21qXXZAsdyhbj38LoovZQ\nclV+Y5Qev/GxHQgxoJq+jWSF9lTojabyumy2PMSL2/ny6pKb+0u9oMJIdS0s\n/9jReyITBWA2NSEUFVFTxnf/U5c6EUvjletM5AoysJqyiRuBcjyJ8lWUFzrU\nQrZp972cT2u7EQzRW9F/er2owh5QQWrHCMlmxkll5A0PCla+PP5m+r5gV528\nlonc8O3R7JyYJ8cafbuBRQg10fTbwowmqzBgs5S9ChmJbiAYjY2P/kOQvIHn\nprrEdhI4xagMV47qGNUqPzilBFud03q3sRxEf63H9ZJEmblhtRgk8S0zFGHI\nL90JUxYCnzKQQzj5BUMy2N9HVnloAAYUg9Dho87YLQb+DW9EqL8JfKcGl92O\nA3As\r\n=9dnu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICh/bt1g4n3ihf62MLiLkwvQOZuToPF3GTVp5LC6cOqDAiEAlx8rtEjfXCANWey/iacuAD8VAgcnepAAHu+TYYEvm0E="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c638cb0.0_1638913796288_0.14868319727246893"},"_hasShrinkwrap":false},"3.2.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.2","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"2.5.2","fusion-plugin-react-redux":"2.3.2","fusion-plugin-universal-events":"2.3.2","fusion-test-utils":"2.3.2","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.2","fusion-plugin-universal-events":"2.3.2"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.2.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.2","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-pA3H9MYSodJvTT2mjuWABy+y2kcw5ouTpQHo1dYswHtMZSclfbOHv/Df+3+N2rJ5xweAz259vxXyhJR2Dkecrw==","shasum":"1fac9633f449fe09886e4c1ef26ab8696ca84959","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.2.tgz","fileCount":12,"unpackedSize":40849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsmtKCRA9TVsSAnZWagAAs7UP/jhdwfJCK1kJCUen7dG4\n74vtizs47RUI7O5Abe05r4aFHbBSj+sVXr48Frfwtt50YzNeYXb6kAVASYHk\nc8pH3hOBmGgxvjlJurBLJcJqsmKQq+UjQ/W7VgVMCR4gCHzfhh/U8HtmOGDI\ncX1horaS/8kfrieScZ+5CWhHDwerDWrmO2Vw79ihNA3n7t1AWd+/5mAyAg0J\ntmhXc7PyoTJ1dQc0eJgO09inppRg/HpLU1B408VjPL2v7khzlP0OmlUG5b6A\nUCwKwOSOMhKLFngMvd3lg4RIJpCLBlccS0C++OlGPTBr5LkEHNB6DpJvIEPq\nflMng9q86BhMJjuhC/SyVfH0Q2cAfLV9xBKLmgM75WHY5SrF3F9NiZukBXMj\ne7E858uChbTqwMM5BewOybBAk82zaxDWOjeXkqz2810Xk1eG8gcuApjGxgnH\nOJ5SYevmkZEsK+nGcm4wohFPR6s9i2ktu2kV/2sErLHt67pciTntRWlO1l9a\nArt0Fjp3nYMXnIBWV7PnJO/xInXNaOakl1/+1Z18EDMse5ME5oZ3jAKgmVOC\niNF5M9jYCf4235VJkvi4yvzRRzfztLBATFN0nrCPuePEc1Z7LzBfWCt+xs8q\n83VTyBx87hAG+Di5CbETowGuiRFtvqz1x35Lvgmrkq+YcVHi/bxOxleW7vjM\ncCLx\r\n=zLA0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCG/b0i5tGa+HtsYaUm8cI56iLPkKs3xUVJX6rN8K4gHgIgb5uX8YFVJNGrhOL7/mavnS7ssYACNEmgZVK+f+iPz2E="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.2_1639082826680_0.2894627441009039"},"_hasShrinkwrap":false},"0.0.0-canary.6c63a07.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.6c63a07.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.6c63a07.0","fusion-plugin-react-redux":"0.0.0-canary.6c63a07.0","fusion-plugin-universal-events":"0.0.0-canary.6c63a07.0","fusion-test-utils":"0.0.0-canary.6c63a07.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.6c63a07.0","fusion-plugin-universal-events":"0.0.0-canary.6c63a07.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.6c63a07.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.6c63a07.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-GCkks19JXf6/jl6XrVt9+DxelpFWErArUm5bCBTGbgislziwAPebxrERYBlAGcLOSKF8dq2O3vkHRfF0M2e3Qg==","shasum":"551b16808d56e369b92eaaf6013add7e7008725c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.6c63a07.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh02/jCRA9TVsSAnZWagAARCwP/23X0hstNkstx143AXQV\nC+mHuCjmuZ3hexmB+9UAYQPfBf1yLgrg2o2KAdb+0fwx1SwteuMN8xlf28qP\ntJX7J+hUdZ5O35AfbmUz3a4C7jJxFUqKsAMJGUqe66SAGH5X625iy/avCgud\njEjrOKyBc9o8+pPPSnVUG6yWC5XgOPJjTA36ZqcfTSWyz98NgEG+vkUB/0BJ\nVoi2PEOEHKnaDQSCVd61rs5HrMq5/+59AvVKEHK3hw2MGMp1hpra65cu7Lep\n7CbDDG2UYgCpQNZu4XxJk9NCEl4I+KU0O7WQNJN6+gYjmPTc2ge3gBzbAszg\nJ+crL/WbyrdtJOmmaqthQoxYArU7jUUIQzR/REi/pJA+EOMx63ZuhKhDJFXY\nKofu6RDYkDN879DNcWAaA7TyolUX90XnmqCHp8NlAeWZhOAsvdcPTczNoK+Y\nvhrxzpnyMfDsQC4pS56Isq594yTGyPjv1RwR2E+rLmOamdQsrv4uxwe3jMrE\ncwILHjsR2Gu8gFdaX/dcrkyO7G9aOxdaxZ7ZFYqatG/RLNk2f4MvKTW/+qRn\n5ThN6flYWuGyzIZTBsA9p7hMcBncq3zc8ATt3iwemLCsgSmaL/J8qQo4owSg\n1g1P35/u1hte2Vq2gat58dKE+q7uXGMxyt0EECvqXMKkEVgIhkF2O/7NtLnY\n7nrq\r\n=GTfI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCd3Anf/dJ7xprE69aIQJHavpNd+6hwuj29xXRib0LBMQIgLTD4sKyuXUeEH6kaQ4Oy0cYVCu1gOckMBSGK1/Qzf9E="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.6c63a07.0_1641246691696_0.3156289446745417"},"_hasShrinkwrap":false},"0.0.0-canary.2fa3949.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2fa3949.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2fa3949.0","fusion-plugin-react-redux":"0.0.0-canary.2fa3949.0","fusion-plugin-universal-events":"0.0.0-canary.2fa3949.0","fusion-test-utils":"0.0.0-canary.2fa3949.0","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.2fa3949.0","fusion-plugin-universal-events":"0.0.0-canary.2fa3949.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2fa3949.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2fa3949.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-47pFUqnlqhBN4GDcpBrhFN2LPvXNeR/rkvQN7ecr90V7DNn1/Aeyf6zmM4/3BgnsBZX5MPLmG4ZzkEt8WizDxw==","shasum":"5b07139496dd48b2887ad20198a76c697ae6cf74","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2fa3949.0.tgz","fileCount":12,"unpackedSize":40968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1MUjCRA9TVsSAnZWagAAKYEQAI6dN28pr8tVr4akquLK\nRTtRHhu/s0qscxCWx9qLuupDbcItpKQFPFkbPXBFatgA3syf5+lv3YBJTuSC\ni4RHz6KTMDHz7kkgwe3Wv9BtENIjUbhOHkcqruTF/Oab5zw5xidwdLxCw8VT\nSapc49eirMWZvheyOYUN/2YfTT+CTJDSoRFhoujFF2O0rsdkDdVbtYDiMVpV\nbDxuKLlhZwcnCw1VFByNx65zd48j+iTPUOjGWytlgMAjhILIX2jMHKy7ZrFq\nf2hb/lb0c+HDLcLkFlsIsSF15V8iASl9AKTrrSO1VU4Ea791VZJ/ptNqmJcc\niurft1tW1U6/izVmUZ5nEfznskhmhqUjbR6gGQfWLvzTvoMeMKSOj/N7AMxO\ngxpF97AmtrtZD/1IHueXlDzRc2trTyQNEnUKAGR8U+imCqC+9baOlzJNgx5y\n1WnCrUseFtodt4QEAWG5Q3qXOpBVHtsNQgV2RDKthDGfNKdURPWQV1jfPOA/\nD8ci5vSc00fzybxvaF8G7jTkId/cukV0SFfZnbffKGTooyuc4ZLYo5MDACGU\nRf7dN7nAoBEts9d4MJUBggSevJ7QIPYTHby8HAYOUhbmcIGu/Ak4L0IKSzRF\nvARIDufBqCl+bN2ViZ5T9vYKqZXRqqgGSMCuSZIbHno5NNmdINhm+xXr+MxJ\nYnIB\r\n=QN/X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBuQLCaMzfot5R+o83yHQmcTyYlqc6P5MxLBMJxwB5goAiBUDz4f7xLg5hNZTdg3HTmtw9prM5e58WiP09OJcpOW3g=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2fa3949.0_1641334051208_0.42788504903371005"},"_hasShrinkwrap":false},"0.0.0-canary.4b5b637.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4b5b637.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"2.5.2","fusion-plugin-react-redux":"2.3.2","fusion-plugin-universal-events":"0.0.0-canary.4b5b637.0","fusion-test-utils":"2.3.2","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.2","fusion-plugin-universal-events":"0.0.0-canary.4b5b637.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4b5b637.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4b5b637.0","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-aZzzj24JyFFX+AcRdBZ9OkWCzlc0JsCHfrs7NiOsUSbM7TK8f8v3Z8Tfw2I1pJa8rQ5B/6dg6ulXnQgR/jf/Dw==","shasum":"20676e74f775212c5054b209dfb8a9891938dc69","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4b5b637.0.tgz","fileCount":12,"unpackedSize":40900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6J4/CRA9TVsSAnZWagAAoi8P/jBcCX7XXIV9CvcJ5+WJ\nZhRb91LK/eila6NuSJHH6Anuv1MGxpM8mJoJc7k0BOn3+5t5Vp7/6/NdxyrM\nMrWL9GR+Zz80vw3CPlFPKU4fBkH44j+y+uZ4ovkTPdP8q2xYVMq9DCWm1lSt\nRxG7YEtYiTkL20lpz277QHvdFwVuZ/YdkV4/wqG9UJDHwwsUJDPXRyJmRnB5\n59MXGpKFmgymsYYWwRljBpuZwKdDLyOmTxpVyLvQsus2ugqQqhxIWsxk8797\nVsHFJZeL9rCGcVHsWzyWodXr4o7F2FQVTQcU//IZ5HTyHDKVgzpy+w5bgrmn\n6KRL9ZA5pAl6dNsSj5RqPNlmAR4QZ5YijlyO98QMgysfZ7bh1+uL5cjT5CVV\nbKwkBeKdSi0bu+/GWwXtF+ELHhfNm1HPzS5AtYOiZsnHJNvm+bC4uMZKfbgU\nfLiaB3/vJwWYxzbUWubDWvD+4IycYDcrTc/Ftak2sT8m0eWucaFqG/1W4H9R\nic9E3Y4aMXrM4m6jGNtwfS/YAv61h3tfNzIA8la4dxrowL7a3Kn4XGWrfosM\nFpGRq2KJ0z7DgF8F1DyCEukebNg3O5Ib909yrKBj44MlZKD0j6XKan8cVjtA\n83WdC3BRl68N2jRWeRHL2AnF6F0DiCOAPTnaBpKHl/Lk0e51UhtxXUIPJXsA\nbs0i\r\n=LTX+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXbs6T0N+9ti/M6GCoUpkVCdd1FVW31scTKSUDEoEgiAiBO2h7wxiw6zl47uksCRSc5Wj9fVxqShci8ODySd7bFgQ=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4b5b637.0_1642634815586_0.1331812529876335"},"_hasShrinkwrap":false},"3.2.3":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.3","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"2.5.2","fusion-plugin-react-redux":"2.3.2","fusion-plugin-universal-events":"2.3.3","fusion-test-utils":"2.3.2","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.2","fusion-plugin-universal-events":"2.3.3"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.3.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.3","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-3+ySIhCuCTQvFGIVCUB6tnpEWt4jphsW70Nu8q6G9Yl5jTK1eqe9WMg7FkK3FWeHT6Y4YMNZS4Pve+mXi5FndQ==","shasum":"9a71bda92b0d15ac9727a2b109cb611b9cb0d12e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.3.tgz","fileCount":12,"unpackedSize":40849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6Lv5CRA9TVsSAnZWagAA0fQP/j4KQxJZpxKk8esgJFdy\nt0i7yuo4DS0JHKvKnsr4l+G+pS3z+66cPcz5xtv6GlFxAp9defK52Wt7XQMR\nkC/ioD7vAncqVVPTz5Fgj2CAVvkv2yZfl0ogz4agCjpsEzUaOIu1IbpWFuSz\n98pns8+10872Bll/pXs58k1O+UNXkvLnLJUbcCCt46AVKooE6HrCOvtu+S3K\nC26j8gxgw+ScvNWo7hKuu3sjiYeDt1X9hEiuqxcer/0g9+GeDz+YyHPrVJ5v\nQk9JwOeK6t1oNAUG08qr1rEigp9GX44iMXBPh9oSKygW7z+p+tNa9JGEZ/6t\nxXfWWBCaVWDCClXkNHuJHFjdaFF0HGGnhI349lIkUXwyt/ru4b6ECksyHc+/\nm+RwG8WA22BV439klvBumya+7hKoFV0WkzVxxnCidiZSNvsk7Mt3TJhQ85zJ\nZWnBtVCbLrHX/SqYoWwLiXREEfCRQiBSIXcsbcjBOMAZIVO4UjcM7fjSHE+p\nizsMSMUALnworH3X5JNZGC/2Of2VH6RXVgTa3Udi4IEiPdj+UhljVQCz2d5M\nHfYE2YkO8qf7FH1EHeBo7lnuTDckTTwUZGxHoKcuXXF1RfsDrL5FSzllOYBQ\nCK8GvCLbkrTq+igKTap2SgqtipS5+G5YL0ol6zaxkYbijgmHaWiz+82jBe42\nHMaP\r\n=BHiF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEfzA8reQjCB5GYMUEoJnz2VjOvr9SnMDjnGKpdhirNNAiEAhNRLZe5RI5cCDa3LIrJnbL6XRPnNAF46JkDQ2vFALgk="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.3_1642642425133_0.8442126735790689"},"_hasShrinkwrap":false},"3.2.4":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.4","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"2.5.3","fusion-plugin-react-redux":"2.3.3","fusion-plugin-universal-events":"2.3.4","fusion-test-utils":"2.3.3","jest":"^25.1.0","react":"^16.12.0","react-dom":"^16.12.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.3","fusion-plugin-universal-events":"2.3.4"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.4.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.4","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-fltNXJJoLvCrQ2nPk5bX2bqBP7OiW9+pb5V54AhfJ1LYtkhSD6mSZVUyJ2/9WNIb62pCLxGW1P+gXdGQw2wDIg==","shasum":"8350b6aaa6ed6f8b4f234646bd57110980ab28df","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.4.tgz","fileCount":12,"unpackedSize":40849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh9ETbCRA9TVsSAnZWagAA/94P/2lusFJwcCWOlIAMDtUn\nEuKmQRSOoW3B+tjxn6QIJbs+7gQ3S1nY1R3Gu8SvA9Qx+Q9Fq3ai8lK7MJvr\nn7XA+yCS1Ipj1f+V/VHOY/Gp1sbtmnvdt3UA8rtxJ6Png1bbCFTvJ0zjvztA\nvRy00ZmGsG/23hjf+GtUkL8l6kc7rGVHsYfpWm5bhDmox1dNMGajhjc5ciEI\nLGzU2N4HUApc2d7Kgi8KeQ8wxHNwEQOdQJbx8qfySRaR1FR0EKsaa66ZyCxH\n3sIbK3CAl1R2PreaDj73705VhUrEaGIifnRoTpZYs6FloQTz7ioiyBo9E1TW\nj7KPsTuQNP/ynWVHbGucoBodIYjTpF65U7ZsfOhT2y0S/6GAcYTAbBLWD4zK\nFWCmVFEih46ix7C0vxSwfhGro767Iuycg+2+p+3Hol4q8F8w0WlrjA2fKaC9\ntm08vtTAHfuVmMXdT/kZHSczDViXQDxxVo2xGrkFqlRHombwB080bU/LWhPS\nKU45XIppJnNcPsUnNB7rDEsXmNZ6fnq4cFOe9GthLfVCBGMkzxZOdAATZeZH\nSx++IY5rqNrQpVN6QhxthEeMCCDFL2ezdzHGTh6KNj9pSM4a9/MsfRrUsMrW\nbvIO4hYa8m6UABGoIGh0xKbv0/2p1vEeLzDpxLgtXezc+5jLtpvMk1Qgoud2\nrBQ0\r\n=5FMs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvXgG1nT5TY3B4kfHnJNoZVJi0KzKoeSnhdCnnh0X8owIgIIb7IdOhQsCf0npOZdJQ7FoUh7Vh4mhcO7oal2PhL+o="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.4_1643398363488_0.9733788902208491"},"_hasShrinkwrap":false},"0.0.0-canary.b663bd4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b663bd4.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"2.5.3","fusion-plugin-react-redux":"0.0.0-canary.b663bd4.0","fusion-plugin-universal-events":"2.3.4","fusion-test-utils":"0.0.0-canary.b663bd4.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.3","fusion-plugin-universal-events":"2.3.4"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b663bd4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b663bd4.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-IlktoRG/0EGWt9rtUFmWduCtOSpJHMp0P8dt2U8jqsSrpRu+CiyRdy+soLUGx1qTtRRDDXGZn47dXrCy01lRFw==","shasum":"d39b2e0c4e693df020a7b28fe7b802ac9461daf6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b663bd4.0.tgz","fileCount":12,"unpackedSize":40898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJ+eZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpkGhAAolPrv3cptF6p8QeQuHcdW9WFZBNGY8Wo9nSZ8HEq8uSNgcNT\r\nKsEt9BiPEEQ3+k+Yxw8kagjzMpqWMhe9WbtUlfQb7wVq0/mmswqX8dnDm4CV\r\npsxmza3V7TTLLBI6eDN0lPkPRpwUJH7jhq35s8Ffg4zMpVd56TaKQ+Lw+z2W\r\nkJeQkEDOzJK4Ca9mruMfrjIYZ2L15Rw5R+XBOpnD9q8Pg3t4b+pYCmNnwnRo\r\nGr53JYnMMMqO9GolQVqpVBEmOKYvBEepAcFT8TvXjp3am8CMB8B6ygFYt+Rm\r\nwD6BpGSwD1GI3eYhVunClBQWxZ3ylsWuSmNspAK6qHCjmpAF2zjPeoZaZvkZ\r\n1iDNw5aRZb2htCTts6k+zraXvxbEwIfbjJ/oumG55eI2P5CToE4wbThz7tXE\r\naYTdwa8I2AgWfgXOm1/TN7Gcs/wo6+vsG7o3Qn20yjIZ+nXJF67BwWOacbn/\r\nraLtcre28sS6eA7xlyshDuwaaKr298gwcLZLUP/4RDQfqGUnwkfQO4d06kx6\r\ntpn8rNV2ot2fFrv/yizEItJ9YGgdHBXc8VXvzcJU5S8BcAPODDERUzi2qugE\r\nuqvYn4nUvTEAI6QnlT96PNsgO9Obw/Tgfw78RJRoZ2zZBVZs48Orm7cNazY8\r\nvsD6B4/0kAIA/Bbx6cGGJ2dV8MJZe9qTZYs=\r\n=GNZK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuxoN0jGYDODD8PESydY6+4umjyBTp3gtoidZs9ZuUqwIhALPECVhl+maWYiQLXJxRBXrzrz9TiZQ+y+d5a3VYci2R"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b663bd4.0_1646782360914_0.6181477418257819"},"_hasShrinkwrap":false},"0.0.0-canary.fc310f5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fc310f5.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"2.5.3","fusion-plugin-react-redux":"0.0.0-canary.fc310f5.0","fusion-plugin-universal-events":"2.3.4","fusion-test-utils":"0.0.0-canary.fc310f5.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.3","fusion-plugin-universal-events":"2.3.4"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fc310f5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fc310f5.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-ARzg95SvIHxJKLzdARzP37zPqkZN+JRC53Gr6dh2CCDUI3/KBD2UTYreUZX67cH/qLl+rHZbI7fLJolj7yhcrA==","shasum":"723a3c8b081aa15bf9f757f38a6513286d25a625","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fc310f5.0.tgz","fileCount":12,"unpackedSize":40898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJ/v5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRfxAAiPsqMAD5jt/RAYryd3hElILt0Huh8t8yGvyC5aDhcHdDsO9I\r\noqQVAVD5mYxdQgUB71RCvVLe2pyGmADQQ4ZwSE4LISOmpKoalPNcQp+8Iq8s\r\nYJ9c6WSq6ob3j53oEWtoQdyitegPZoRZgPDhyFYdYVecfttmsKEoqDvVTh0q\r\n9y9GU9AS+iFrkB6lxuUwhYuklmBdccdm+sWy4jHmqVqn0T+Tm23aU88TWCw9\r\nNN+307U/ki3MWGzU9bhTUuDNPMpzh+LBqr8r0ksG1GvbpdNCMKjYxZVNQCe8\r\nHS5oY4c3cWqILOzax0lGvvqUuOZDMdXxdB7o97VpAs7s/VlKLDLMCKVzGWE2\r\nN9uJvpBtA2rNQfYeFHv95xIQ86Db7hf4fe+bDq+dSzaY4JI4Ft6EhpjqWXiR\r\nZnyiiHwhDEv7I+pvm1PVQn4aoRVUnCPJ8UO3jKMD2Ow/LG5hVM8ovOI3UKi9\r\ncnj54IrT9GwrvxDwzB3h141e2LozDfff9j9rlekao400itEzVDpH0X3Gi/Nn\r\npAY7WTjFdk2uWN6Dnowj0eCm/bJt0g2C26EX5GHTgMRK1E6bvD6nSO0wTrpL\r\nCZbYrB8k/gc/xcdPF5A2kXmoQ9J87i5wcu6uHhDVmdTGpT5YGPQVDx8YH72L\r\nxQWx8Ys3pR58iaiL3233rY702cqPfOqQ3IA=\r\n=M9gm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZn7VHZgjEQ0LOoN/B+XGQxwFUO0tNdNZ5YQAxCwRDuAiB/xNx/mO0LdUus7gktX/K+A8O8Kf7Psauy90RlM+IGFA=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fc310f5.0_1646787577442_0.28808043788024307"},"_hasShrinkwrap":false},"3.2.5":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.5","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"2.5.3","fusion-plugin-react-redux":"2.3.4","fusion-plugin-universal-events":"2.3.4","fusion-test-utils":"2.3.4","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.3","fusion-plugin-universal-events":"2.3.4"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.5.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.5","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-plvVutwwaHv7xH6vjKyize+Aw5qJPvP1N446h2rnnstpBqTnLwijAIEv2EvEfGSf6/5GJS06vcFXgez6uksJHQ==","shasum":"6dd9f7ea811e2af0d0af6c180d2bb96f7524aa95","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.5.tgz","fileCount":12,"unpackedSize":40847,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiL4jaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpeIA//ciNj4LO52zx0VspmLuZVSj6VJ+oVLNgqP06tgqnmam1QSTfJ\r\nI4YEtRWeI0UlQQ4PhirEcMaOoBROyAxL14zRkpQcrIlqxrZUaOIZe17I14Yw\r\n/NvOvVByp1zzwo6lEPoy2t2tPVWqmfgPjV0+vr4oylqSRW42DrpTnrayAUWg\r\nos3XuLxhTfrhMneS8Sn2XhhqUW82BppRgq08E78b2ytdHCDs8GSwD2+ZjFcP\r\nOkGhK2Q6Vm28WDof6TG+Z13Mww7NLAq2uaWYhGDzlBPf9b1YTYmo87lUPpqP\r\nE9Vo9xsuOPEDgNXr271tso8lAJFvbOsDDeyZsCmH/9hrPFzD0hfhIzBbiY1K\r\nXJfmXDcTcZy6iyaek2mt9tpBa4QWRbfl+HkeXk4OZ8iLlb0CqHVbu+hf5U8Q\r\n7yfnpa+FKrl7Y/xw4uYpnCgs53XQ+RJTCEVUpFuE90QZmObgmtnRmNNMzpAP\r\ncI3gNuwXlRrPtJkIYK0k29Q3O0kP9SFg/j09UnZLNJ1lzYHRKt0JdQYprkrM\r\n8tAT6H6eNvvo4loHEqHac8tMaik3CgRtBCilsiA8mPl9uprEiWPjv+ZzxHS5\r\nK50O9hVDOdTGYiu0sMjxGwxNeopNGf5Jtb/MHfQuklFhQdDxOhkl+fVEj2GO\r\ntwY8rnz0XeafBNZ52UgxfR5GdPZealMeUQo=\r\n=qdID\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIElrRFDe8mx0kQ8gqTJX1KNGtEQCP7OhX9t5dlmE1ftTAiA3qJEEKgQ8VdqumDCedwlb9OgvOGZVoqLHQO/BT6OxRw=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.5_1647282394052_0.28246966235769233"},"_hasShrinkwrap":false},"0.0.0-canary.2961969.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2961969.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.2961969.0","fusion-plugin-react-redux":"0.0.0-canary.2961969.0","fusion-plugin-universal-events":"0.0.0-canary.2961969.0","fusion-test-utils":"0.0.0-canary.2961969.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.2961969.0","fusion-plugin-universal-events":"0.0.0-canary.2961969.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2961969.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2961969.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-OxKE/2Xaqq9peatGfvaLT7tc3rDxd9r8xBT+Lw/Xc51tamAKGFqzpaAdU4/564vtMOm2KLBwuaFImQmNFpVnbQ==","shasum":"1f823a672f6d34f97aa06e09544b0c910a5422e4","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2961969.0.tgz","fileCount":12,"unpackedSize":40966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOhAjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPlA/+JjidDtiPvxizvTfY4t+HP14VmIQz6rmHeHCxfaaRluFusY5s\r\n9qo4qNL/mZfp7qgPZrVPBRcXXZt4dvWJx1QvdxcckcCQEAFqYVqBIHmQczHc\r\nIWTxnhjDjBrDTGH09HhPAY1UDqWfsGLrqGmrPAV3YCobwvtZHyoea1PB7zLP\r\nW4bbUlXsVPBBydbu18wwqV3Q7BRY9c8ON8wI9bDz6v+cjSVWNalNKTGp7Ql1\r\nMObm1Fyzgjiii1Lbuo7qFdkKJdQRmVf4KOV4crBrT+e8/2W/DU0hROIs7/NP\r\nCDmx+pve9zbFt9T2Zz3QiKjAkflEeZDu8bvUdRRnaYGB9nFcmu1+QAEKQHIn\r\neNa7SNisP1FJwhaes6gpjCfVr8c4gOAAzgUlsBLeBjDOLSbTedA+g73ZkVQq\r\nct39sI3i6TuaHrjth8HJkyvPubRd02X0SwswBMSZ9dWPlwMAaKvu6vQmRoze\r\n2Ud8J7/V5Y/OIuQyCHkJwTKgqnC6lr1G0G2ItcOaW8p52xyHfl7AjGXLt8Xj\r\nEoguA5YG4flJkSoDyJDXMhczgV2661X024DRHznHGKIKwrheVfLElV6e4uQf\r\nOosDkjHqQSoK+yA9EXvIk2sVWRhTCC63W/C8W4NPx5St7cuDUJtj1HiC5EzT\r\nOxvOXUgmAWvxnqr2ZD2H6kPmx1A2BDJnONw=\r\n=Wh0V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC6gG4HE+cm00QZ2rPU3hMtNyoMdS9/SZclwK9STRECWAiAuSPJJ37TW2LbDDoe0mSQdwvoP5raxVlGyUkbptMUzng=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2961969.0_1647972387565_0.5602071641655857"},"_hasShrinkwrap":false},"0.0.0-canary.5dafecb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5dafecb.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.5dafecb.0","fusion-plugin-react-redux":"0.0.0-canary.5dafecb.0","fusion-plugin-universal-events":"0.0.0-canary.5dafecb.0","fusion-test-utils":"0.0.0-canary.5dafecb.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.5dafecb.0","fusion-plugin-universal-events":"0.0.0-canary.5dafecb.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5dafecb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5dafecb.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-0zRAlYSI/OU1mJxn2zwjee+qRbpoKtINyTiGufDhckcqA28ZSj3Msj61u9WOlsJfv2sEt0mS5qEFJYYgcFpY0A==","shasum":"ee5d3d4ce0ac1c0650889718178525737b52112a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5dafecb.0.tgz","fileCount":12,"unpackedSize":40966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiO6XwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrh/g//RzS0VEbK4iB4TJwaCRnTQApQJbWllr1RM43NzYZhhb2SC+fc\r\n4UzUwpGBuwTY9J5x9D3RY3SyxRl1yb2n0GuvkUa4qfVouoaWMGKBk26wgPlm\r\nmRHwStEgrZhJ1W4d2PnX9URG/Qzl3COPmcbnHG1d7UL2iqAN7w/AA95+AvpX\r\nyJUl+G4wBV2rj74JcqIFt3vfCldXxYBAGW/tQcifjUPHN0gPCRjmYmFWCT2/\r\ngtefHIjp8HQweznW9Bbx1m/RZI0N7f2e3FtZkFQVrawwKZTTHZsPOFe4gBU/\r\nOInh3ZdWTDxv5ZS8XAlwahC/rX09o2x4c5V3B2hHL0g8rLrEJpmGxyFi3kv0\r\nF/M86JIsE6yOzsxhcQrgC07GRId+CmLR6dTfX1RcltWNt1q5ccl7r+guHrei\r\neLV2Lxhonc5hAl5Kut/xzAPIswkn3nLgmKIV2sCXD/m5VG6sFDCywbL8LHsY\r\nxraU1OuZHeQlo1SxRsHJvI99cuyTMOwMXq/TFDerjrOPtb6+ugZovaq3V5D7\r\n0jSq/r/zUDzkdaOHBo8Nc5sRurOG2bPP//20J8EiuulhxJmzkjZLwjEldC0/\r\ni/otXa9kuPTLBB+vxpIsOzocXGEzcjm9y0G0GtZCaOP9/pj40Rd166D+1ezp\r\niBG0iEXmaO1wJF+auTCgRvET4Z/wVutJEG0=\r\n=R+Qb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDAdM8OVTvVmFhywm1yiNzDPDAJdXMJhhuNLB6F0FvpDAiA+4Kf/mP074qCbFF4uLnU5PewgbDXw9xsJikA42EBlHQ=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5dafecb.0_1648076272176_0.2121242009892894"},"_hasShrinkwrap":false},"0.0.0-canary.f10290c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f10290c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.109.0","fusion-core":"0.0.0-canary.f10290c.0","fusion-plugin-react-redux":"0.0.0-canary.f10290c.0","fusion-plugin-universal-events":"0.0.0-canary.f10290c.0","fusion-test-utils":"0.0.0-canary.f10290c.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.f10290c.0","fusion-plugin-universal-events":"0.0.0-canary.f10290c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f10290c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f10290c.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-DTwRwAOjSDKy0XTS4Bw13jNNQJaqWuvtFYm9Z5+T7jrJcoTplhuVWOA0Drs7pUPzQLVt86cgL9+iTlZ+0cWA/w==","shasum":"8819e5a6742276815a8b85ac2f0d989acf08cf14","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f10290c.0.tgz","fileCount":12,"unpackedSize":40966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiO+BMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo20hAAoW1BgsahFDOxit+BTchBTKyCVERtHo8jnNurZjNin6tasCe+\r\nSR59BQUMppE/JZZWXR+vop3iBqi4k8Bz4QoT9qZAr+WmPl8X5dVQh+Vwy9So\r\nNt7SDchN6NoP2OAvHe7RTcgDWED4LJeIVSFfgrTaKlgimLlonp43y8QgU1C4\r\nhJskBKgTUtzLG+oGT7ach+m61X6WvfzLe4jzFiUebHBXWGDIIuFu9I/oDVbK\r\nQsisoz+5108Qf/B9ocmN3dgcHWxiy/CKIgq14dXpXLofAWmT94Gef5v3rQE0\r\nC6qEMedNk7WUMcs5o1EUSbpEg9PY8OpOH9gzGXp/9yVLYOxT/XsXgeq6I/33\r\noreNDUutniavzCazT3SwN5TFUF77BcTBWbxGGEx4HPIowQ/Of0O+SHGPGzn/\r\n6K0BZgDjhXNXPMdms29Rg+R1HG21NHqayiLiVA8Le9DUZ+DwfAoG6dZuCD3E\r\n7Jtf6mRN9IV5PDhcvp4KYsAmH0CmT/8Jy01Lyiik/Ytc/HK1/WNOjQEEzS7C\r\n3NIVpHVdXWj4UmGibybSZ2rYtXj5ZITjuHLIFzF2QnJvkjgujlPqNDQfNVC9\r\nQsW1s6/VRpauWRzhYHhx4Ehc1Upl0BVULIfVlvwrbFz4HRMUe9jp04+Fydva\r\nqMlCHJN6olD76SbRqTnFlgQRrV1TlSPuJUA=\r\n=yENR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAxtqPUXbqJesSQGL0BoQS5Xi/Pzba/rSwSb0Bvk7EGGAiEArIMepuMFxG5TlzUXMJ4v7Vi1A41t0scl5OAkEuxIRyU="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f10290c.0_1648091212303_0.41534782400193615"},"_hasShrinkwrap":false},"0.0.0-canary.4b95c4d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4b95c4d.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.4b95c4d.0","fusion-plugin-react-redux":"0.0.0-canary.4b95c4d.0","fusion-plugin-universal-events":"0.0.0-canary.4b95c4d.0","fusion-test-utils":"0.0.0-canary.4b95c4d.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4b95c4d.0","fusion-plugin-universal-events":"0.0.0-canary.4b95c4d.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4b95c4d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4b95c4d.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Tcxr6/vpKpErGmHbTnNyOq3iaeQg2cRKllERvrFMrD0rgt/z05kKdfSmQmYnCQ+Nn6EU24pBx2DhTFXyz6ru3w==","shasum":"addf7cebaad015c4b0cd98c4ae7db97bfac5adff","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4b95c4d.0.tgz","fileCount":12,"unpackedSize":40966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQB2uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqy3w//bHzu/ee7C5niCcSXiE+GkMM0EDJMRh1WoH6IltgxUMySkuwK\r\n8pa7WuaOq6xQZigpu4AIBTMmF5I/6MRUkoBOpXujeYteqaRGlsqyzDfEGJ2k\r\npVo/k5wYAry6HnktlV6N4NeGiCNX7rUqtRhBLwciH/7bqOdtRcqH59T1T/mc\r\nqT9MUnIkbADnDgp3RO/ryPsJXJUnrySCbn+Cqi/6Swsc8Kb+8oNLfp2z0Sfm\r\nCWHNoiVNMcfjlNiZe11Ja8ctLSlxK6zcKsRJw9bPAlFlrF8stCkQWecIXdWb\r\nbltq86/ynjlubCRJxeWen3VKl1d/1iGZ/+PFqOk7rRLCS13uUlnxouqt5msZ\r\nqz+COovFqCrOxNgysnZ92dohuT10T+7C4DOPypuNkah1C6M8oWr+4ghihbVG\r\nZeybxbOMu8aCoU08oJDVs1LdLJZ7nHhHAAoi9IP/06KfWQYM49zspotBmnvL\r\nmBAxfaNpDulI2espOILfendToN0wLFyNRfZttwsNZEUfORMSX1yNGJ3jGOZ3\r\nYRzsuIowwgOhDtBmZN4ZWSLh8zgxeR0JTjQLEtrxcH1iR0231fulSVO27Dsu\r\noqVmijnnQ3laVc3MAVkY9yoKAHFjdvWRN67uswgn9W2dxxmR7JuMoN8gCPDi\r\naokXqHidU5y4lHdes6r1e+jCzyr3vbzeWA4=\r\n=n48L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4g1avc1fiwKXyQpxc9WKQEtTj7y9t1RCap9IGesR68wIhAPvpgdZRQiT9KuTgrEJlLFFbjYod8yccAgAes2eN6GQb"}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4b95c4d.0_1648369070456_0.03355980635582556"},"_hasShrinkwrap":false},"0.0.0-canary.ba7901a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ba7901a.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.ba7901a.0","fusion-plugin-react-redux":"0.0.0-canary.ba7901a.0","fusion-plugin-universal-events":"0.0.0-canary.ba7901a.0","fusion-test-utils":"0.0.0-canary.ba7901a.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.ba7901a.0","fusion-plugin-universal-events":"0.0.0-canary.ba7901a.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ba7901a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ba7901a.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-4Deij6ddpEBdGlasm18G1cZGLK2pjZt78dts9Tl1Xh6wD7fcn2m2J0KMTc+JYryPOhE6+b95h8Tk+lmwaSSf7A==","shasum":"eca6f66d9dda2158eac90733bdbf00fb1dfd28b7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ba7901a.0.tgz","fileCount":12,"unpackedSize":40966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQTzsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmovexAAkuy5Mb4N5UYvHH6dGuA7hSCqLSgUSt/+gfrlPL+XRgn2nKBt\r\nbdVnWXm6IoaQY2Af/BeOczWj+36vYKzx1auYctezgREiM4/dGOZmOe/lpnEJ\r\n7rf2m/ZY/k/KhN2ukxUptIsxUEIpKhYuwcN2g2uyrzn5ki4TQVmAbGJwu5T7\r\nzrKIfNC2EHhIBQ4Bevs9Cw0RXa4eb6DmYCh8SZiaGk9shh3c0+EpD33rp+v/\r\nM4rsgAqvrEaS1O42EFO5xpPIdgiu38hA0LT2F7mtO3B7QZ2KkKkD8aYUIDsF\r\n9Ox7xTBegUdDvfdXynvA0gN5cckOX2toPz3gU4kDg8UPO8SOLphKtR/01fNw\r\nTQi+vl2ozXPtkLHQqkZB3SmuEgMLLIkJs4pRh2ditMgAMDDpWSpI3bur3YRo\r\n4Yk3sYxVAQqFjVxvGlYUEFTod71ELM3CImnL3XwIuUYXYxSgPZ3KWGrUiCpw\r\n2ariFFy3n44I1niFebBoLCBTzd0w9Zn+wO+9SPLC5c5wzWUuDYNecdHux4Y7\r\n3ol+4dDSxUcyF4jsZPgMFGlfU48WkHTLLcGdGBEWrlhEzLyTaYuU8Owq2o8X\r\nsg976l+CE5YUZ4K2T3r7PhXwKyEmy4fyNR7dwtwveDrapnJ6p2qNeorHKrIh\r\n1U/w4Mab9PiaKBKQNDpZmtcaFQZyqjGIm8Q=\r\n=VEKN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTQWkLLRbhAuacKxdWreTmgnuPjVPYTi/BGDmVdzAbOAiA/L2vUsTITwrTw7QmcOSm2IaLoh1nMPiLedmDBvWRzbQ=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ba7901a.0_1648442604050_0.04850136059676613"},"_hasShrinkwrap":false},"0.0.0-canary.53e71c9.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.53e71c9.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.53e71c9.0","fusion-plugin-react-redux":"0.0.0-canary.53e71c9.0","fusion-plugin-universal-events":"0.0.0-canary.53e71c9.0","fusion-test-utils":"0.0.0-canary.53e71c9.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.53e71c9.0","fusion-plugin-universal-events":"0.0.0-canary.53e71c9.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.53e71c9.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.53e71c9.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-f44meLhEt2UZv7nritvwj5d7X6hgf0uIHEeaR38DeHhMpfeVzJHhgmGKJfYHphONhgEDY3+X8IfIZ3fVZZmMWw==","shasum":"5516be773e7ab38dbb2202bfba3740a3812b8cc5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.53e71c9.0.tgz","fileCount":12,"unpackedSize":40966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQUmZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKhg/+JjNziTR00SEhH99xTAzoUC/8cAoGIwHG9TYCDx9UI4pDujSL\r\n/DSk+rGISgI9I5NFnlGVx7DKZfNpxb+jqw0XOIKMLN8RTu6T43uDzs/gUTHu\r\nyE+7stDBcS7A3XLMzhKinxAWzlEklv5DKeka/Mt9XsfPNUea9NqfZsE1K4Y+\r\n7FcGn2KKcUR0kgNHdLuFzz2vPCAQEHh1iWRbDxyGCtwA8spruhA2Deoft/YP\r\nLLdp7oSFEEafhUjkSHNmTNYsDNZBdrn27/GAEQxlx96EG6WtroIF0Sms7cPL\r\nBjK77GqDgCgBVhEKhPxLzcJw8qHUyvhWEnU0PG4WEknJch3FxqQGj+4N4g05\r\nMHoVhPdtouM6rSStoYiE+ofRBS903gHUvnZaC5TR4NQLQi2fsGxpo++BlEAh\r\nB/+PolaMn0WGBPIZt7fryJl3jbYxUSHoizJn6vkZQYqbE7CWrEhom+eRNS9G\r\ne8iNAYM2JVEtOepMKlPh2a+jvUjyuqR+tZx8a/cojgefAByGKqscjXCQMoCr\r\nidVoWYQn1OvLmCU4pST/79WbFP7Sl2oSV3i9p0icRCVzbsx6WI1aPTeY6R0Q\r\n+Bi+Q2Z0LTqQyVvHDiPRqeAvJssXvLBYKmbUoei59CnNfSbWTrsNHV+gi6gm\r\nZnqz8BoRq6RpHpt+g9a6tuAf/JC4QgVgtok=\r\n=zA8e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFUNvuKu5TZx2x/8Q9ErD0GbJ05lCHX7vbe0T93ZX4jAiBqvSv9gD9JHFSxvXhOxqoIyAJlPTnZFqS4J5yaMLWvWQ=="}]},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.53e71c9.0_1648445849110_0.20318492709101754"},"_hasShrinkwrap":false},"3.2.6":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.6","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"2.5.4","fusion-plugin-react-redux":"2.3.5","fusion-plugin-universal-events":"2.3.5","fusion-test-utils":"2.3.5","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.4","fusion-plugin-universal-events":"2.3.5"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.6.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.6","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-URzKjJ534eJsewD93DCBGtUmXRdvR7Wx/UuyrI2x6WLAkrZbv/Q0j/aUwG+dFvUHIYpwai7UCVIy5SC53f2Yuw==","shasum":"0eb02e04b1587df59122730d783d440dee4f7e72","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.6.tgz","fileCount":12,"unpackedSize":40847,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEbCdgvPKVyrJ55b1eHApeTM8QAu0o+n9UVzGR1AAzbaAiEA3ofHS08oxZErEK/HBER4yHMxcN7ZohrYuD28sjqnk0Q="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRPHRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3FQ/+MTu/2XM3V+69IP+buqBvEB+9I4LGB8yyfIMU78/gYSsZo9na\r\nfiNB7KVTt+I3P+0N0xYWuo0dGM6sevvyS53XZ86QWRqf5wKnQciDqmzuvBqD\r\nLQ2SqtGDpDz8Do8jJqzxTZSZsyKfxT81vfNhlxytAwe2QZ2IBIs56yCQkJkl\r\ndhYejDYHoSl9AQtpggcB4mSyKsgv+tcfhgurZUnLEEdADk8WB9po2f7ylon0\r\njpqdDteVYPfb7QoS5IHCgbwhbWu4wKlM6EOr2KnPB9tuMUrGQEc5aR4CkWDm\r\na0egZlE2MZmvaqU8EFugir3BYGBegNNTXnNo9CflEgIUrp5z+/yKlQZpfkdt\r\nh9YJe9ThC9Bx8+/24BJz9KxLSpHvvgdqlpw4eKGHl24hTwT8runVDDQJnfbC\r\n88Zlz4racxr5KkzNo9uArPyIklk5LkiWkwOgmWhXS0fghHDg2U3FGVUcehQk\r\nHXY+MCL3AeaEHXeW6yHCjwB+oyrg7XdXUrwrNKHm0xKOtAgki++RkyUgRyuP\r\nNwmyAjt6BBfRqQA9Mn/usSEM/GKexre32Q0RoVuzkrAj0ELksUZAB62H/jtH\r\nEhjBgO9/xadJ0jHvPAluGjIYNlRWakBv1rzcB8DJ76wgs+n8T+mHWRKZebaI\r\n1UBxWwRaXzrhc8gGrsDqztivLdRhy73q9EQ=\r\n=ogeJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.6_1648685521533_0.5084835008312634"},"_hasShrinkwrap":false},"0.0.0-canary.04f01d4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.04f01d4.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.04f01d4.0","fusion-plugin-react-redux":"0.0.0-canary.04f01d4.0","fusion-plugin-universal-events":"0.0.0-canary.04f01d4.0","fusion-test-utils":"0.0.0-canary.04f01d4.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.04f01d4.0","fusion-plugin-universal-events":"0.0.0-canary.04f01d4.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.04f01d4.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.04f01d4.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-ol/n+9bRzYT7Kg4jSXnu0ioJyGQNXVKxP4QFZqKlrSVm73lSW+zX7eY26yFwc10d/e/sg5qDAkEtEcQuk04zvA==","shasum":"0092c90790335bcf115b1daafb1f36d942615fb8","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.04f01d4.0.tgz","fileCount":12,"unpackedSize":40850,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrdFbFizTV7Wz8lM5rIq9pJ2EI/0VaUJKd1FSLQxFNxwIhAP0U58GREFL/2LP4y4s/ikHj7KOtZU1I0FLcZMKm9AOh"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRdWQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphxQ//fJNWkEbOnTDnGBAujWII+XXuAoQAcOWKRUOY3fzNk9e8qGNb\r\nd4PxsnqGhP00xadHJjM3LIFflQCxDfQZP2IiB2ht6tuXlLpTP+v/PaZ1opnh\r\n9hcC/wIJeAzg68SjgIeWz8bD/9NGmOwmKZDhCu6BAbqTWfGaRaSiDAQIIe8C\r\nUPvrsGu9nUqRTPzbMJBijCRrlH0XAF73/88AeSEYSRSx1OnH0V6COZw/Nfxh\r\ns2CNjJFCV72gXKzDM4JA4nnCfRLMmPhFFS6m8bowHj/lUyfWaAdfdNL/Q/OM\r\nTtbHRKoWhbiidgTCjRrmVVBrRIK/NkgWg9lKgxWm5CibPHS6e0dZycGl4D/7\r\nz+Y6eFNYc7gsAWffEC1lvU+vlmprcnS7WZb+ZiwLYvx4qNQmZkzAFpDmY9ds\r\nm28HGYy4O3IeZHY7EJ2zh/0UhawRTnlKT7pbfhiXxsC88TZmi+ogzaQxUGjh\r\nCP8XYCozttzMhrh7BjUVrxu5QGJ32mKfWY15MQxMYCVkJelpAwKR38xB0vu7\r\nZuSFmM+unQQefVEHbo62sQKEHUutvjRqZAWabLxcYy9uXBSo6er0UrBY7RF3\r\n4kFpCxpztcHrEt8oYTX/pJBxAkVabVOggh/oFGTBIAaW4OgB0V0Coy2xG1xX\r\n0YG/NtJl91dP2US2dgdSLjHClpFl92zwaQI=\r\n=L69L\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.04f01d4.0_1648743824756_0.9309547331542545"},"_hasShrinkwrap":false},"0.0.0-canary.0115aaa.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0115aaa.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.0115aaa.0","fusion-plugin-react-redux":"0.0.0-canary.0115aaa.0","fusion-plugin-universal-events":"0.0.0-canary.0115aaa.0","fusion-test-utils":"0.0.0-canary.0115aaa.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.0115aaa.0","fusion-plugin-universal-events":"0.0.0-canary.0115aaa.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0115aaa.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0115aaa.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-raJd8YWt8DWUO9vTjcSUmFJrtudoxvmPzrm1CSUe71IfQ45BDokrP82DelFkpM0leBFxsqaOQMTu3+nr2ekLpg==","shasum":"4cf4a77980db7026a57ab6a560e2a4e9fd0fea0e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0115aaa.0.tgz","fileCount":12,"unpackedSize":40850,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHHYmV8cJMrbXIxapkkLrSWklVOTknUU7k9raIAYd5W4AiAybqifrnTeuVDnX8AVNoQttnr5dqIPNS36Yzkvz9G5XA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRiKbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoqWg/+IM2WTUbl2Ptb3QblBHAkZfcWYhDNGalfWbzLKzD4LEoqZLL3\r\nKXHULznglvt7GUcuqF5QY/EWMxRVXQXKJ214ftBkiwJIIrapKqRA7JdO9LWL\r\n28i02FNcJBmIRfuDxX2Jxx42166XyEr6eY9FUoddkAtqmiEo2GNF2uD8GCoq\r\nKTWAgw7nQTwFuH5WJQJn0pzQbckLKFD2Cg8VmBKbsPIL4whybT471uwwi+BO\r\nsNeuA8DR5mU8YHBqhaHJiLEIaH/5DW1zC0C0cbKagwpWE+WO4rlb4l6/05FU\r\nox6URfYshx1yG6eMhkscqQbKVRdYeGyd08d1LtPl202/hiaoWV0xBEbFxSVN\r\nkW8Y+kRPrepzvko+B2RsWU5Q38LHZiCQEZ14LZndKARRS4emoSE+b55Yn8Oq\r\nnG/r01TY2a1Ul8nmtw/nZCvpBfGjbkqS7P43MA0CMsUfk02SNKcAsa89cXJB\r\nQpIA9u5NYaIYfRjlg6IbMoLnbLlStO4+svjyWs14nCG103XpR4vxHN54c/Lw\r\nM+2IZltyz7l/Ny6ZiAw7qFzhaSFaMaD1ec9Iu5Gg9mKlVyMXjPIHvunPBSix\r\njmEEs+mXo4zmpNarUh79Fmz68bPhXNBDmjnRdkuPSAnARukKuJgHjYtLyE7U\r\nx5Pn/GUW4F6PGl21BF7Q8EXNaeNrlmwBpDo=\r\n=qqbY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0115aaa.0_1648763547042_0.027143803968978863"},"_hasShrinkwrap":false},"0.0.0-canary.3fd760c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3fd760c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.3fd760c.0","fusion-plugin-react-redux":"0.0.0-canary.3fd760c.0","fusion-plugin-universal-events":"0.0.0-canary.3fd760c.0","fusion-test-utils":"0.0.0-canary.3fd760c.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.3fd760c.0","fusion-plugin-universal-events":"0.0.0-canary.3fd760c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3fd760c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3fd760c.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-oZbkCZGG+IM1YZD0jDy+vAoXDBNOkn+GpAcw1UvN0gJhIzBhliQCq4vNgV4hQX21F6yjd/ZIu/kLxFjQmDnleA==","shasum":"3618f72c8387ceeeae37679900a87cc410ca2ca7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3fd760c.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICqwoKmhOauXIsx4wcrnTFqZNw9Ef3HGAAK92jxICL9yAiEA4LZ2yUYDgb5TfWIdvqXO485G8iYVcFHlPGGurcUvBZc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiRy5qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCVg/9FTMAPBqD35+W0ZFEfugmotTJQzuQEUu5Sf7SUJCTr+cs2KIA\r\nRMNXp0zStPdddRcjIaj9NHdG3fXCnu63kkQ4J/WOBOgtv5dcOKdMhb7GWvsK\r\nkw4BBTWPkYSks78lRLjsYGJ+ENLKF0DBlDfp9u44Eo10Wko5ei0GA3PkD36R\r\nR1kPqbd40CaqPdsHqpq0AmYkB1tyIhEVEbHG/aqzhU7VFXaHmB9aLA1W91s3\r\nGQzCPl73680vfooYE6Dnuz85X4CzIZPlDRKIL+fNWH53fR1SPitfHlBnRFUg\r\nFFrRvySRCpp/s0CC1LRn5cQLtHq95n+iV4kaGF2abZGzKgIooULwnYNU/Utv\r\nScCIjpEdnG/utT3kaL8bKoFqFy5wTZoUQg90KIuhUianHXXQtBnoBKhUvaTs\r\ntnceP/sL2xEwS6biFWzVJf3VDOvPoSCfecd1KiW1BpIIcZXWPXMUM4dYi2ew\r\n4YFPwfsqGyyGa4GiV496cifZM8WxZllqfygpLNmsRIkrneKKq0cXjrPPu0EF\r\nYVtn7h+rI9LxD3koKWIGEKOuEfiWWfSzq8Xuh2zY/u74T/D/ErLF1NLH7Tt8\r\nX8cLAz3nBOcj5i8y6brnueLA/WhTPGjmujMdy3MpOcSghh5Yk4urNX5CacVK\r\nFJL0NXkrbetwWYL6spn7xKl3l/OCcxr2aEM=\r\n=4rzQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3fd760c.0_1648832106805_0.12701332024769574"},"_hasShrinkwrap":false},"0.0.0-canary.d90d4e6.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d90d4e6.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.d90d4e6.0","fusion-plugin-react-redux":"0.0.0-canary.d90d4e6.0","fusion-plugin-universal-events":"0.0.0-canary.d90d4e6.0","fusion-test-utils":"0.0.0-canary.d90d4e6.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.d90d4e6.0","fusion-plugin-universal-events":"0.0.0-canary.d90d4e6.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d90d4e6.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d90d4e6.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-YUH/No1wLmDFkSfj6HkYHrcVpo09tmWotzfV/N3dMtsAPG/mSaaG4xV753lulv+QIgPStFcwIVb9QQ+N/t7XFw==","shasum":"b6d72933bf470854c6ef4e6478bc5c426fc045d6","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d90d4e6.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIFNiM4fR95DDN7z4+bAeJb289IaRV6DIe2OK7rj2d4o7Ah8tnKfwSPVK4XOBbQ+in4oV96c6B/ONGRpb895qUlPY"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiR0TRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHgw/9H4o9Pl234x0ObfoSwGaSPTEt3o3t/Y/GRllJeCxqIlNjc3qW\r\niSHVTDPrlSS90J5Y7YjrZsjxfL5ZL07muORphghnavVwcM3qS8ZW1AUfP4AU\r\nRMMSJaD5SBphk/hVZtSIXxYqpFANpVsKBW62lwYQbMp4UELpe7udFjUQA7zp\r\nzwKVLiXqZgXCCZbA39IYVebkLhRogra8qUgqpO0JLLkqZ4EU1nxwZJlhnMrF\r\nYeynEZwgilD+Nm7TtCiwAHrhA20qqu5b+1LG05QsALv6R5VpDNw5QPwmCOTT\r\nDFQwJQQOQbJ/h0SBUxkQcHEwoNEV+ie97ULUFSHXJJ5pmAvVu31ZSkBddqUx\r\nlxxx9bSLu24KsK+d508xnuGvwLQIQFvHscwCw+xhXeWzeArl/vpvAh2mODnG\r\n/0+anCLwowC+kOQIyUk6UfgzMFq4u09hYFuEvuNQnwKRsoseVdECcZ0CfWLz\r\nB7tJIMHv/tI1Fx+0qPTfT43erPvpbbBoLtuT2QuLnVnPTvJiIG/+GCRAA0SY\r\n/0wayhNa2HA6w6Wn8TpQ0j7lkjx5BQYOPB7LBo2m0xrPPwvvqQN9bMhsjzyL\r\nJS2B+xSa2792Kg/dDdr1ALJXqSX9U0BxOWr/+wwXV2jew1RFirywVeWiy4Yn\r\n2x65k+PIFu+BdLhZRgMkeiuEDlb7gktQ5pk=\r\n=gQhT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d90d4e6.0_1648837841353_0.9483523427114089"},"_hasShrinkwrap":false},"0.0.0-canary.fb16ff3.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.fb16ff3.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"2.5.4","fusion-plugin-react-redux":"0.0.0-canary.fb16ff3.0","fusion-plugin-universal-events":"2.3.5","fusion-test-utils":"2.3.5","jest":"^25.1.0","react":"^18.0.0","react-dom":"^18.0.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.4","fusion-plugin-universal-events":"2.3.5"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fb16ff3.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.fb16ff3.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-2lxsN3YYAiOIVFimVl7wJCHa975e4vNI8H79X59ABDE+IqYuaMsN9ThFI2g9A651lih37LM8YdLLcNJMuzCwiQ==","shasum":"5cec7a4236ce31b90c18f401621b962e21f1ff5f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.fb16ff3.0.tgz","fileCount":12,"unpackedSize":40881,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB5jitUA1rNtxld0f4QLfJFqDS+XcYhlFBa+QKujRvSaAiBmQ0fq0Nnmv8SMuUk6Ug5QLA+XyKQuzLDzwPXH/5ovTQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiR5mcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopiQ/+KP9Fe9BJPLefJf3JmMa6du4LetxXAV1EOv7busjeIG1+Jdn2\r\nrLsyE538kF9RAZSedxgTRy37mt1oFJTTMUx3lONPOTKsBlaGKggB7odMyAAA\r\nU3pFnxyK0coiPJYGmcmHQ1vGnKfesCMS/X5gg0woaV6wjDG34TwWNqu1B7wR\r\nGPNijrX1Ue64NuGY4kqUkWw009DIRpEHNlTz+MVk2Q1xXeRecL+kDkCqcMh2\r\njMKIdGk9PeBzvgqerxUHjVyP9Ix1J8v8xujSmhXhLBIsBwEzOAKE4AdbeA1p\r\n73i/ufz7lfko+QmIrFRsjJGAdLiCrR3aQEr8YHWKOZGV/wlq1ZR7Iau7pkdG\r\nhuHVp3H0Wx1TS34vxAFjsA5+eW5WysYorqJY8UpgEFBZQzbzF4UNgN6vvpR9\r\nA829GQnBnfgPqpuLi8MsSe37A5oCKbbm+n2nOt18iX+pLGD7ijIEC7XEwiLQ\r\nPD3zU15lrvTUdSD39zZ2kAUZWVoK6F6zbHk4QDBz7hFgE1/h+IWCxeIpex+R\r\n+inSqfk9rWj9aNEfi8GRodE9oGzjcnu74KBnowq2fEzrkopbJ2X4oV+oFFoE\r\nRk7fOcNV2LTqteBzRzrzLMjedqs3rPHL+868IuQ5SOPWP7tLTBSk+gmTjzIi\r\njgiy1KgYGjn3hZHwErPZNZSfl34XqRbY2Mg=\r\n=1vVU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.fb16ff3.0_1648859548719_0.4834028734396614"},"_hasShrinkwrap":false},"0.0.0-canary.b6e28d0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.b6e28d0.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"2.5.4","fusion-plugin-react-redux":"0.0.0-canary.b6e28d0.0","fusion-plugin-universal-events":"2.3.5","fusion-test-utils":"2.3.5","jest":"^25.1.0","react":"^18.0.0","react-dom":"^18.0.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.5.4","fusion-plugin-universal-events":"2.3.5"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b6e28d0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.b6e28d0.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-k7yKiJbBJnyB+LMrkcGBShMtKLN/llIXCmv9SAkIjDA++VKSV/l8+GsX7HwYO6YC5dmZ0xUoZA6I1eoAwsI0bg==","shasum":"ececed17db48b73e0b24b58594cff393580ecb08","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.b6e28d0.0.tgz","fileCount":12,"unpackedSize":40881,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA4mSp3tKjd2OvjHB8i6LIULQAnMp/EgHht4czNqlwTXAiEAmonWlmQ/zhIgFgKQmYgwwYIJRTH/G+jZgVF6rbbzX10="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiSQVEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXsxAAnFY6WkV7rEe9QS8Rt4Hu1+2ifCZ6HWo6nsiKjVKT6PnZX57U\r\n6YoUl2wqZvRu+j/Jf6Pg3MJQnScKbWZyBsOVPlyrzZQYbR+rdM9wV+6ERoaz\r\nvSVEEqM0dyZWItBlWJLscw/EKYvY3A5z2PtUxYRFva0e+IiF4fM4jbtdM+pC\r\ntjkQUarEA10XSC5aANPAwZkxUbPCG9hChGECHe2QdhglfYL11cSMztz+dtjq\r\n2cn7cENEn48UX/4AxgyXWfB2hIzOHmqvT4sOeEjy1+tLXqma4QVkO7V5WwJP\r\nir7EGzraAXt0/df1A4JArU1uphFZdQnFi1uLe+OogQJ0qmqFo+OmJw+TIsma\r\nQkFXv96AJDPeHHeVzxIzA9qZHYSllrFkQ7Zx7uz9qd8rwiUrGLQdNSer/Iws\r\nF86YMjknLcPPW5mFkV7T51evT2ybjxz5c2EMb3Uf6cvgTBgC/pjtxeTAoPcN\r\nLT9tFrV1jKiFN5BP1hSEmctpfmpVjF6u8iHM+NNKmW25Q+sd8hJwk7M1SheR\r\nNFB0bIuh/bv1xOBXV/Q+Xzuwg6U04nBhxUDXa+GVy6R6q0gZByUhUU1VXdd/\r\n1+9JB2LRSsI+lf3EXa6D5JeiZK2q8qKbfvCI4B86kf2mbTN25n+drkyCxUUC\r\nioZU+TlnQpcKwIQStZtOwg2YXVEBjtP8iLc=\r\n=a8Se\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.b6e28d0.0_1648952644713_0.5421033415590029"},"_hasShrinkwrap":false},"0.0.0-canary.0c6b102.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0c6b102.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.0c6b102.0","fusion-plugin-react-redux":"0.0.0-canary.0c6b102.0","fusion-plugin-universal-events":"0.0.0-canary.0c6b102.0","fusion-test-utils":"0.0.0-canary.0c6b102.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.0c6b102.0","fusion-plugin-universal-events":"0.0.0-canary.0c6b102.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0c6b102.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0c6b102.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-tQZDcTYKFZ4K54zWXOG8EsLbCKkrLsaoH9gOSA5B8dL/T2oubQXnL7k2OPlMsuf1vxUtsdMNr2u6wzBktUQEGw==","shasum":"32624d9abd3227ceec41c0a0d17d5c3c17436193","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0c6b102.0.tgz","fileCount":12,"unpackedSize":40850,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG48a4cO/lloIs6LTzZMFCPDGJo1iczMIcYNYUe9lBAPAiEAmQuxyDbma/sskyAUA5JCszCM/EKeo2+8lBwQ/H6LODM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiS6JBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocUA/+PE3Buyx06zXBjK7ZKSxUswbJKrhSDDQbxH7Z/f9nNyvjqgpm\r\nQR9YXGqGEpkXO06yj9N73/kl3T5zmXC2rXYuJ1ce1S+SSUd79h9wvzb10Vj8\r\nKjp1cM98wGe1UrF1lp3vV1NtZgG2zXo3lgVJ37NcElJJgoEPRPbTkSndH4Aa\r\nR+yao8jnDv1ePYpvMxRyGxhLR9r7BM0vBUw2CDn1Tz9pXVL4qDavcMtyZ1Iv\r\n0GKqO17FmEiQZTFDW6qARTrn9P9GZACx56glghrLdSoEcoy7dex94rqlq6l3\r\niU2FMmRP+fjrmM0fXvtAQmZqo7Bwp4fbGTWPZ/m3sMyP2tV75DB/bs++lDBe\r\ntEB4y1eZjD95FeacwZShbunrrdt+Bgz08EJKas3mpAJ7xT4O6XONsrunwHg4\r\nqAf+AOTn8UovyA6FiTsfDQogTBRMNwPz57Otm9RLUynBLaqjQ672uwmTIufE\r\nJgRuAsDtpg8GUBlQmxBvJBKIvsGAS1jbnLfxK7CBoN1FoEQf0TjOFVjekfTv\r\nNngB6dDz4HRFZVt5vHP8QPuJow4JkSNo2QcvkjGYa29scis5TG6D+tmckC2G\r\nj6hE8Xpw/WlN/qRjt9y4ZRhugoAC7a5GOixXbk9pUD9TSz2MLhEb7bwIpVCd\r\nac8GsaNjQol81u19BYfHSFmzw4qaYZiI24A=\r\n=wlEm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0c6b102.0_1649123905422_0.548603582595141"},"_hasShrinkwrap":false},"0.0.0-canary.a48714f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a48714f.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.a48714f.0","fusion-plugin-react-redux":"0.0.0-canary.a48714f.0","fusion-plugin-universal-events":"0.0.0-canary.a48714f.0","fusion-test-utils":"0.0.0-canary.a48714f.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.a48714f.0","fusion-plugin-universal-events":"0.0.0-canary.a48714f.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a48714f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a48714f.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-bCGeb/JMyz/n3gvOdyQbulqb25v06KoFpIKape+ubIfgqtcfgox/e+Fy/3+8NpW3B8JTPCxkE+EO15Cs958/WQ==","shasum":"b9af3e8cd1531928b279538d7f6af93cea39049f","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a48714f.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDWH6/4ww43wJBt3DSMU3yigMDnAnX4KCPSVKYqQjBfHAiBiWx6mFNedgTNsuVwNjlxlnTU8sSNjs0BzNplFdh8eIg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTKK2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpwMg//UZttjwt+p0NuPK97Ze9gF8UYtO8SzVhirzMkXPHL8Lz8vW2e\r\nWHpSS35Q39yoyMD2yFgNEoKc3QYIZp/dhVyNffA+Jzgj2tCpQbxt+UqaaKAP\r\ntrAo6/xpYGxKP7WRyzYY1HKxCjEgFrR6PcK9CH9FOVFIaj4YaxzvwyiY30JX\r\nWntTzDtsYzBZ92/liEb07xglFesrKnUVgIF8CrC+3UK7GWXl8SW9UxXmH2OH\r\n6kzTkBw+kDWpiBxoAFKfWYOz1yxc/r2UGAffVlzvopZGLgWqReMav0gR6XGW\r\n/UoW+c0gHO7NgeQZCE46O+hQ4ldX3eqMzORSdMipaTYAYyBk3N8+WRWycSN4\r\nd6q1iGfU6VJK0aBHkJ/54vDuXNX/29Ej9sJmgggAJeT169ETZAq7JNDoZ8oy\r\nEq8GnDqn8M7eCmwxcS0fvjygKvzQVdd34run4y3KSkapgJ3aBT7TZrm9OvO3\r\n9AFsqx3j5M+LDOCP2fuTct0/ejjylxpiTfcS0EgGWJohqn5vRl/EXqQhDE1h\r\nPDPswj/+Y6a6vEuyoUggbkwNrovmtffxLEEEVMiCBU+9zWblmJ9hkxZIHDFz\r\nMX22J7CIo0Cr+vpWu3qc9PhX6PlqzlgDeGlNX0KdgQgB1RbakXh7F9jFl4f3\r\niz/glMofkMZdjUq6X/XlHbagzOm20yC0Zm8=\r\n=0Ev6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a48714f.0_1649189558286_0.13301813367485482"},"_hasShrinkwrap":false},"0.0.0-canary.48261a2.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.48261a2.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.48261a2.0","fusion-plugin-react-redux":"0.0.0-canary.48261a2.0","fusion-plugin-universal-events":"0.0.0-canary.48261a2.0","fusion-test-utils":"0.0.0-canary.48261a2.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.48261a2.0","fusion-plugin-universal-events":"0.0.0-canary.48261a2.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.48261a2.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.48261a2.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-3OEe4gC29JefPRskfGFkajIF35GtTCWmqndyc6TNusc/OY5yxnEMNKJnKgZVy6SzRXWkSrUFDDyeuJfQGezS9g==","shasum":"224373438d56af216ebfd49cbea4aeb08f1a138a","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.48261a2.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPVoFFGqSLYojb0UMyYHl9qM8p8OTRRjLH75WtqZPOVgIgHYNq1nZ6ZiKrNhfmBDCk/jTd6fqpu5GBjGAng1fnf3o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTLmlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAVA/9F9ZlKVgsB+w5TtELKAlzu6sNr5ZGdXbhKBQimjog8WNsf1vY\r\nzalfessEvAidC0RUQmmUMjnsZu0sl6jQzMmZ1f/vnpvPOwBSIhT6pf4gQ3lp\r\nJEZJNb/p9/phVFGOm1UnKoXQZwx9eOBijasCheHaoJ6gXeXcHi+0507xwKhy\r\nzrIyd9AhIxS43o5rZ9Ybanvx30e7yOA1ykba3DfSNmTSel7puhGDIa3HX1cA\r\nQCZj8Z0D1OOF+vssOHERgQi+S3+Gky6FWyJGfxVOlFNK3RdhFRzl0UW0To5Q\r\nDdsamDeC0SY5TpTiDsGgdZTGLdp5g5SmRy6I2EclbTSIv3m4GBybzMlYnY/V\r\n/ifuE+Ji1Cu35IIq+77A2XY6cC1Wc03moPaLqqxdhrLdVQCYNlVjXLVTY41c\r\nsrQaSBVSLI5yrtZrDPkS+TZVTn/OYPB+Ibs7mBXaINDJx9brWAinEPavdUNb\r\nA5Tg3FK6Z24x5PZI0oyn8+eJ/dRguZUtKvmKK2jHiTwvncVDAjfBi+Kh6/SV\r\nSpZTuvJPJnBYbPWkcmNLlNKSr/RZMMRjmTIo/BATw1TK9ZYJXR7ObKzjFYmN\r\n3ecsGpSyGgzeL7itnBA8quGlC4EFZYguRr2QcNHl+mgYMCZSPTPUoBz9Xyzb\r\nt9u4IEA4UKjDQ4ISre7zaQ+sN3adUTnnxtA=\r\n=6LJE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.48261a2.0_1649195429151_0.14379035709454557"},"_hasShrinkwrap":false},"0.0.0-canary.e4a0af5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e4a0af5.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.e4a0af5.0","fusion-plugin-react-redux":"0.0.0-canary.e4a0af5.0","fusion-plugin-universal-events":"0.0.0-canary.e4a0af5.0","fusion-test-utils":"0.0.0-canary.e4a0af5.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.e4a0af5.0","fusion-plugin-universal-events":"0.0.0-canary.e4a0af5.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e4a0af5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e4a0af5.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-TWfPickcZVDHGXX1vs8QBoTDZ8WNhuOEfo9qOYVCuAaeU1TrCbKxzgyzWHK8e4QJNypGkORuCNuX82ZUoYf6Mw==","shasum":"7a49ac3cf77548945dd3390decfc807636a93db0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e4a0af5.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAOVnpuSs7GNIMZefSO5PLLvnuuDL/ssTebtz9ohhMegIhAM5JIX2lhFd+HFym+flRS2mGODJ5r3rojp3y4z2byxy5"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTMcdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOtw//eknNSPsn28/tU9j06RWbd67qZCfz6k4RWmCeP0ey1R6pLYsd\r\njxZ3f3iKfhKpuO4GDBVtTvhRdmj77HPyWuQ+mMH2qz4tVEmGPjpxMZWR7QOY\r\n+zYQqsHsYUERKnEvVs1Js3D3Z36jhkdMwHTna4xsDMwXIJtPAZpJWdU4NhxC\r\nDTsWfLBSoSs48TqPNgkzKSIBbpdsarkoSSl+vr1QGdw5ioHwPTfNySCKTTBt\r\n3vptPQlCH/ZNJrQpIq3hT6shmajUF1rhp7jMdXJU3V3DmRKbIvmI0e/z7NrS\r\n+Fa89x/TOhRKWTdVFi/rvmTM6/RNdbEwI8NIE7wvZS+x9vw8qh2s3eP6nxcq\r\nI724gyZvYm2n4wtdWS7k6kyr0ENOYDr3q5ZrL2r25Lshf+acs+7qPUQ0CgKc\r\nr0R8JJNufVGSfRRXfNIO2gcHcj+5+kjMSHEME3dOAgrNjK2kdpnVvfJnOe2L\r\nvl0WY9LWVO8RsPmCXl5BDYwa5o/NmPBqFwbsF3yzfe1g33yoRpxE6M+nHp5q\r\nUvH6hHjH+gj2oFqSA3B4yodH0dVUtl9DcHi5j2ECQ4XKYVx9uqTgiKBF8qaP\r\nprplA5AolX2VNY8+zrR++ZXn+Ic1wblrqesWu4xPHsTXd0PaAO3fKZC8J5qO\r\ndtMgXZ3rP0wf5qvflo6rsv45neaUPw0DswQ=\r\n=dXYE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e4a0af5.0_1649198876846_0.13260290263581975"},"_hasShrinkwrap":false},"0.0.0-canary.a5387d7.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a5387d7.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.a5387d7.0","fusion-plugin-react-redux":"0.0.0-canary.a5387d7.0","fusion-plugin-universal-events":"0.0.0-canary.a5387d7.0","fusion-test-utils":"0.0.0-canary.a5387d7.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.a5387d7.0","fusion-plugin-universal-events":"0.0.0-canary.a5387d7.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a5387d7.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a5387d7.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-z/L8YOctiMdPBmJG7scPft54ECRCm30nj6gHHJCllS2g7t6epCRsOjuu/cBo4/H1MtycWwl3g9nvLvUas5JkZg==","shasum":"08a4b1eab581b21232cb7616cecf870fd3369fcb","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a5387d7.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBUJIW4R26FTpArJJZ+Vbe4kE+ZdiOq+4vFkBobJVIPJAiAPZkO6KbaEcr15NaabQ+WMEfFxGEse0jHeL4uu4UvfaA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTbwEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3cxAAjO+dtfxB4NLFLBxCr0byWfxSyR3MUY2xk5Tia7/1JfzmioJB\r\nLNlQZdgUymgEWvemaCYAwIgQf6rjDFwA7FuijU0yHBneslWl0E3nO/JAA3FB\r\nw24FJ1GNHGoNspWKWvDq4PCnwsoC6FLHXPYMkTBN3Y5fhIrwXBTSBWJ5YFk7\r\nmXFv4gv+FVhe0MMZpGfuY1cLivymbIwwybSpfepUKgzCbbloJVIXJWizHYnY\r\neN0ttH+9IdZ1/cA3qiYOenNbfcVVGGUUxhXzQ1Gj6TRFpV7dlizWBiLmITL5\r\nIUMzY+BZbCIl2hZLBsRdFydIzGkwoIhpr+Xz7ugzC57As8n0C2LB5oN083y4\r\nY478xAM/Kq6zXgNUdXaCzpCMgG0E8sR41Wu5uegCyWP6nM9JOh6POQ15nwFe\r\ne0pJurOvYldh29ch1NU3zLjwoH5w6r3sBCzfV/SJjo+BQIk3FwKMCeJ/ayvW\r\nUor2zhp+O/lcQCC/vRygGmSDIHI4TB81NMcFgGwh6LzUDEyRVaM89vyHzAZy\r\nEmzPV9y7+jOxEV9QQv3wHMVojktW6256XjJWOhxiAMxINB2v7QbcMaTjNxtj\r\nHYHfXYYuPjN+M1tlHa1vrmHhi/kVRFFqG4SnhvqHfiVnS6v8A8o3C/mNZNFy\r\nYh0zX7sBizr3x/LV96qGQxxUfAyLfcSCa9A=\r\n=y8a/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a5387d7.0_1649261572008_0.9682753983394297"},"_hasShrinkwrap":false},"0.0.0-canary.4f43ddb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4f43ddb.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.4f43ddb.0","fusion-plugin-react-redux":"0.0.0-canary.4f43ddb.0","fusion-plugin-universal-events":"0.0.0-canary.4f43ddb.0","fusion-test-utils":"0.0.0-canary.4f43ddb.0","jest":"^25.1.0","react":"^18.0.0","react-dom":"^18.0.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4f43ddb.0","fusion-plugin-universal-events":"0.0.0-canary.4f43ddb.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4f43ddb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4f43ddb.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-H8C8A1KWPlCQDjo6b47IKgFotmmb5vcupvOnNwBAsy8QLnuHL8Icy5fW0M4jCZSxFb03Q0ZCCdJYeoSmKLyrYg==","shasum":"18a4719dc4bbe526a7122cd773969bddd7756096","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4f43ddb.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZzArBZMT0PxNN7jtAMtr8oMGVmO4hcDL4Dbew13V4UAiEA7HE4j4b6H6yWe/bN4wNsJlyiaZ2vsC/53sRQAH7+Oi4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiU6m3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrB0w//c7Wus8qJDK80weg1pYecUvFyEa5SUsip0hfqYfXvZcgbfc0/\r\npYYUTATyDCtTUXQsGu6diw405/yxwBboYcifmDNI/YB61t3hfop20FDxKv8r\r\no4vKwV1upzvIbIomAmm+e8vAYnUPDEhjZlrw1qpNbePyugcpVouKUG8lbtpb\r\nS3e+rHpObrJHuOp3wOmQAhnydqPI7gzrj88yd7n7KLHvfyccbBzcM0vytgvV\r\nFSQnZMBlyQdo6cLIQwZ3s3VoMpmZEYLTPS3ldk8/xd3YUf4HKNxz7kiBV/B7\r\nZ8PC+LmPR+ZK2lhoomog9iDbabC5LNDmxjlBRfLaI+r4SX2JgJ3Cp1iTzU7e\r\nmeftjdRUpWpOmnmf0xb7Hfe5sDlOTLTqk/kVW1ss1opaCBPTNuag1uDS2mFn\r\nFMsN2QXm6VKsUe/fH53s8/+y3bXCy4b6iDKYO1KFVx6YBTk7QzZs+NLCOQn+\r\nk2s4Ga2SWxFZ8YwUwua7QCnHZKDPLsrIE8xWIlsVzN8cG2iucwoaZNsjNLnT\r\nLg+nneZ52aks/A96CogKhVasN0PO0ZtplxoyBryssmqYcxx53HM9TlCTuI5b\r\nfWb/9WvhrW7mmTuta5Q7Txtq0MlGYDAw8q2kKUDNJRBJktUhX9zF3TMEpOV0\r\nnVq3SWv/6KAG7l3g9nY7WH+hRrn0XX2wqDE=\r\n=RCV8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4f43ddb.0_1649650103028_0.28496791722495574"},"_hasShrinkwrap":false},"0.0.0-canary.f865478.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f865478.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.f865478.0","fusion-plugin-react-redux":"0.0.0-canary.f865478.0","fusion-plugin-universal-events":"0.0.0-canary.f865478.0","fusion-test-utils":"0.0.0-canary.f865478.0","jest":"^25.1.0","react":"^18.0.0","react-dom":"^18.0.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.f865478.0","fusion-plugin-universal-events":"0.0.0-canary.f865478.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f865478.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f865478.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-OtidDg6QnML0nZz5WjMd6y+0JAjhRqx+pCFe+vE7r+/cyQHZku2gHMFxxPERA2vdSbcaHodo2RNWGTry9APzBQ==","shasum":"038b162fead2fe7887caec215e8132f6974cdced","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f865478.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCj7vDbpM8rv4jyVsWS2eNLlibqV4/AgrXbvnBfZUtTuwIhAI7jbzCFa1Cb9WhUdqclAj98wDVS1u6S9ijTy6AM9s4/"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVRXSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpM1BAAmmtXN/egbFTCbA5TdckZc/i6mD9tGTgPA1vuAnZZSkpcr94I\r\n7qy7QV3NKrecuNAiMEG4Y8cqjtpPg/Hn8TH/YyhmjmT7eGlkWgs/wGNvmlsE\r\nmktoCT9CmlQiEaxVJetJ0SBxzbG3gmIsFaY4YgK86NLwlbGoAXKGX8e4arIx\r\n2K43E0cOa4r5MhcMO1mlr1Ph5ZZDm+Etyxwdk9EvvsPz0ZT9nrMgx3P/dNVQ\r\nEr2dScbsQqER4AXRynurkIDRKccID93KMss/8eWqJBdG887Zn4EEKq52XYtV\r\ndHoSravW4h7xD/rMGqz7xQSYAlNz4l3urZL5T+QZWmk/NUnUKEvuE9IGuh7Y\r\nD6/KIi7FXaZaOoXJYcWO/SDEYFmFHQmBJSJuE2XdiO8BIFMeuatr2RxXNTVs\r\n/xl8lkomIu1PezyA5+IWHFIt/zBge5RQlm29tqzOsO/lNVakiCoICq1avpAR\r\nS2wF6zAYQuCgeJccWEusdloSTHhFubY3TjjgW1m1dOvQTMalceaG7e9bS7so\r\nGWsrRdDhKwR1A6i5Y/OoEvfmF0WO+v/CY3RCgbKYSnWn/6VFzTKlnFSchRfG\r\ndB1PTDsEC4+1NKro//gZR51DxudwWKBzbP/unwMKDvy9MppPNIfc41s+z/zA\r\nDkdkV+c92vDj54v51qKoGTU3myb89vCzUU8=\r\n=N/Mg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f865478.0_1649743314539_0.08189917216660692"},"_hasShrinkwrap":false},"0.0.0-canary.901e6a9.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.901e6a9.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.901e6a9.0","fusion-plugin-react-redux":"0.0.0-canary.901e6a9.0","fusion-plugin-universal-events":"0.0.0-canary.901e6a9.0","fusion-test-utils":"0.0.0-canary.901e6a9.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.901e6a9.0","fusion-plugin-universal-events":"0.0.0-canary.901e6a9.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.901e6a9.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.901e6a9.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-gseCeFtQ+zlNYGRWNUlJuZiOntexPk0RzBKmNFSAR1MFKiam9HF/T0RuQzIUUG4skvTv2tnU0YrG43Rf8CPMJQ==","shasum":"90ef3c175f143eb307984c08f9d784f0c1d8e144","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.901e6a9.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCj9hbw2q8ItUuhlVtHM2Ccx7mazSl63+yaLi95HivQSQIhAP8p5kSASR3/OeKgu7grfB54IFsFWTMbHw00kkC7D6Gk"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVRxEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2kw//XnRkSvpB32dPGCJ7Pg6jQ8SFJhj+6xKEIp/EAOYonf3kx7O3\r\nFRiWFzDfKA9d1t6f2x+iwsEoy9pt49pqj2Pxj3CCr9Ilarn5NXqj8RdvoPpu\r\n6sN1zoPS60+oS7XhhM3AQPQokVOhtrrye8zibBzH0eVHwdLA+2kzjpqHVLMT\r\nyOY1IwFsQB2I9aQNBDJJPM5KL8dSN+hXJKMZzKctTLFnWB1mKpmLsu22MlF6\r\n+IGmkaSGUwJ7G4Zmz6RQXwP/sF03i3Ov4driXdEEKzM2wLrOV8LU2UVpp/C3\r\nPaUK+ojycL9KPZuxrStZCGAcqphJ+k4syPHT7AvPkHsoyP9hhabGMBjm22e4\r\nDPKH83GG53vtn495D5v3CZD8pT2yCZRcvp4bu8iIXkNjWfAG20B7kcHYeY5A\r\nHEu/RdBX7m3j9vCzBd5qUkwEBjjL2DIBFp5zp4pJC/+W9w9yMph2mEyNvdw1\r\nlrHiL3wcrubLfpifcIcbpQxzH1AP5m+Bx1+0/rXDOgj096Xj4ouEZwktexvr\r\n+7n5DYZty/nNPajbI4XZcW1kQoCBanqSxbJ9VQSMvtK7KT/UZEx9CRCyb7BD\r\nTLhhISnKTNyAjjKZQYzxLsv/IagzjmXz7ZSI4oIcLRn69SmY3w4J7XejiAWt\r\noN7vXHH5YuIZ+prBVI42vO4PJn5xmaoV7k0=\r\n=1/KD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.901e6a9.0_1649744964365_0.26367744412508"},"_hasShrinkwrap":false},"0.0.0-canary.5f75a67.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5f75a67.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.5f75a67.0","fusion-plugin-react-redux":"0.0.0-canary.5f75a67.0","fusion-plugin-universal-events":"0.0.0-canary.5f75a67.0","fusion-test-utils":"0.0.0-canary.5f75a67.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.5f75a67.0","fusion-plugin-universal-events":"0.0.0-canary.5f75a67.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5f75a67.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5f75a67.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-6TwR/RijoDSVBd6q/fNosL4IivGI+LH+HwsKhU6nB5a/jhXBPONMTGkLAnx8PeEtlhu/SzM24CdCPuS63FJ5Ow==","shasum":"6cef63aa49f17224626775d38cb3a0e1389cfd51","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5f75a67.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBrP38ZcR0vko2QrYGn5vE/a8tliz6Q4AYA9O0dbUE5iAiB1PDf1o5JQFihCywZy4cUjRc7kvKyK8SeCOHEpzvtHFg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVSBKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobYw/+KhIU0KP8IxQi0Rd45FzCnyyXWaFgpUmhks7wxWfmhpZrfWLl\r\nrYV49bikt1fVaP3VQqLvwS54YdHmE30zoTODmVTMWc5SLb/UbLKozk/R7EeE\r\n3l7k1uuw6TR6KJYECmGerxbSnW0X6Ok5ar0w47pg7pFtuplDSSZDhR9GhJsY\r\nIsScKHdWXS0kI19GD6ibFDUtGYIYOypKaJAZp/PgfUzqMdT3PMxZk/bK93om\r\nh10tfSF9IK+zQupikYdscxnwC1pSizuPKIuwnOW7BU7ioDjr7TyrJvlo41EP\r\nResMjidf81LhsL+/sJ8Hq2A0Umu6YFRNyLRdZhI9/WS/J9oZTT4kYl3rZCGp\r\nzmPYTHnmcMuukirHwn/P5K/foRjCNjFNif4EaaYRPiXSLWD5E/N65MPj0QGj\r\n8IX+KGmKrSQu4wLqMHSi2b94i34ICW3JSQ5pKIPgSVmaGeqgA4Ss6ETFXq+z\r\na293MriWVmZPiJyr5jOilGpPuaaGIsBIu6MBDlSzy5s/ZgTYNoMRuOzaraly\r\nMkqBfh5ZKyfajJHDN8o+ToQKIhOg/G/XU8wFiAxtUWn/Z0eRXDLF+P7fYeIJ\r\nyf5esf5hPP3iwWDZm0URtX8njpPMK/KxtX14WVpfHSCRwV56NW2G8NQoe8aC\r\nw9puz4KmkfOsdw0IwM1/X+O3ns36ElQi8FU=\r\n=DvWQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5f75a67.0_1649745994630_0.14574112131997685"},"_hasShrinkwrap":false},"0.0.0-canary.66acb26.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.66acb26.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.66acb26.0","fusion-plugin-react-redux":"0.0.0-canary.66acb26.0","fusion-plugin-universal-events":"0.0.0-canary.66acb26.0","fusion-test-utils":"0.0.0-canary.66acb26.0","jest":"^25.1.0","react":"^18.0.0","react-dom":"^18.0.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.66acb26.0","fusion-plugin-universal-events":"0.0.0-canary.66acb26.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.66acb26.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.66acb26.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-kbf4hjvmdApeDy4nVOGOTK1XbhiOGFvEJsqLCZoV44yyV4I8ojopkPjdWzONEoyNoN9eqfccAz1paHbQ2YAOew==","shasum":"395329f9ab861eda87a86d8efecac81ef647f516","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.66acb26.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGkShMrmwQ8p2+WJvamGZxFxEtfspnXltM22Li7o1LNRAiA1z4OkhtdeLROK/kCO8Ac8EEQXlXDCgp/pt6eja9uCfw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXP45ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmotoQ/9HSOOwkKdNHOZbdMKjKT/9xDtD7M089+hZCRFMZV4ka5/IueR\r\n5JSStORaJD0CxHHN97RV8VAuIfm0PjIy5VZZIanBpDbXLUpCswb40tmNEgrr\r\ndTMY8HQ9emwKlmOF5BfPUuvuAUdgAHUUE3Jo0KYXjiThIwx8dcjPwku0sE+B\r\n6Vfzdu1iwodlL8vyzBAjNEPc8K3Bm1+k7hc2IiSvAdQQsuqwOQJwuOql7ghm\r\nm1/8HBmLkj7xagXdPsZ0kAE8ZNl8s5MEwiKng3rz6XHrAx85lmTio8hCSlGe\r\npGPDQqb//XxZqbLLADX3est96/mB4KyrIpMAK77JINi0aqqaiMKMIabp3nR2\r\nIstdUQN/UMYYuMDuLwF9eSC1La6GSXRuiglD76YYL/GIknydNNDM95hkv2SY\r\nwJBuywWpDwQ/2wDMSts04gSvPbGdpuRJwTV7VaZiHv4Wt1QjhzPB8+aOw0Ug\r\nO0Rwl3Hz4j8GUhtEgxT5TStGeF+qqsjpWbW45C61pHSAjKSi8djhKt2lb2DC\r\n5nly/FGJvt70cuEFbrdmpiu7h+ugrNqW0Tbp4VHVZO+sVnMjoNG6gJCGlFw1\r\n7VQ7X+AsDQkSc6Mh5qWUtCRhp8Zf5ahm1SMUN1hO9OE9kTxZEaW1qlUTNCoV\r\n35f7Wtn8ZOeNXbf1zHSZQpfCpmrEf1JdeLo=\r\n=Gsjz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.66acb26.0_1650261561400_0.04542077357879548"},"_hasShrinkwrap":false},"0.0.0-canary.0abc031.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0abc031.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.0abc031.0","fusion-plugin-react-redux":"0.0.0-canary.0abc031.0","fusion-plugin-universal-events":"0.0.0-canary.0abc031.0","fusion-test-utils":"0.0.0-canary.0abc031.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.0abc031.0","fusion-plugin-universal-events":"0.0.0-canary.0abc031.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0abc031.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0abc031.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-CgeePbEpWfEB91gqpypP36vO4ucWNza4e4a3U8939LQqwcsn9iR1OijEepZlofaEdOCT3JPbSxYrSSVP5K7vgg==","shasum":"f9aa32d0a6cefea157c7cc4099e916048d227bd3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0abc031.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCL9pn3OYlCPcyKVXPe8d3p9Ect+GNnMP6F/M6LdXzEhQIgIZ3KhQmjkJWCWi0MGosewoOXnqWKPZbPrDckzbW0DlY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXezgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNeg/8CE0NP0v6pRfXg4761YbsIFZc7l8d6Dp2DIoXMSfT2UBriuMv\r\nT7IpGCS/p3okTX8DLt26MyZExiBiEhyUf7mC2QPYDxhoCyxkwXEhL7cH7zN7\r\nno9NBO4Ev9SYlY7osuhCB97OiikXVQu5+nm59sRLTEfHQKpPtITXNECwltBA\r\nrOsRpfJ/yZMsGa00lJ5uVPx9C7aMX4W7HomgmNJCMALl7xZJ+Qn5EbVWY/zC\r\n+RWvqO2r/zaKsuV7zmpIXWxn7XjJE2FA7pl77D1cEKI0M8EtxFoUPX9MdL98\r\npHkFPKxIh+WPLZhOl0yJNq5UE9gRTLPwnFvMvG++Fr52fH/2FoarzuYjWshP\r\nI98Xzs065gfhk7fYF+pNpJOm4xR1kVdJkwR6x8YDS6YHky8mFYm+3NEFasuf\r\nunYyJe9xiaFI3qbOBlrwZfwbVLgFwCNf7UnuC745NDMqsJSenpAcokgh/xzu\r\nTkzpE5E8OaBr/6PWxItr22qM0mpOFMbR1EZlh27A++aOO6JAEuGpdyFEj+1T\r\nJCAcnl0Nzv8r/RMYido01ll8MCM8c86VHdfVXob9ah4NyA3QEveQc8fxN3/2\r\nVDtJtvsy1dX/OsyZTJ61h8Y+RHbdLXPy8tpBX9eV0CG7/pcwNdt+t31+hP3b\r\n+9s3ZfP1QO8q7Hrnvn7zAX9qn7HoduGKUsA=\r\n=ZmZO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0abc031.0_1650322656029_0.2281571716941555"},"_hasShrinkwrap":false},"0.0.0-canary.4fa95ac.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.4fa95ac.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.4fa95ac.0","fusion-plugin-react-redux":"0.0.0-canary.4fa95ac.0","fusion-plugin-universal-events":"0.0.0-canary.4fa95ac.0","fusion-test-utils":"0.0.0-canary.4fa95ac.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.4fa95ac.0","fusion-plugin-universal-events":"0.0.0-canary.4fa95ac.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4fa95ac.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.4fa95ac.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-PCfgDGeRByqXZ4zYjPfejAkXk40OcH6lb2Nh/wYKosbJgvpKsdZ8YyuIiZnivTW9Ounw0/izFI9ZupTgZImpUw==","shasum":"59e0dc186a19f0a9991f11ad16148f2d62be4107","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.4fa95ac.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC069keYPwjZZ8CR2nHMshzaWrUnw3S05kTSB0u0W8D1gIgTwPFcXKiF8H2mlheCaTx6UlQ06TAF+Oi+r+9yFmqoyA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXzDPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoiJBAAiflOyZGarMt7EggY8CelKWeOQA/PwYWLiVrsSvIDuipBgkC8\r\n4HBfrkF5FuZEACLseETnaEFpNqmY4oOcVxeU1RcLkOuWMAKaX5G0uYWqm7iP\r\nne6lpJnD86e8coI4/3H9UV3+oM+z83FcrmbyQGedFh0fMM12BoEm3e7/obMk\r\nQ7eBzYea9rnUyfdyJbKnnO9ZU80xe08ZN9ITiv0MihbGbnpXUWrEiPIgYkAo\r\n36Us9fCu/4zrkn6VbdRAeepyi0QJdxDgPC6ds+f77oXrGycdxb5hdd2P+rLt\r\nGmYbuMslWEi37HQ309nNrkW5OWAQemwmOsTNDYZltrw5YEJv4YjoWua7sDhF\r\nZjVHU+E49O0v/qoQdupDHJjjo5xxNDfYBTrFEP4R0x7Mpd6vkMMuaUDAkadF\r\n5GiRX+7Ubdrmmq+Ga4SZoiG2+2IGEWNtVyBDpSfe9cuB6d+uw4ZZwi88B+Vf\r\nD5ebdqiat8Lm1m53tEjK8Err6YZ0Glyi5Zvj4SuKI60tXTF3y7FO7x1Xwqgh\r\n9vqDbbTBAfvq22VPkalAxOa8UE3dyVqpbTLdZrkLMlfEWBjdYadQr4SfB9TQ\r\ndShfJQg3sCzQk6puiaAtnEA8Ximu284ihrO/UaLfMBug14CHCH6iHVDskk1q\r\nMgP7lGoXIado7Cna986n2xRdNVYb2GfgvH0=\r\n=/IUe\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.4fa95ac.0_1650405582640_0.474898626740758"},"_hasShrinkwrap":false},"0.0.0-canary.483ee52.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.483ee52.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.483ee52.0","fusion-plugin-react-redux":"0.0.0-canary.483ee52.0","fusion-plugin-universal-events":"0.0.0-canary.483ee52.0","fusion-test-utils":"0.0.0-canary.483ee52.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.483ee52.0","fusion-plugin-universal-events":"0.0.0-canary.483ee52.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.483ee52.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.483ee52.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-C2fxaHi/bCmFdYyCZpapzoNxx/B5AO1Buv/gUpj7kfUCpzhXMb+KxCyPPB7oFpoG5kYbjnQ9L3XktnvwbiPWtw==","shasum":"f7a8fc81eb1e98fc91fee69fa84a9aed26ca3a91","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.483ee52.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXJURazJXtmnDnH4SONGOcAtFWs3vZin3ZcblDSMUGhwIhAJd60W3YCkL8eSb0+ZVwq963i/qSbHM5UN0t0om/wHud"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYGoIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr5zBAAmTmpZRWKgzKnNhrvIUKMPBoXm3Sj12cLQcz2CKqTD7H8MWLZ\r\noefufCl8kC/KGJoECLBRmpUOgZSbXOkp7OaG8FrqRVb6eakS7cpYI83Xq+B7\r\n1uVEbTKVBmgUAM/e4EW/Jy8GYNQ6MZrr0KP7PFIsma4EeDtT3zHf6a76U5ai\r\n1yU4Fh5bgVT3nF7E+TFjYPaz0RwmOwhtsOI8BduEv0yNMoa6F33QnL/dOfaa\r\nVRh4/Sbf9arCbYQ//4ERjpQViloGnfEmgRQjD76MFXMVHRIuNXto23qfPvSu\r\ncDtJOqSZf6xhi0k+X/5nx6tkKXJQqxupGs6uInMPpmVUugEtJyRomq1nfqa1\r\no0P0EUD1gcLBOBpNg+3Wt1HL+aRGhqEZ+6mWf2/z6uUlxSlsPZv5JIb8rvbk\r\n+gB9k9zuYlzINtB7O4TXkN3LBuilqJkV5esOFqEhbJWV/5rbdiT588qo5AgX\r\nI3i62dfAbkBSiBCivwnduFyP6DK8CBYv5wJQojw95yt3qJCmrO3DYlUdPcT4\r\n8LDF4QDehtNznq0YrqCKxCJhOx9I5HSUwWAkJP7BnCNaQYzhHZ5S2jHbyOnP\r\ncj6h5GfCzAZcuTLcaJfaX8xIbOCZ/aNLxwlbgOiO/HvksA+S3ggUnlS1WROD\r\neNweIgOzBAlXW5Hl8daloPCfbNz0AXwU08s=\r\n=yLSJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.483ee52.0_1650485768076_0.850846113209059"},"_hasShrinkwrap":false},"0.0.0-canary.c2e995a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c2e995a.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.c2e995a.0","fusion-plugin-react-redux":"0.0.0-canary.c2e995a.0","fusion-plugin-universal-events":"0.0.0-canary.c2e995a.0","fusion-test-utils":"0.0.0-canary.c2e995a.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.c2e995a.0","fusion-plugin-universal-events":"0.0.0-canary.c2e995a.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c2e995a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c2e995a.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-F4i1YEYiGiKTgDM15stsLArDGs620amFzIxJNv9h9euOOU0qcr1cCZCLjPva5jm+8GRT6RHlFSxtsnAs6g8ZSw==","shasum":"9d11419b0daad394069c0537c7cd63c16a4f3590","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c2e995a.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICcJ8SNBKIfTQzIBVkkU58510Go/F3t6gotco1G4Of+cAiArb9cYCW2yUl9dppuVoIehVBmkOOyeUQPe1Wjj/wTUFw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYKQWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoH6Q/+Nzyx17MNEx38H239YQSPLapuErjIuFFthZZ7p5CDRx5zR4DK\r\nmhksFRwY23BHiLVQtKjfFbLdNOtEwpUWyK+AhMKtdkZXuiJwqngzQ6HUdN9h\r\nYP6XQ6i9CjSmWCBmxjdSfcUu/KRrNuDoZAN8YatTMjqUjBbjTw6EUsmkQEgW\r\nW1htt+mtRbq+xW5HBFRq2tR3PoiKVlMSrFSN03GvUKC91cT/veCLb5MjivHU\r\nLF72zGp6V/Ff74pH8Qr+x0ON82rIaWuK5iRedKxujMKWoxBUN9jST/cWmhVS\r\nCo8GtocVB9PmugNp4KFhMUdDy2oZ47TSy0wxqqnNgOIVKaGBPikewoReiJDZ\r\nK98ixegCm5bLIZvJJD70QToHTnJ8N/HAmU3f7nVg7ssHYhRafqFV1iO9/cqX\r\n9u18S4W/VhsqjLBu7pxWsPeRYQCGEK1Il+v9WySOdq9EKCZds3SjDSDMvp3T\r\naVGVzcDQ53mmYYRk72KbYC7OAYGvzddK4P3r1dcw5du4+YGtm+pQLVD+NrCU\r\nsYbpLTXdhlsNoNfbx9+zg4ybe2Oi9sVdAZ4bVX8DrVE+k5nUzVgAYNo3xadm\r\nIrJ9Z8nosJs3f54aQ5V6wslstfRv6q+poXPfdpmB20Lo9y8MoIN0AShZ+RUF\r\nDCgjX+Ypwl+2rn6b4xmBmtSqU5x3Zsyqqg4=\r\n=BPeY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c2e995a.0_1650500630797_0.6611398106332662"},"_hasShrinkwrap":false},"0.0.0-canary.03b7f8c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.03b7f8c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.03b7f8c.0","fusion-plugin-react-redux":"0.0.0-canary.03b7f8c.0","fusion-plugin-universal-events":"0.0.0-canary.03b7f8c.0","fusion-test-utils":"0.0.0-canary.03b7f8c.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.03b7f8c.0","fusion-plugin-universal-events":"0.0.0-canary.03b7f8c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.03b7f8c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.03b7f8c.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-LDau155YYM5R1W0PzvBhLLZmHPVvKc93zks86h1Pcuc3jJKjyCThzv3Di2YfBI5nhbUbDIqJrmMHtIger5dZzQ==","shasum":"b3f7cfb2b5bdd9eef5b5fa1fb496dd87616f67da","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.03b7f8c.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFzwmYk/FBAXYUqmH8DOmT9KIWNgxeT198ScukA14LGgIhANjRTvApnxhRWF1adTsrly/G1vZsDZm/G7eOzRs7d6V9"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYZtDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmprpQ//R9SU2mNuQ2kyYGPUoDWu/RbLM1q3SMYOXUVO5d+JrJpHBk+j\r\nVKpc9P2bpmK1atU8J7eNat2/zSvWstZTx55GtP5Xnmynl+aRdLoozKSWMS1T\r\n0vZFUGZAc7lo1HpWFg8HmSqR4iJnR1ntISZFR1UtWwiZIUivrNEB/P/rocKe\r\nvAceC3+DyeaFMhWWtJ05D7KN9jpxQXAubSFAxB8WMhfjUUBskUtTD/TUq/4n\r\nqxT5gfKY7ajrKuqXlY7zQ91jy1nlVaBvVdDN3hcR4LN4Ap4YI2Cc+obi/Wvh\r\nt6yc7H+kpvN5pAgiIKVte0Fc/A15T4Z3TxQ4mCG+w7MjagAeHbDgKcs+RJmm\r\n/7xBg4EMGdFhHZxb1sNJoHr59P64BhKNSEzwQ5bP7lB1JYWR3lcg30pGH7oz\r\ndDloFAgZ3t1OmTSznE5Wvq7EjwLdRyd5MOJX8S31PA5mC/1n7ibzgnoPPyYp\r\nEZairlhD0YbwiMiOuGZlDgdeQs8sFU5sMAtxTjJHdeaUs03mpeo9U2cSX6El\r\nKvS9JQcQoW0apR9kBPEHvjNiMVMB0Din3d8xu9Vii/JFCjOjIhzJfXfC+A27\r\nf4NLVv+8DPmJecaqJQN0wyEsbQSbDXLQsacD8cd2JnjC7gDNTv70d3zOtAQ/\r\n5jjhVhMcW6dH5qK8iscfinCciV/lt2IAEu8=\r\n=+1zq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.03b7f8c.0_1650563907169_0.9918052861849407"},"_hasShrinkwrap":false},"3.2.7":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.7","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"2.6.0","fusion-plugin-react-redux":"2.4.1","fusion-plugin-universal-events":"2.3.6","fusion-test-utils":"2.3.6","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.6.0","fusion-plugin-universal-events":"2.3.6"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.7.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.7","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-8NUHTTn0A4LpmjrqKVYqxvlKY9x4oU7/hH/x7pLegKEVuqSCRzp71Fd60Eowk5rbup7oyM8uSJbbGqqh8tE9fw==","shasum":"57a4aceff55670b61abe9b1e8ceec4f83f466142","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.7.tgz","fileCount":12,"unpackedSize":40847,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnVUI8YXo/f95fe47tWTrgRd//wB0rcDZsyRrQ9mDCQQIgCLVShoCAxHlLWjUBevxgr7hT9qAHl/IJ+1MVG4UnZVE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZxp3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrc2Q/+Lj8AidAymR32nszbhCrp/Bdk87IA1goEdh/toe1xJVBwETZo\r\nVV08DoRobMrXW+uu1zAXwQ+jsnfzG8UihYtFOg337mrFw0yqAUNprSgOYWdX\r\nqTIpBO1rqEjj+pZXp+LsoAYHGgc4RdbXEBzk3jHxDSOuK39jb1AF0H2cVN8l\r\nndHU/w9JUxXt/stDOOHwalxEmm3LYN+Rj1orR2C9buPIbwtc7+veMqNlkGH+\r\n/1E8QaRHJXC6ztNdU2hf4NqFiAEizKhdvoXUgIG2K+//ahrsseoK69O2Cp/1\r\ntKHSS2Ew6LjIWp3H+uVUQrIGKOD+kh04MJnLxwhaktcC3Ix5hRGS68CNay7T\r\nt4wC5NrcbtJIqSwgRWf62as/cKt6P7LXMdGDClq2xmaqN+ikQqGxvPZBfGh3\r\nPN/YyeZqDh7cDvsV/qaoD+9d3HaSAFa2iWWXaJt3Kp/BA/8yoODY0Na+YR8I\r\nz5CFNHe1ZMW6VmeHz47wuygF4wxalX+fntJ7Ml5dMRMlN4wA0wa2sZ0vfwo7\r\nO5xydXp2Wq5mS6+qRFxZCtREg4GKtxNta0Tbq1otM04PqY4q6T05TX2HcHQO\r\nv8Xqf9viBKpsEicqvo2Kk4uOuRYlZQYjpi4c91pFFA5KVgJFPmM7rgPaj0ow\r\nIZn5BRmc3wUHVyOOzhmkaQ1iDe+us/HOJ50=\r\n=OStW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.7_1650924151035_0.6886558071011504"},"_hasShrinkwrap":false},"0.0.0-canary.d9125fa.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d9125fa.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.d9125fa.0","fusion-plugin-react-redux":"0.0.0-canary.d9125fa.0","fusion-plugin-universal-events":"0.0.0-canary.d9125fa.0","fusion-test-utils":"0.0.0-canary.d9125fa.0","jest":"^25.1.0","react":"^18.0.0","react-dom":"^18.0.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.d9125fa.0","fusion-plugin-universal-events":"0.0.0-canary.d9125fa.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d9125fa.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d9125fa.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-TNfDSF6X71RMdlQXgfj96Kbi39SXWy2DjIFkCazhmLlbK0/01Oyu1bk40s2XxfD38H7rcgQ5dhLu2D2o1YBiAg==","shasum":"f3bb93cd1d8c202b808dc6a6404554b5d6a1d35c","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d9125fa.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDIEwJi97rvL+0laO6KXcusp6i9+gxfd6Dg19SdJBRNyAiEAm3GgX38lOMfLIMbsMJmw4ZMbhXsK8w7BUxVewvNsQWA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZzxYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqq7BAAgV5td2N4PaSRxNv47m3Zi7NCWgeabVsBKHEppxdu1bHd1/lM\r\n4aw4fyzSHOHpy+yDavBRTES4LM54SSENUEVyHPsljz+YVGQ/q0HYHtEb0Hj4\r\n9P3ClyNdEviEYsWC4TmdSXmaS2yCFlAxIqfOevoIXxuvOQkACI/eaeryj5s2\r\nB8nClZ1vJpfr6H1xov7RcUhLhgrw9TG3+TQBlkK7ouNqLE0J/sWhLbwJY9XO\r\nhL7RK2ER2ij68glo3ax0u2Z3LHOeZEC1+E3SuNq38gjHREttMIpWoZdMpfHl\r\n9NFk6IvW77RbYjpJCI7iWEmOLZBOhR2dv3nC1PQTty5jFYincbHgHFhvec19\r\nhHyjuKUWxSamAsnk346+NmoRZPBEPwjMhUQ5r5W2JRJcBZbGcMRsr0V6cRo3\r\naEmTO1cH7q/TGkRxzr0MwwpdP+vqnRdlA0milcSCUEhCoF3OiVuaC1KCers2\r\n45CXAVMiVOdWEjcuOYz40z6VPLjSwZ/85G4JqBxp3kv0kGMH5MY5H8wEKnoh\r\nEZrTn4uJe3vnVAUOoQ0T9c5wIgmHx34XmVTxr39GJEXaoCHdzESgDjTtl+Eb\r\nthu74QQj9zZotU0k2TGg/Cp5OMJoz5ydPN4DSiubR4UF8fLRPisy/IxQxiC6\r\nuvAq8JW3STa0D5nxmZn2rKXhC8mrEQ5rXyw=\r\n=XfGE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d9125fa.0_1650932824010_0.8673703388470579"},"_hasShrinkwrap":false},"0.0.0-canary.9081ecc.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9081ecc.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.9081ecc.0","fusion-plugin-react-redux":"0.0.0-canary.9081ecc.0","fusion-plugin-universal-events":"0.0.0-canary.9081ecc.0","fusion-test-utils":"0.0.0-canary.9081ecc.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.9081ecc.0","fusion-plugin-universal-events":"0.0.0-canary.9081ecc.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9081ecc.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9081ecc.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-JqMsGl2pU51d/WlWtfmQPa3gQvgK5unhnXZdBtyr+wdIy1Wmh7AgT7GInv/aevBWVflQS1Q+j/klSpyYzUiiJw==","shasum":"73d896d1b5ce1bae05099a573c24e4a5a8fc4389","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9081ecc.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJlkwk5TK6VNSZoKF1ryRWxJRJYN0pmaoxgVBjdVGGcAiEA9oHbwGxFu8yAirRO7DHP1Vvw+PTVtp+oPtQrnFKtsk4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJibgLxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqebRAAoJi+oykMg/ZaXAhyzE+yysNIqSuYmEcNkomsC+CdKcSUsaP7\r\nCp/05Eeg0SOzGB2aHdhZc5OFRAK4HIJDpCq+3okbJ3jm6/36d7rID7B9Y6Tv\r\n3sHZY6uE3e/zVurJZFKXw8oUJvJeHH1wzJhXYJRsbZQ5/wP+NSt7mbx/msXk\r\nN1ljjnZtKkctcGAsy9dAI7Xlym19AQwA9ftXCLaUIvGldrf80K21k+gQhBa9\r\n9uytS6tq1klhMXwLLFaQs9A6FJIM/isNJs42yA1KkiinEsMET6b1ipaYrFn7\r\n/jlOvafD2OmKwuS7czOPVXN5nx4bqRyVbMn2M49U+NHinF8GBgXJO2Ly7XKJ\r\nigNJwluHlazkImZJZKZ/5gRzyQX3mb91boO94Mk+UlHVC13clS96Lh41sGpi\r\nVgHtbdhe1kM0L51N5xzv2EPx/zdqXKvzXSoYiMvDOCaaQ0i/042ft/zxcNIw\r\n45ikYHNe2Hd6b565cr/24W3zuBlyQ8lmPit80MeEkSVQrT40Tjw9DpNe7e++\r\nP/jfOLFV/ZnfII0HjekRqp9L9AuLYKs/xadALmRWbKKKgw8Uwi8ugJgZU9kM\r\n13ol1KpqhN40xpl/qcNskqAdkpw4F6O2B9Ao1RgXBPyDJLArdIZUpmK41kai\r\n18YA91FMARpdIBitpe2nAPqe9zcKCT5d3PI=\r\n=xKz3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9081ecc.0_1651376881687_0.0722973832211955"},"_hasShrinkwrap":false},"0.0.0-canary.82afe51.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.82afe51.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.82afe51.0","fusion-plugin-react-redux":"0.0.0-canary.82afe51.0","fusion-plugin-universal-events":"0.0.0-canary.82afe51.0","fusion-test-utils":"0.0.0-canary.82afe51.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.82afe51.0","fusion-plugin-universal-events":"0.0.0-canary.82afe51.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.82afe51.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.82afe51.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-orzaAVRSRS4WmBTkbnWmdiCzu1hCPQH6q2piTNbpOZ1ayQuN3YxLUi3J3kRJa8HIJ5oxA3wqfLlGx4ZQXDkHmw==","shasum":"464c6a462452589a0d93148426990074b9cd008d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.82afe51.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpPPfHkx82SIoRKxdKzGYGddzoHUpvbRD1fgPY6gnLFQIhAJB3+WaV4CCSnZNFOtlHJao0cb2aGh58HWj4j5P1ki6v"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicdLMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpjZA//UX16IScoP5uJajS0vDM5M2T5PD3jBc2MxEAEDd5W5H6R+MJD\r\nbOocl0QIhJWWMjY/y5UKQEZHzHykU4YmbDyy5Tbdi8WS1CoAtx7MDApFdhxQ\r\nRjico0PAr0WqXx6h0g91KZKL9RASZSGsc1BMCicwUNdpghZDe1+sefVm6FVA\r\nhObv3TetG74TsTwucgJey5knsx04reuKu1Gnyl2KFjkK9Qgij1JFDiM2fDpa\r\ncvVMNDBM+Mflz2Yc0kIbUUeujJQDfTIjJRjlmW2Z5AZOUoFcxyVSniRRq32O\r\nSS+wkzOeyNXynqibswvF6IxJuWEeQuXDFJTJ9dlXaB7HxSzwsMxZ3Lxn5a7N\r\nE1qmhA/iVY+8NP7Gy+sE61cVUQ4dxVmowuYtZNKdj7rVBTGlyCFkLuUExrY6\r\npOm7raGROqmqSl9gr8gbLtcn5rF3GX3TYkHqC+coxm8JxqLqQxJBS6S2b0fB\r\nQUFMor0cKoRCDiMRNc9Tg3iETQTUTaxiYeEX4HQWWSPT1KQCvzwWwYfNj3lY\r\nsFYKXZN1yiQLSHpg/pEMbPINug+OX2vTzLiyPypHalZMUVyISdkj/KePFrXI\r\nETdfbGF7D3vn81TWBCmQqiVARqdg8ADrax8QQVE46R6tU0XtMtLrbeUz84Tc\r\nJNFp/vOvv7x87mxGw/QTvCBaEuyu3Fn8SAk=\r\n=gcDD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.82afe51.0_1651626699573_0.06999369974796665"},"_hasShrinkwrap":false},"0.0.0-canary.3afacb1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.3afacb1.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.3afacb1.0","fusion-plugin-react-redux":"0.0.0-canary.3afacb1.0","fusion-plugin-universal-events":"0.0.0-canary.3afacb1.0","fusion-test-utils":"0.0.0-canary.3afacb1.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.3afacb1.0","fusion-plugin-universal-events":"0.0.0-canary.3afacb1.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3afacb1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.3afacb1.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Kb7aRj+1GZKYmthVz8HZJUqTYh/b6KpzZg0VYlK/TQiyBkWm0pGCPp3E6sr9DxutPCSJ/6NiN/NVuDO5UgK1sg==","shasum":"2f17609ce563661bc8b0230bf3a5d887ad8fd4c7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.3afacb1.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMzn+GTHA0xkYdfVJ7VzbyT0h0CsMlXm+ASfbOB2OehwIgIFqr3lq78xcJ5Jc/g4F//al9nmvyqAn0cNiUCMEBfL4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJici1+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRew//UWXs2P3t5205jN2rYzVgvCtpxu14ZVLe+F20xzlP2vv/exrT\r\nsLJalcmSk9kZxaEnTTSaSZB6v9sJObQUkqPzC+OrYDgZE3wB1CbXmKReYJ0M\r\nbS8jn76Gi5qLqjeQIPDo9heUlwhHBvdAwGs6x7kjSbq7ccG2JNIypjqbNXur\r\ngLaBcMmIy+NAofetuZxyPt49HeaPOWT+gg7XjkOREn1k6jatoB+uEfk76qPL\r\nZX+/5ZdrCjQarwfsM0hHB8gLq8WgFF/Px7lQce10mOhxId3ZCkZGHAStqk42\r\n3X37tjiolSRXb4DYIvwcniZFbUUNWFq1uLlaBTdYyG7kif9Op8nVZORC3h6y\r\ngs1dyAxzP4NZKmXK8fA/YjbKgXJ73Hn4zxKf7AhqnI1Y9KbQdbizg1Gx4Mb5\r\n+8utVr/A5TR/igiDb5WXiUWqJZRijk25ai56TqAhVcsiuQdyUZ5wbvlLaIb4\r\nUhRJkfE3gJaZKTLm7gOQzFPg0S/kEI4vCUWtWaNQiDWi0Cdw+15j+Vrzt4w4\r\nIChuuLUKaivpHYjDW0K8XhyOUii7j+5FpW2p2Ufch+waE3/PuFA8MEfUG/QB\r\niZa1SMMG+geSNJMUgJXWb6wAMv5LFQu3AxkgRCXFHl1ZWIgLw1/G4C1wWm9R\r\npE+juA6lxZ6vtG0bd9b01LG/V5m7Sb2MLiI=\r\n=e54h\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.3afacb1.0_1651649917846_0.7719502408846999"},"_hasShrinkwrap":false},"0.0.0-canary.dc38594.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.dc38594.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.dc38594.0","fusion-plugin-react-redux":"0.0.0-canary.dc38594.0","fusion-plugin-universal-events":"0.0.0-canary.dc38594.0","fusion-test-utils":"0.0.0-canary.dc38594.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.dc38594.0","fusion-plugin-universal-events":"0.0.0-canary.dc38594.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.dc38594.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.dc38594.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-zTDFl9WDCC/gDvNkPctwq8xB1UDqISP8GG7wvQOwODf/oW0HE6DNe2byZLtz639USUKGQpjqoZHGpPNSmCagNg==","shasum":"d2e8f05e071f7c68fcf1025b8492c04d2cf2ae93","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.dc38594.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC8ZTszgrQw8Yb93nrwu3ShNlfOpPFg2Xen8OwgB4IGSAiAzLyf0MEnXMlhDzZqnp/oRU7bhIJdMusFLVBDi9Ssw/A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidHrmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKGg//YaRgBCuhPr0ThlFXBfGNWaw4WEoh6VZ4hk8pSmtNzKASYA2h\r\nFLFtDmP7Ri5drRWefOwid58I4bVR3gqXiQYUVUbsUR1hJbjFz+heraeVNj9t\r\nYMT5JfRN4zGIMbcYAmi1RoTOLi8mKXR3qlASZsBxRZjFkOtMCYl8ZHO2Ak+0\r\nbdHGMlpUkt1QlcA/fneGGFBgwTjD4WcPS+4TH8mZ4j3KcJN6zFlZ16isuJUu\r\nSCQszcnnwh7vVcupelYWJAVI/sK3hQWF0aqS6p/T85SSk+rs8GmuiQKHRwrO\r\nx4A/q2kXfuASCIsjF+8NllQViNqM5ODNmXxoA5gOhiXXMqFlZxOCvH682izl\r\nfQOPHJ7IQXvUo52dxrrxbUI9hEQcBFPjpBGeX8nOln5tfElEh+QOIr+VPRmm\r\nzb3h40mw+pNuDuzeZnIrl81yFedzyuiUkAfUWHOt3kkechNP+mWqBig41JIM\r\nX1tA5WLXnz3tleTpFmf2W0Q66r0cDqn/EVZZ5Mo/znfD6R18hSAZChC/2+Kx\r\n+fnCwvcx4ztFVBdQnjvHdo2ZnzS7YinlGCM7Ns0Dfg2HOCA/b7c4axnbOaff\r\n0uHzkXeBbZPyGYLZUpvyLsmMRo2V/+qPZRum6DtJfrIm5JIdKyTvwS0n10TW\r\nbR3ZCT+xy+9c/nkJJBnHoDRL/ZTGR1wZxeg=\r\n=yu07\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.dc38594.0_1651800805925_0.19731481891769032"},"_hasShrinkwrap":false},"0.0.0-canary.9bf73bd.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.9bf73bd.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.9bf73bd.0","fusion-plugin-react-redux":"0.0.0-canary.9bf73bd.0","fusion-plugin-universal-events":"0.0.0-canary.9bf73bd.0","fusion-test-utils":"0.0.0-canary.9bf73bd.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.9bf73bd.0","fusion-plugin-universal-events":"0.0.0-canary.9bf73bd.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9bf73bd.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.9bf73bd.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-tzi7XuQeuwn0qr56mTvXY+obo2HvqgXvurSXxnJ3hEg1xVQzguhp7T0SLYSXns4i5Qe5tCjqSd5pMzIVYaCkXA==","shasum":"39eb35880c16fbaccae26fb70fb599f32b5bb3fc","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.9bf73bd.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH/2JSk2ZLyGpc95M9phc4fR+dgJWsfW/9iKGEoKYIn2AiEAjJzgG8jwkPd6yExrZy6s6NlYT4NQpyQVIfL5xp/TB7w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieFvXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo6JRAAgXdBv42AkyyvQFjzl41z3ra5swoTYY5Ct6R5UD7J4fuPGGMC\r\nQ5QIrNEG3bjVCXQ2SQmPiE/2AknmtvhNijiashYJ8XsS4OboiApfGZE3G8lY\r\n6+7Rtyxei9nO9i01YyHpAHgpSkbw/eT35HqynXZdg2wP9Q9Xrgj9kb1v+0Fc\r\nNO8BBG5FF4vAKzpbOWA9/8Oag42Ti3QVi6ueFdXJjJe9HrRmE7R4QHlbR/ev\r\nnXXWUWta45cEl/23T+29MyrZrJiL2idzq39G6e/Wf4bkXutFTQgcrOpMkFs0\r\nAuvlYs033ozcjJl3nFMvp051GL3vw2le80hXr2Wm78I99qFcoPuIAm2p+Z75\r\n5wLM4GUD43+ihIyvA93kTKJYWDslttHCfTlO9eabuRTfcuIxerXybEZHYHIq\r\nDsX2JT6WQuWBSkbarLkuNP5nKE+P6yXz16WuGK4cqcO4gQ3g/ay7S+7Kj5VY\r\nRMDC9h49AVoAlSkdl4M+r7UgMTYYp2ficf1TUaUbrwfYa4JEcONwOrUllWcj\r\ngL0dKdV4GOkA2aVMgtzKLaw6iX2mxPakGwBAEowlRyqI15a0fjhOH+842wCu\r\neqfNYEethEffEIwdgl5K8qnWgMrdQwP603hcqrOE0pl9GIvEzy81iuOupNTW\r\naK9qRvwq8sRhm12nk8cQjYqpmlyHhaQ2IlU=\r\n=LaC2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.9bf73bd.0_1652054999581_0.029595196161175563"},"_hasShrinkwrap":false},"0.0.0-canary.0d8f1cb.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.0d8f1cb.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.0d8f1cb.0","fusion-plugin-react-redux":"0.0.0-canary.0d8f1cb.0","fusion-plugin-universal-events":"0.0.0-canary.0d8f1cb.0","fusion-test-utils":"0.0.0-canary.0d8f1cb.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.0d8f1cb.0","fusion-plugin-universal-events":"0.0.0-canary.0d8f1cb.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0d8f1cb.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.0d8f1cb.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-7P2vqUTDjm46u3X8NEunExaML5atkrVp70e3XwDEBtGpyhgyQJsypSOyzSolSec1byF6IuGvJMgHENy492gIEg==","shasum":"fee6026446d9d91b91b1bc04c0609748fd9058f9","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.0d8f1cb.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAvgvOvYjObhO1u+lbquo0g8Ws0BO2AiEHjh73nviDYRAiEArjCorl0DTbbOXB2ix20IpAoPwVBQpkRKa1svXOSBG+c="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiecPPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmThAApJZJMqi4am/GF6DAQPxk1c6RL7MJlL9pls0AdsW62O8K6SlW\r\nqqAkZzGJ1dxaXPq6JppjSo/dIzpafMRevAxtvBNMHZ2xNZqz7vTfp0Rs9Ynm\r\nNeThR+IrfLxSJq9tRkpOGeQPF6vH2M6nRRdG91NlYjZyLPwJkSKB9GmFCJ6F\r\n29shBqgGVcYvHpUDhiNoJw54fe9UpMwVWC0KyrjvWQiibOvgbTTuk2PakQdl\r\n/64yPz+pMhWDipsdBknRTsSJxDYb7lL3sAzNiBQ+g7y9Gv6X4ldUDYuMRKY4\r\nsHIhJTl6+5KopASorwYcppeGrNBJaxf7a4iNrOtrk/+9JWfPuEWtK1Eb18su\r\ny11L/7upXZfipfR4NbR7CrY21LBtbYtjiMDCcTCpPto0TsnieD/NTt2UIu6q\r\nhtu8ciKH7oKMQU2NC2L9HEoB1A42hOL5QmgpPXq/sEszyZ5C4GshsChgEF/Z\r\nyLx87AmngkNX3eM5C24FbqQ0EwofwiQ3kDvhO4O89M/SdEpDsMTdEDm/y/qu\r\nsu5HVDAXUz0OM2o+QRK5HjFpwaEJm4CvWDS86sjcYR7jCxhd1pSy4HRPY0yD\r\n+jHgeRd4A4UIS61Ebu6KaM+y2K97g7x4JXzH7cLPNjy9UylpbRb4mc099Lae\r\nAe/Nnh1v/24KvjnLjt8AnqB1UhoGnChifC4=\r\n=edr7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.0d8f1cb.0_1652147151233_0.3053347921780063"},"_hasShrinkwrap":false},"3.2.8":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.8","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"2.6.1","fusion-plugin-react-redux":"2.4.2","fusion-plugin-universal-events":"2.4.0","fusion-test-utils":"2.3.7","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.6.1","fusion-plugin-universal-events":"2.4.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.8.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.8","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-++ODU8kaTZSu2zPprWgstgf6PNBKWs4PyQH9li0bhk3KxXjChhYdetya/NXfT8NHKvVhRSyhWQg1SnUYB3LxWA==","shasum":"34b494129e40593ed58e0422106971241161b800","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.8.tgz","fileCount":12,"unpackedSize":40847,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGIoQLehhZy2GPVtFNEmJnc7xh7GBbnMxRO84wo0m7vAIhAJHwqgrRy1OckM3TGzTrbEnHzlE8XpeYbuE02Vi3WG/3"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJigs9LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqsmBAAnx6wq08vmUaekGwb7jj5kB8vXR8rekgRxUVenxgHhrxTUkEN\r\nJKwor5KAN6xWSXSbvBtLuo0dINA67qGlot+VkuqHW7X1G+15i2geAf3FAsP6\r\njzFIvvR18OnZ14Sj3vm444HmQPojuOGdhozndmz1ct0F5dQdvewRhzPUeG8C\r\n3pEtr94T8Bj92OVsZf97pMHJs+iZ2Q6TwqZ8jkPR/W4u9ush0MUep3/FgMQ7\r\nGqHIxloLVfUMQAuLpwvgEPI2KfqeooZ7J7OG2VbE3MUZcd8ubkVHZ+PTL2Iv\r\nj1PnxiHAs9aDKA3rx1sqbublkySdcfWU4EwvNPiHORPOWBPaDYtS/TbDRLHR\r\nYZTFjkZC36rVaoLFqcNgK/Vb/OW0jJt0MRtzCSQJlF9kS4pqjoAUGeAt55NU\r\nyBa1IKcQ1lHwX+KTL1tlB5tcOcEkgTVg9ehkPBLBLXhewYS4buMRkKbWUxeO\r\n4LQbyjHJGHQtA+BKtZ+AVigy29BF58PE/zkXpdxe51nTnfpllAlhtAVcaiDz\r\ntroRIhn9QpavZLfUlskFRR27McShk2kqGpyInkdi0bx7ve7o2zixNiebPFqJ\r\nxBc22Fq5BFeQC+iJdDaqf1IBQ+aFYUx1ujywst2iAYgIiJKZz62KO8YH8K3/\r\nPeZ7gVKOkddSE7TUdU1N6NVS6jskIqIGB0k=\r\n=IRwA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.8_1652739915251_0.049188968094650454"},"_hasShrinkwrap":false},"0.0.0-canary.441c97e.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.441c97e.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.441c97e.0","fusion-plugin-react-redux":"0.0.0-canary.441c97e.0","fusion-plugin-universal-events":"0.0.0-canary.441c97e.0","fusion-test-utils":"0.0.0-canary.441c97e.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^8.0.1","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.441c97e.0","fusion-plugin-universal-events":"0.0.0-canary.441c97e.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.441c97e.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.441c97e.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-XjgiEYEI40oRBukhZwvok0wyoXmVbdcBVQHx5qqdDsEv6RPFcYxwusFWUGAYYxC3zR9KO+TsJ/EC6V8QXIaAug==","shasum":"6f14d36e46c2cc556e08eaa518e0e3ecfa677b41","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.441c97e.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeel8FA34giqezy7lW6bFJb0wEWv478iuWSaSvZvK40gIgWOSzTtemb/l3GWRtGCCyfFGrL93CzSNcl8gnvXWJJYM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJigvT2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUrw/+KEWL+BTDVOXXsgBNgVwtBdTP5OKJLg4Bv3cqkAj8MckOgMsu\r\nt533M9XLNhjAIhxmoVx6ZwKUmsOm7Ua1gwd/zu/Ku9i2aLTwiBUjqDgXhBrJ\r\nGrgWMAzlboi6lwlJMGxLx14akphBVVU9Z8LfaOBPmvBL2uMLjge7sQo1IyYW\r\nImLNOp6rKLRdKvalLPG939S9aWqsY3kXPJgEhWdfyS9vXj4MpmJiVvHDrKkv\r\nF4bUCf0ELx09ZVx7RM4ea/m1jznf4TpdkYSWcm6EOou0+U1GPdf+AQrGM7Ba\r\na3nPQI1tLrdgsN2W2W5Ozcyez5JxQSX8I9OufmJ6/f8ERkJ58DD18VbMuC0M\r\nbCN3GvxmYDSHTWSSfiYbvTCg1qvWUVzoEGdUmgV6G/MzThDtKjcYTaCTBjpj\r\nnh3JkQK35fuLtRpU2qPwZ00rnDhAZQ0Ly1dUXn+LOFO8Yz3NvQ5vGqegV6us\r\nJ3JdnEJvMivXWkG5woWnc1flCH47OxMYftcBfkJzoOOshnZMKHOrrQFXLbFU\r\nBU4GDKdPMcMPCWRREUmxpw3N3yF6qmJy+Ljd3jt/MGS3uwByVnD8QRYF8Wtc\r\nG6ENHoP8RJwh9+1PIaod+JLaHjItVR7E1onwMZtAtRjfFQ5NUpPA8dVui8ST\r\nDbNf7V3pp0fXhhnV6P7suHeYnOoHZyNrqNQ=\r\n=/236\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.441c97e.0_1652749558021_0.9561066403933542"},"_hasShrinkwrap":false},"0.0.0-canary.94de910.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.94de910.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.94de910.0","fusion-plugin-react-redux":"0.0.0-canary.94de910.0","fusion-plugin-universal-events":"0.0.0-canary.94de910.0","fusion-test-utils":"0.0.0-canary.94de910.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^8.0.1","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.94de910.0","fusion-plugin-universal-events":"0.0.0-canary.94de910.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.94de910.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.94de910.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-0KOQvEwkJACn/X+ifhN1dks3/H8QDCkUOLsD+2KiRH6vPfTh74EGSMzC9nUJgvr/7UVmxgSaRr9RNxqzz9wwhA==","shasum":"e83ef45a022bdecbec286b502675279ab8b2ccb5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.94de910.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsWKRu0zeYAaypxse9/dVpc6XzKr5ZhLdz7AnjrumwHQIhAJvYMgadF/fMJWxcnFIOnBfl5hVf+tiLYfOCKY46fWr8"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJig1U6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpkJxAAgX+EcKcprUTUjw5LjwNH1uIREo9t4/2ayShwlvtJnEy8QLBk\r\nNFh7BV9sMpYRGMaTcXdsaGO0k2zKk1/drw9q9IytY3cD2jCkhAVXXYGem0V2\r\nuDzcDmYGIse9OcR31vyi9fF3nvzX2eiLbue9JA2hwxGibwhHAJKsKSQLaYLV\r\nNionkcS7HLoIxKIpJ5VFk+mZFdwtQ4/7jfD+KNkf73tTtP+XpQXvf8BFI9mu\r\nexCEl/3xHYQH8f1XYKWzBbni6agPATcQhVAJImPAv+JrzDB5iPk2B/p1GoBQ\r\nBTlydcVh307yDojKCDiWNlBnAT2fvXrGj093i91DzvaiAVBaG/o4/rHD7+D6\r\nfxR/n+XCF5DXxmp/kZSSzqcWECZoC91cl6+n7XV8PKoKFvaL+gG//r/1PwTF\r\nIrsOJoKYTZwSSh7DXnfo8ebWyaflQr4aLhvmvKeiDyU+kQ9k+wWcvxV0+4B0\r\nlDhf5+QohzIOVOvh1FcAm7wNnrA7oKbQdA+IQnzgDU5NAsCtqNzp7uuyqNJP\r\nmPxxuCvvNrhZIr4j0wdJQVW8L6yFflZWP+AA5ynhigaM6QcUmIAeREqmScwr\r\nsY9AKIlJU7YPweyQ9rNsuE6aHqnL+4OS7uHXugtu2lbOb6gkTDi20v05v2xI\r\nrAX+uAvF64vkP+A0G6dV/0lci4tAawOX6SM=\r\n=arvC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.94de910.0_1652774202750_0.8988045437581567"},"_hasShrinkwrap":false},"0.0.0-canary.a8535bf.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a8535bf.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.a8535bf.0","fusion-plugin-react-redux":"0.0.0-canary.a8535bf.0","fusion-plugin-universal-events":"0.0.0-canary.a8535bf.0","fusion-test-utils":"0.0.0-canary.a8535bf.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.a8535bf.0","fusion-plugin-universal-events":"0.0.0-canary.a8535bf.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a8535bf.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a8535bf.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-yVVCDPy4cDGiBQOtS3kR+v9dTB6dRuJzuh/pvTCQMAayeZip2MGgosr8eoFBcrSV1z3nD+F1IS2hN1+0nLinig==","shasum":"340cc04668eb076a1310d6ba2a42268485174e30","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a8535bf.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDm5ql8bGKmjeSJ4k1yZ+o2l/nT5lNUAU7D1vX0fsbNaAIgeiqIuiKyJwnqt8mmjBqVEZG1Qm80lVZo+BPWyxBzN98="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihBJyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoIDw/8C0mFQj1tY+hytIWtS4Fx03jyqYszsspxx0ZRauGDD9XQsgI0\r\neGpAkb9jv6PWrZEFbQ0DEbncg3sviE4Ocwd9UTJiz1+EG4ItpdRC7x2DnKNI\r\n6CGbKBrqvdDwDo8j4XbDdIDGM00BGabUi7lhov/JMsv6Agtz/kCcbUeyYE7X\r\nA3oVamjfJyIAXsi//YOzUq5gQUsEys1g4+H7ZU+JDe6DN9KfoiNpHxMN7zmC\r\nnNlWH/bTy/t6t7gjgC5C2nRWQFL6+lLuD9gAL8E8aMOAqrCd1RCa4cKyWPSW\r\nJPZrNjU5A5WtZE87pn0w+sswgVleSOJp7XREJYCf/ElX9VAZLmOJnu7pKvGI\r\nY7zlVHpATniPsdgb7sGEgl439qjJcRQA3Lt0LiU2CyyqiXUm8FGA1vFCNl84\r\ncTQ4WneanzeDEf4tCglh+qPDS9+fuzAyxWK38uriKDr7w4ngZl2Q+f2SqUk+\r\n64Zl1/nnl/2O2TQTRDYow3z5su6NlePgQxPIFM45XmGRaYWWKYZ9k1LPZJfY\r\nSCVu60mzRBN+LuiambPvgEZF8G63Xlwj5e6HIyrYGnZ1r2ZLq6oAlrkZxFg7\r\nlFEC0lg3WXLJS5cQalyTu8rxDlFE8ZthPV5bUHQJJCs8+pOrq3oXTYgIZwQ9\r\nTcZpRrL1whWruMCOUkQLZSxreec1pHgqtnM=\r\n=N+lQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a8535bf.0_1652822642180_0.7168837477286132"},"_hasShrinkwrap":false},"0.0.0-canary.7805140.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7805140.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.7805140.0","fusion-plugin-react-redux":"0.0.0-canary.7805140.0","fusion-plugin-universal-events":"0.0.0-canary.7805140.0","fusion-test-utils":"0.0.0-canary.7805140.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.7805140.0","fusion-plugin-universal-events":"0.0.0-canary.7805140.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7805140.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7805140.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-SHkX7TlOCWNlXOX41IO7xtF9ecDYmJ3K9DjbGrifzEEhxiiKx6kMq487CN5AtyFHCnPNa17H8pUOEWaiVczhMA==","shasum":"af0eb4421d378b00466542ebc6f80114ca6f5034","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7805140.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCImOrnSdsJrgmFMow03puOi0UOEKAnlpQPVJQ0uiaT1QIhAINa/lHp7Ga7SZLvO8HmOj4XvZDqUSAqSJW0CM8bLPjM"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihF5XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHkA//eyPqrW6fx3UB0IlZb7GOAudB5RBlH2/gkQ5m8rWCkXN8ufaU\r\nOp97YXPbGb1FKcr48rNS/KmzmMMt0vq9mDGFNYFdddmnBIMDK2/KonOSkWPL\r\nuX+/birymNyxAJeGH5lp3hc8RjIjpsNR8r4jR5ya+DXzuRRBOhS9e+9Sxcoy\r\nD69PJUJ8rcMUDb1JMpzMEo/kwqExQqy/NHOmsXmsA697n2BRwsSZ5WRikDu/\r\n9nv81jealdMTNFy1W9HfCSRfCKFSC+9q9OBslJgUkMh0dL3toWyrtZF7zxO/\r\nYW37su9pD3Opd+81cjgoMYX5G70ukmRmk2eLQyQ26R/Y0uIYMsr0L6CoNoi/\r\nNReHT+WqMbmHIRl+K+Z8oaaBHKXbqodK6naRwjgPzjJ5Wb9Dw0opGywkZWko\r\nK8Xxv2Dn2f/Gw9tLwiBzaScJRnFIBfTTdLx7xPNTW0skZ4w9oJZLq75fWmx5\r\nACSnYnMF/+ah8JizpwZNpqjE2dhb09bNTDQ0gugmF00KNUNPHwcaq8wmMF8S\r\nTclW5q2+G2l7Pftha8IQh6wcslWMHejw1ztpyNeNc5nTrCU08sInh7bgHNS+\r\n1dPvrmpfaQlbjCmIFxdibvUhruznCfqLBp1wSs0SptkYtM2ZfeNxmbsxRhwR\r\npPsesn9QxnUIvJXEcBINH1padUzlI3qB6AM=\r\n=O23P\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7805140.0_1652842071601_0.7166240258097651"},"_hasShrinkwrap":false},"0.0.0-canary.c454879.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c454879.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.c454879.0","fusion-plugin-react-redux":"0.0.0-canary.c454879.0","fusion-plugin-universal-events":"0.0.0-canary.c454879.0","fusion-test-utils":"0.0.0-canary.c454879.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.c454879.0","fusion-plugin-universal-events":"0.0.0-canary.c454879.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c454879.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c454879.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-fgbc7G7TFURBzNPpF+7AjAnLSpRYIsHgIRUMDXLM+Bjl7Uc61NDnX0DBW90Y9dpO7Cyaev4naiDUKTBtVLlO8A==","shasum":"7f46661c82c82b7a31fcb41281609ef69a31a553","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c454879.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjZi/IomJ6ZmEricCjQ9jwzf5KOMqbYJ8BStAint61GAIhAIuhD9p/AwqS3or4uq1EvHlVW1i0FWPFkwFmlG8OosSL"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihpweACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqvaw/7B0BpXU+ahpO1ViCfWlHPUeG79W3aHA9+l+hvjUoZ5CNvO4q/\r\nQ+7+eT6NEYO6jd/PD4MWgIdCBQgwZiug6xFmYRj2IiRpSgNQvebhu7DwieDY\r\nlU3fkbOvFE6bFY5pGTevqeMZm6Vuz8Y4wmzOF3NHDnMLKyOEJ4gSzTCzBDYS\r\nwNv5IYZ1H5li+qm+OIinKJAitgIery36bMMpaL0BKvhhV0IvViKwIg5xC+KF\r\nwf4W7qJwwHaqSVu7hcQvzL5h84Nk1AqXRE9eRwj8JrELzbEhGtuv/+3SxI5p\r\njQA+Ct1JYLoNCj4zVDxz4t1yOFdPHscibyCzHP0vQvoEjTzoPaTCtXsxSxg1\r\nInhLtL06B4AsFJtAOlMp4c8be7iCreBDxB3lbdVlB4zQiPoAFbIH7O71jB1F\r\nOmIdRBlYhEkzPqKrlaBu+TFPY2m4/GwhYfuoQ35FtfcobfY3xBf8l105juEH\r\ngFXRKgG44eszAi4qFl7boF6eTMtVff9r8hGf/LPy1XoCFLZkBVXHH4f13aSy\r\nCcVpFcbcA83rkQr0TUxx7uuCjA5X07BRVIqvZes+oz4yiOZETFrguhjCEyTQ\r\n37LwOW7SrLUg18GjK7nAZ1gxyYm5ocHYOns0ER5YTMC4YmXw0nMsRUsmeIgl\r\nIgRIo4n1hAVahpX+Sr8yc2w0PGbSsRTJik0=\r\n=vsJI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c454879.0_1652988958022_0.10691965299880857"},"_hasShrinkwrap":false},"3.2.9":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.9","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"2.6.2","fusion-plugin-react-redux":"2.4.3","fusion-plugin-universal-events":"2.4.1","fusion-test-utils":"2.3.8","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.6.2","fusion-plugin-universal-events":"2.4.1"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.9.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.9","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-sMdsEXDlq/B/hRXU3ID2aJh4gMRwHwOSCHDIhtoq4vMbZ7g+gkqba4xiMgZlYHXVBTQqwejrcg7njFDdCrfXHg==","shasum":"e44004fce63ffcd64cbcf11d9b79980b0da76b0d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.9.tgz","fileCount":12,"unpackedSize":40847,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIERum97lxa9POPrcaLCr+K5QP6O8YPTmPb6Bf/Rcy8NzAiEA0ROecg1pJ2xPLqr0G1P/EVz6OiUn2vuzUtlWuWxVSqE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihvFRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrb1g/8CrT0PW/tRz/iGqCl+8rJMdAOjM204zeD3Y6QHHZS5PTV5OoA\r\nqt8/ub0MUlQGfuE4RBHci2E9VQ7t+Bf8G+GwiaAl5OUGO1kqylRtCyR5LWiu\r\nFmAk1cFVgQM6DnfwgdeFPFew4blzSFZg+2HEDNe7+y+6b1xyHGfiiC6EbMTq\r\nFo8fsmHzoWcCwWusBvMiYMWqLCr7FmjOtrwOINVM1F6k8X6zWVG4PTWq5qMx\r\nUcGwl6aKC/45hgeLAiD+Wejot7FKtL9mX7ymDqwiEgMvmXin3LhJBxH0N+CV\r\nuMky6++/HTxr/2/Hrjz6jRHAK2HvTJAKx5Nfe4qz2EG2jOOCT6b+5nko9KHD\r\nkfZC8Jrcj3Ex6vAT/EqQGkP1lnCaPdYR3L4uIfizhCyDtMSxYjxemRzhMOQd\r\nEmXR3QNqU+nmogE9MqD065mem4ZA1WiNXC/k0IVSyeQ/bwqkuzajEqt91VqI\r\nzkoiDY2UxfZkFJMhdmr0pV9wTNHdh72f0+Dspw+9mkTD5tlVgP1+VMkOdR0K\r\nmF4fba7Lule5cFMPZPB6dMdJ/lqBbClhGA3JumZo45qI116kjvp/AKnFmIVQ\r\ndNE9U7xY2anGm8W+VDxQtIWmC+9BWjKhn7xgLOAA6ET7Vf/E3XL9pnP/dn44\r\nrPqdJWL0UdPCmlVwL8QwQyKiUsUutLMOY4c=\r\n=i5Gg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.9_1653010769288_0.4530145209051675"},"_hasShrinkwrap":false},"0.0.0-canary.234cdec.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.234cdec.1","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.234cdec.1","fusion-plugin-react-redux":"0.0.0-canary.234cdec.1","fusion-plugin-universal-events":"0.0.0-canary.234cdec.1","fusion-test-utils":"0.0.0-canary.234cdec.1","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^8.0.1","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.234cdec.1","fusion-plugin-universal-events":"0.0.0-canary.234cdec.1"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.234cdec.1.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.234cdec.1","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-ItP+OG82VFeD8xq5rjri2rqixPO4lTZ5xcvoLzGnWrZdmifA20swP1sXxYi3eiUj/X51/Fv1bDxYB6vHUQRWOw==","shasum":"ce893fd74789614f20009a0b30229c2ee0b989b1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.234cdec.1.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH0VOKKXJmOHq7SYrEGOIGjCrlo8xrNx/j04Ptzhgo8VAiB/ZndAYXsXuWTMZPBB5vOaAqJ83Qrduronp/OScdc+/g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijvuSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp63hAAjuIDuYQo/c+vV7meR3UYgkYXpTxWDFtOBU34DZz+GTpZP2qZ\r\n2dQuBB4lxkmnOaVveo1v88rfwg3SVb1NAAlTzSc+cCO8PRPoI74orR61roW4\r\nHN468s2bT+Nzh+V/xedxG/zdOxUbpp4hqJf5qXVi26sCz4n03moSLM5CQDnF\r\nuZdu0sgrG5WQcaKiXnt2quY6GnUDWNTgGuMVWu5/3gvzVCkgzn8M2sd6m+Yz\r\nLSbJ52KYq4MBignvdmUjiD997g8Lj6F9m/4LuxZerhlx2RKwTuL11iyV7NtI\r\n+HdR+DsMICRJ0Re9xPm61+EdUmALPZwTQA8wL9skNJ7SgS3lugXKaZwE4hdu\r\nWFx7njZlsgEaotIaqgwa7tx+TD3VtbT04G3RbUbUAAyw5TEcDZGCuaGyNY9z\r\nfRzA33ePN7KyZ4uGpHaRGr+Y0MBGjN0dEV+EQL1FiCuqdlAyDm9wCKSN76GT\r\nvSYfEvsz8UJb0af2KTEFvmJIy7fbD97dKnq2J1ivmh8LYN7nDHEM8SQ6atvh\r\nYIY726TqPeAYv5PrRU2VrUjHTrCs/yDQjH3jy+iroX1s/9ua4Uu9qLAiqj0F\r\nRnomw2KKL50HBQU/0z7dgDCbbhUq64jNXhHLlF7PrWp7EzPTeTOb//IQ0nEB\r\nyyJA46Sq/eaYhkH3iaQba+SHkqsjDzxtBv0=\r\n=DLAm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.234cdec.1_1653537682528_0.4486673188522201"},"_hasShrinkwrap":false},"0.0.0-canary.ce07ef1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ce07ef1.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.ce07ef1.0","fusion-plugin-react-redux":"0.0.0-canary.ce07ef1.0","fusion-plugin-universal-events":"0.0.0-canary.ce07ef1.0","fusion-test-utils":"0.0.0-canary.ce07ef1.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^8.0.1","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.ce07ef1.0","fusion-plugin-universal-events":"0.0.0-canary.ce07ef1.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ce07ef1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ce07ef1.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-rc3eUvNreKbEJdLw8r5p+EoXfrnZoFyS6fXpmmHu79fV6ajRkFKJQBaJrrpBaVsCelo3+mgSaq/AKwJewxB5DA==","shasum":"164ca18b1d768001232681f7f464ceeabae81155","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ce07ef1.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICK9TDgRvCtvjqG4bDDRJn81jsXR4Ak/2E2PL6ZeOiWJAiB4fbYoOuS4Pw88Slf8+yYNiQbvvLMiNZkbTCcr9GjU3A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJikyL+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoagg//Zu650MU1Yk8+XOsrSPQA/0NDslLdoqd2aTPRQ0AVL4T/cm3b\r\nCKHK42ncrphlChGF2qyBL4CIVqL7ubqcogJXFrWFkwtVHpf5dVRbfdBKzppu\r\nAcYxk+sYjehPzb2u9iQ4gnrCVlKoFSQFMP9aekQCPim5mq1OKRedKPLYBzJX\r\nIVfZSwupbARf5BwyB2X3J48pd44Z63qZHs0o9Su/F4SJCZc1mO03HbL8gVEq\r\nSFGobgtVPwXmJv2xjX8UQ/XbDFBvWsTeMf5r5CWaOoID7auC073WWNmmFOCe\r\n99yz4arfPCR2Lh4UdWKq6amOcCgmZLD8S2TSpjlb8D4rnSZX2movN/EpNODF\r\nFQWNHBDP2vmDDbtEQX94532aCNk6Kuk8Vh0o+zQIrDgxqzPASGBgtqIC/FJC\r\nsXQUXVxMATDR2Vjgoz2/eYLHMJgXUqRddL1CnUuAmvUKpzjwSVbtfF2g8ctw\r\nYKimp8E6FVicR4jb7Ce9UWbvtzeChn3fYkHXf4qzufpuTN0RXvv6p8CN45Oy\r\n3INt9swa0B+5kH0ptwUtMTnUY2KIOoc022aLsCpJO909O1sxlQsEQc8vYHTF\r\nPYpesYWksto+d3ubQmgGjTOaj9GFnnXS4C+KGBgouPqdM5LyqVeW9va/vZqT\r\nlRm2VHW4e+B6hVwnyXqZzAjOe64E3WxxcyI=\r\n=LBLp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ce07ef1.0_1653809918224_0.31247852717319"},"_hasShrinkwrap":false},"0.0.0-canary.6d29913.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.6d29913.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.6d29913.0","fusion-plugin-react-redux":"0.0.0-canary.6d29913.0","fusion-plugin-universal-events":"0.0.0-canary.6d29913.0","fusion-test-utils":"0.0.0-canary.6d29913.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^8.0.1","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.6d29913.0","fusion-plugin-universal-events":"0.0.0-canary.6d29913.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.6d29913.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.6d29913.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-PKRaCJ2QeXn65EqeKvrK4aOX8dOh0tooKXlWt6t7gXlDJMLnC2E8PY+4+fAPSQZyYoETUDetLWkxTfCxjtfGMQ==","shasum":"8df05d5e82492c55b4ffddf67cb60341b6e55960","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.6d29913.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGCvp4961MnH+vMtjLYLtKlRP4hgT7Lk4Pc0PKlm7zC6AiBHzOW9JxXAEWGI+wJq6RMG3qhQk+7AMUgetaD/SBJDUQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimaUHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQnA//ejBDDtwrTjPuhNYLMoxW5oMy201d7BrIL+vXHoL1CMqBbwKa\r\nJ1FXVro91vbAOdZ/+cxhtslmUUopmw5/EwskXkQn4TetWguz7lSmSlUfFoxn\r\n3KxLbYDCIZUVJk3whXN9OwaKQVzhuWuxx5uA7b0WAXn4K2v1v2S3G9DucUwa\r\njErdBlQxFapzdgetM59YBhUxc/46D7seiIIUAQEiTboPcYWrmUp7sOOszCt0\r\nshRAAmZXHFp9TllgmW2fnvTXvL00bYd5QgV4KlDphHvPA0mgp+yJ0L8tNM19\r\nKBiOBo41CGrENgrE2L5jS1tRk+FHmeQfnnEmaspwygi3ts3rsQd9OFEAzHeW\r\nplfhQ3hU5oRobqTCowxrAL9A/CGGPoZwehdZklRpL3sultSX9p95qPwlI2DD\r\nD0NbsT4IlWxhKfXCa38Aa1ynOznUWtJtadd0yHPgyw0rmedWzZkurJO84nqu\r\nceiNh8yFjak0IhzFwk9+Jr6jCN56NIMpMecx4t0harYFf5+amyTwV1aC0Wsy\r\nCswwAi+ZO5p5S5J5EMxmYUBCH1jwvpqIfWP/f2f05jbqJ1TciSE7H/Z2/q7L\r\nU/cTeS8wqmUVu0SsWjUAFW4FBxVhOsslnNRyFHVIrV+6RoXk3uEjh2MiZirN\r\nVT/OM41ayrG1eTLpf6wbtuPTcs+PgOR2yak=\r\n=nzpz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.6d29913.0_1654236422954_0.7078180915359309"},"_hasShrinkwrap":false},"0.0.0-canary.eac89e2.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.eac89e2.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.eac89e2.0","fusion-plugin-react-redux":"0.0.0-canary.eac89e2.0","fusion-plugin-universal-events":"0.0.0-canary.eac89e2.0","fusion-test-utils":"0.0.0-canary.eac89e2.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^8.0.2","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.eac89e2.0","fusion-plugin-universal-events":"0.0.0-canary.eac89e2.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.eac89e2.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.eac89e2.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-a8jzVKKu22/xMgsvbcdpQ5WHlmo5QlXHQfdH4LzCNI4rBEelK112r/Rp1Rn7+h0U5F9FfUDb310wgnZPn2hmQA==","shasum":"93d255994b4de61eca63a01cc91cbaa84e1b6840","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.eac89e2.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGDySNwNn4TqkKvkpk3HM6ujiLbcBmr1jKTzZ0YIO9szAiAzCuX0Y4ZDHTNZkC/NnwYe1xyOe68IBkKBauwzawHPKw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimbdCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrxvw//R91mzfiYK7/Gsxp4zgOIOzah8v1Qe05hhA3eWM1PuOIkQYNu\r\n5nNYSyVzPfLLSFWNTWnW5rkwlqnb39dCmoKFYUPDzlM/9kcKbKcNjp5Vy7RY\r\n3OdCFsQdhmnK7ZXhThM5ftEuvBXtsDljekQmzJL7O4thy92+TKHLyPJ5b7IL\r\nX1yrr7bKYfSJFhBn4ek2ZmH5GTuOKosbvlsgszShfzgEdChMrDHsdk6uNZq7\r\nCl3FU6Us/Ets3b30wy9LEA8XbMcDNhmAlBSTeJ7fWEtWGU820xkVUtnZoBfE\r\nfjf0a+9TldUKBEcch4wCvmHJntH602qvLwaDWOeyiKuOZqWzz87iwK4DAEkd\r\nMnVSuEaBZJdM/y9EEfPzfNfp2x29RD/j0k/lIhyzfrgzQh5id8ZYvEdJpSow\r\nDqlg4AutFUPXnDpgd2no7f3Sl/zp9ycBCJ/DOtqoGFhHOM+gvOodpSwkqbTo\r\nKM03kYQgnxoJtBghbPGA85lZpecMmyL5Z0BfzN+yjzMexetUU+mzzw+9EYtp\r\nloW8NNp4Bt/WCsZEXEZuiS1cR63tAdvWMYrjBED6kLnBf3cMx0DstztbZ/L+\r\nAcyGhP/nmaCM4W7oP7zFTb1xIDoSA2t/lv707ovGCyq5J6Ti0BlBU0927K3x\r\np8lQM/xUBqahdMTJNF/aUgdfGmTBh2VU/w0=\r\n=k8uK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.eac89e2.0_1654241089875_0.34107390510755264"},"_hasShrinkwrap":false},"0.0.0-canary.c36b35a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c36b35a.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.c36b35a.0","fusion-plugin-react-redux":"0.0.0-canary.c36b35a.0","fusion-plugin-universal-events":"0.0.0-canary.c36b35a.0","fusion-test-utils":"0.0.0-canary.c36b35a.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^8.0.2","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.c36b35a.0","fusion-plugin-universal-events":"0.0.0-canary.c36b35a.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c36b35a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c36b35a.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-41augMPExXr2oVYtyBJf+C6ExMRF0xJZ52rwpWsmd9z5KuMTLH3F+ROH15s0X0Dsjawu5vq4SyL5h4Nz/gNLgg==","shasum":"54be6750cefca72fe1aeb84f52bb3fc2aa056fbd","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c36b35a.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGi16S9AyfRa60aLhTuTwUgHuNL5F3wtLClcf6x8HA6fAiEAgWNR1JeTl8tpb555Kcj1tQxlmp2ppcZbhmjYZ/umhyQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJimodgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqm0w/+N3i4f8/gq5PfNuqK4zPP2JLNpi4kuBRIfS9biZt1Vfjni+cQ\r\nb+OtijpIykXKc3hgwiskdQm6oE+XXeaVf12c8gB0ZXaBYt6fVnVon9RtVGWw\r\nKQcQlaWR7Zv2bwoUQJIoSJBT3H0GMcokvA2dGvdVvIP3rTQwIy7qh0RGD8E9\r\n+jbhMn4ler9/YgCuLnDzUBDlvLTrNdxdPjtRIcsMUchmy39p6stIuMaltU/Q\r\n6QPnLZGB+VXm3GTaXNoIcsgp9uDaLIPpaKBFHeUhDQuZIFcdP/sFjbglpTze\r\nVdNW7V6p3gfazmCDHpYSXtggDfjnnvHXZpZO0hM5hoEmEO6TLU+N1/R7Rl7j\r\noCZydMYwrsUIKEyKvG4uVHff+IkvvooYPoFj5bbxnL4pPjKjEWEzsWg3Ynik\r\nv+8k3BqAk6t3k8tVPLxQfx6gbfF4nxuRQ4AqW2b8wDcfZrC/ZRMXz+TQAA2L\r\nRzw/0P7NKbv/mBSZn4JXsiKpxotlMC8a9HeOv6G9YhIvIds74Y4wkqbJtbAi\r\nHMqhX7lr+IM5zSMombPHBqFw/gb99A9vHeAEC3QrkLl7ZIup6N4qY2axaNY4\r\nah1HvdkckYiq/49xIvUp2btQuEHVjrARJMYl8cr+6eh91KzV2fxPbdxXn6vt\r\nqnJNGtr+2p1qkMQU+mGIoFhDw7hNNLt/CoA=\r\n=BhIA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c36b35a.0_1654294368764_0.5313865531898461"},"_hasShrinkwrap":false},"0.0.0-canary.7c27df5.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7c27df5.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.7c27df5.0","fusion-plugin-react-redux":"0.0.0-canary.7c27df5.0","fusion-plugin-universal-events":"0.0.0-canary.7c27df5.0","fusion-test-utils":"0.0.0-canary.7c27df5.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^8.0.2","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.7c27df5.0","fusion-plugin-universal-events":"0.0.0-canary.7c27df5.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7c27df5.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7c27df5.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-szvV/AU+CWO3hkvOmp+XPqA6h9Mx6bodV8MoahAiHYoxW46V3m4CrLF5kZ2QHIh1sUtycttL1KtI6xvVB/FjCw==","shasum":"53e7769d14fa3afc9dc778d097b6d27109a6b9b7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7c27df5.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAhr1G1MyybXNn5DSjm1jqMQ5qRkpHhuLPoMfLNh4BjTAiASrdUhM6T8m6rxUdpPzK82kNG/vxMuLBEZspxdMFDsDQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqO0lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4Qg/+NpkqrTlnkDR1ODIbCUsljhkZSxdmAbWM/b9C2dij+sflixAk\r\n4w+XQH30pD7iiwF8+kdpEjXRZTwwtJgyA7M/xbuQp+dH7oTzxDn5NdkBvupu\r\nHFbk3mlRh2A+XJrMiamNXeuTgV6cShmBTe5KVrQsUAk+kDWW0sn2XzhgVQtR\r\nwYB75BDGygBY8hZNDhF3PxLgTUTCluKdVz8jZtfso+usAUJ5Pac4W/3/Wej8\r\nsXOGmm/+LdBXj0EGCV5xUSCliuk1NzNPBA/tYcUYr1tF43QaywcaBWJK0Mj7\r\nDvyY3mjfdvAH2b/B3aEmczv2ciF/ScaMi1ljL4pUffLe5jKOcZZ4yaeI0qc7\r\nITfyz5oRAmty/9DH6fRl2zJBPLqjzaawbcyakcbnn36sS1qJfG8K6U/K0CXt\r\n0DLGVCrEDTEqPMDhPzkzw11B77SYfm4/rMWcueDJDAowZV2+mMFZZ+uetirO\r\nCsNJI33GCRb5lH764QDVgl1knAEQPg8V7i3bMeO+UH52qsY4GMRTEiNL5tJo\r\nM/6HeIAEFQwHiEa8AXx/cfaIPqcjcxRLASxFGrInUWIrWd8h+xRCJiuDlN1t\r\nB6xmuTUe6CyGIyxC82WvySQfMnnSno4GUMu4qaBNT3sTp110XdB+4EUydspD\r\nf8npaGZWlfyjm8kZmRyZq/j0KKi4DTyPE7M=\r\n=nWFl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7c27df5.0_1655237924939_0.8910168721385789"},"_hasShrinkwrap":false},"0.0.0-canary.8894dd7.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.8894dd7.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.8894dd7.0","fusion-plugin-react-redux":"0.0.0-canary.8894dd7.0","fusion-plugin-universal-events":"0.0.0-canary.8894dd7.0","fusion-test-utils":"0.0.0-canary.8894dd7.0","jest":"^25.1.0","react":"^18.1.0","react-dom":"^18.1.0","react-redux":"^8.0.2","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.8894dd7.0","fusion-plugin-universal-events":"0.0.0-canary.8894dd7.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8894dd7.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.8894dd7.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-5RMzvcmvKhN01908QCoqPlukDxA21zEs4lFkU6SgNtwzx5QbFhu2J8kWRuMbBMXVXcKOi5gNPupCN/k673+MfQ==","shasum":"d2915b56f6432792e8dc4e0d336a81f5fdd25b76","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.8894dd7.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA6XqN2Q85KFky/otwaSZh27l8NmDB/QuvbFy6NP/2VDAiA/18BvGOSjvhI3OYRDLcVkZ8a+4Mnz9txb9NWmYv6wtw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqmRcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmruvQ/+IDBYNaEk7+isnvTQee6DGgj0P2e39m483KIEPschb7qLmZkU\r\nj/ZWhs2DJP/aTu0lWbZgVoyq9AKTOakEQ+yP7YEiXlIlVGQSK0301suKmwO7\r\ngGaLBMKpTG+8pDzha0LE13pZ45Nx6LsbjB4wPgEp/Nxk40sXocXRnnMzNusx\r\na5mvh/4GbSxRrGrLuVr0XIKPbfLNLqujl1KHTOBlfbMbaQz9p6vKKXkQDxG/\r\nV9G7q+MIEx8O1wlyMejPWlJ/G0WWoZq6+w6ItNbnWXjy7G4vWb3H5d2Kbpkh\r\nm8ggiJ+3XWA/J/VmR3rVBFimlFKezokBxgcndljwuIeNrHaChMeiZolJcDEO\r\nffssrcySWQXpK0d5eY0VPs7PjXn/Eljf1N2V3hncTcle4A3wS8mso61WBrZn\r\niiztLaaor+pw5tR/bu5E0k6fV90/tz2ZPDSPztmJtxYS5SLCxikKCkNfW1ZC\r\nivW+NrKRh0mFs8xWLBvFXuTZl7MaUd3uJ1fum9hacBYbQVr0YFx+ADPOdpXU\r\n2RgwERskixBZ0RcWnQwBwYHG9kRbxuDetwc6vRON0ZgjRpGQm+WF0wG+2Y5o\r\nwIRSJ9EDpQWTWEDHDcK+0zIc4/SH9hF8gde9jCk5CkO00N2XnsBNQNjazd+Q\r\nccshKa27w6nJJ6IdUye8JsyitLWq0KuPXjw=\r\n=Dd1x\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.8894dd7.0_1655333980019_0.4761196480004173"},"_hasShrinkwrap":false},"0.0.0-canary.5378c1f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5378c1f.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.5378c1f.0","fusion-plugin-react-redux":"0.0.0-canary.5378c1f.0","fusion-plugin-universal-events":"0.0.0-canary.5378c1f.0","fusion-test-utils":"0.0.0-canary.5378c1f.0","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.5378c1f.0","fusion-plugin-universal-events":"0.0.0-canary.5378c1f.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5378c1f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5378c1f.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-vC36rGRjZ1WONATyYOcQCC4F+mh3QaYBZJBEhwdnG3r5t9AO6AHZZSUqXlcvDnMTiPV0UI/Yamo+MKCfUSPKVA==","shasum":"36fa004290eec08bcb742f2d15eac1514bb1e4ce","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5378c1f.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnt7FYBFLfmEEno59h3VK+c9JECAyXWU0E3E3pj/N5DAIhAJPe1iV/5FtN0pqYY173otfa8on453wFBhCPDuyEIxFq"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitkOTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4/g//RdKQqdiQgA1avzENVBPN+YATG9tV5A5kEncoG0+j2oULIikK\r\nslkBL2ZqJ1Q3JHGJ5qO18m70LAR6viUY7J+iG6744TvnkaKArqwVngZ4wrij\r\nQsY2WfcfrMOaYIV1k0T91Iu6IM26Om0bGwjEO960pyrSQ045Az28iy7ZfoXW\r\nR0FO8oPoG58TkcwFmMJDNinl220JLX4bjV7wSsMlcjIBEoxXVkYL2BfTjr+c\r\nDLjd9FeFXgVaEHe71+8U0R4Pbjr+RCriVuKiOA9z51na/pdJA6IUzo1iF0cO\r\ntYQcSpz1jOiX6X9g84zoWDJcpgD4Tkr9X9VBsgzthfOFxXRDMjSpzpc4EACh\r\n/E5K2NBwO+h3ejnthEAg+6ewtUdC8HhpNl4RJJit1cv85jsY25Y3FsWHgAdM\r\nr+rZK7ZJNxUB4k95NKHMyGW+LhK/LfyFPzGxu7VmFsnU1JHzKTL6Wmc5FESj\r\nNIzwXepIOPuAEtrqYoxtOHPWWYxF48W67RuGVE1tAkEXajEjQHM8eYLPYScf\r\nGCziVJT0Dap4LrrWEoPqZKjzRCPr+nxEMpQQ6mibWvJu6UAmxsP8pzAgFGhe\r\nFULxqr5j7KtNqQ3mqfMcB+X7r4uTo+yMx0oaNoG6n2yAwT7y808lPpolr4Io\r\n9amApLjoX4WH0ePEcmTSRocMIRwIRR06GVo=\r\n=FzY3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5378c1f.0_1656112018961_0.4222217741271477"},"_hasShrinkwrap":false},"0.0.0-canary.e08ad19.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.e08ad19.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-proposal-class-properties":"^7.14.5","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","babel-plugin-transform-flow-strip-types":"^6.22.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.e08ad19.0","fusion-plugin-react-redux":"0.0.0-canary.e08ad19.0","fusion-plugin-universal-events":"0.0.0-canary.e08ad19.0","fusion-test-utils":"0.0.0-canary.e08ad19.0","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.e08ad19.0","fusion-plugin-universal-events":"0.0.0-canary.e08ad19.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e08ad19.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.e08ad19.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-7MhWQGPgc8jadqe/kCZJhTWVv6CEORG2DFpf5QMp7UfG6xCqcHfbeKTFC8oHCIiIMjmig7jWrR1fAPSLvg59ew==","shasum":"59d92940f784d6d44242fe963b451fd693d6f581","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.e08ad19.0.tgz","fileCount":12,"unpackedSize":40966,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4Tdu0CqAMSDPgS5ZIOThgPjVUmtIVig1Zqe9tUJoj7gIgPKDwQoetnx7t658dKeH/PfzPb+UD4aRGS7B05zT2e9k="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixN+WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQLA//ZiTDvqde/+qL+fowqzalYNwBd81IMB3jvn0S3t70B6BxiItU\r\nsCZVUsm9KrF8OwjQGQEf86B/MdkWDGhDtCs/qs2aG5MY8L804tR9M6hq36jn\r\n2jQu4rnRuAJE/M7LQBZpkhfi/KnhGDPiUMELRhQgmOwaJVzG2AHF1fZ/RDTj\r\novxBPhPEcboevVX/TczXlaQwd82I5kHZjvHXmhiUiWON/BpFiQEswa3QJSdI\r\nn4m3q1Gk9TX1drYg+bylb5yG0PygXu42pCUv45BA1alYGLpcHR0ZGdg06ru0\r\nBCQ7eums9xUd3307OXqFE4YjRs/CTEaqOStdxjper96T2XkSSavURLf1rYhK\r\ny33KC4+O2Z+JpVkME+nKNwlzDTqv3CH0XYCneTkATh/ZCn8kYvQcQZSreQXw\r\nU8t517dZ2lbL5QMNaAMaUaExYSrUsBGDaY32F8VO8WWD4ZqAO+we+XYfuHnr\r\n2S8dE3Xfrm0piSR5o7XtafNLvJcvnVnnSDKjpo2tjha2hIcvdRqQlziiUsnr\r\nVF7lMIYQ1Q0ZCTTLwrBgMtkIHBTqPgGaZJJSI14h2sGKY/KayN1v+h/95Bdg\r\neBDaXi7vgPMKxmzGBaNDSXRwBL9ZeePEPAxasGOi/TE4VFwxCiilkE6Jc7LX\r\nWbIA7rEx8/9IqlQAr8kqnTH+/VIW0encef0=\r\n=NbJz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.e08ad19.0_1657069461999_0.126263822161907"},"_hasShrinkwrap":false},"0.0.0-canary.57962c1.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.57962c1.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.57962c1.0","fusion-plugin-react-redux":"0.0.0-canary.57962c1.0","fusion-plugin-universal-events":"0.0.0-canary.57962c1.0","fusion-test-utils":"0.0.0-canary.57962c1.0","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.57962c1.0","fusion-plugin-universal-events":"0.0.0-canary.57962c1.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.57962c1.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.57962c1.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Z4IHdkuQ60cAUykXrEhCYeDejMjNgkvU14nXzr/0X+5It+D+330ER37/J9EodGOfFqNS9qXwG6Q6apzMxXeGxw==","shasum":"8ef553741d7ad20a891834545bef6005e916edb1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.57962c1.0.tgz","fileCount":12,"unpackedSize":40850,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCC2bpAEvOtEcjVt7SfctP0e766TRbjR15my8DCx9ou2wIhAKZmi1OhFV1C7wsvYND5G06vrf+lZOGf2jaYCm25i7jn"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixglpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoqZQ//S3w9ycYQkhMICi+icwd5U0KUBU2bOBO8IUcGlMyApeTT18/t\r\nID6UDRqhD/DvAFx/J7ssCeemxbtnm/G6003jMG5M8gQHMcwD9qGmbY9C5Ty8\r\nhGzS5YdxWnIZa9iR7zPrkTRK0X+2Xw0a/1m3YL/2svLOMWcSMyJzIpXdx9mo\r\nvV5/FGmVSjMv/UzURP/tlnrcCyAoynsjOF4EZ7wMcL0seIcwGzQFpmp1te1z\r\n5zTBWkKG1dDWnksmaxSsQK2ATgtECueHpPh1FKtzpIN2Ai1B6dGqoYfmLUEp\r\na2XZzOC3KWOm4vbNZ1RDITMa1Hh3GICa6+TfH0Vsqg2QxT1QTDsqXJX0lpMg\r\nTEkUAzoqcpwuYtru55Im0Us0+E6omhtsviAwZTKe+HWrDpnZat8wXNi5vtLD\r\nuB6eoitBaKBt+iv9sD0tDcRJh18gHIcZTgjUR/dEbLN7VFBoMM9MAVzdzd98\r\nf6U5HIWAWH+D6NJOCPsbW2oJaAQefh0wzAyGumJ/k6PlnSg3u8J3JsqlHG6S\r\nY9GVp++QdzPclZFbnvXZiXfm9IDpNq8f5pW8+XAI/rtoPcM3Y833msW0z9XO\r\nfvh/fHG+me+Jy2wG63sLSG9zzpxzzdAfwJq8grROcAktXKFMILrjWIZ6uu9N\r\nrRbAavQA/c4/Ussd4UC8hVEfjL0yP/ZKw2Y=\r\n=qmhI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.57962c1.0_1657145705145_0.9787165105646549"},"_hasShrinkwrap":false},"3.2.10":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.2.10","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"2.6.3","fusion-plugin-react-redux":"2.4.5","fusion-plugin-universal-events":"2.5.0","fusion-test-utils":"2.3.9","jest":"^25.1.0","react":"^17.0.2","react-dom":"^17.0.2","react-redux":"^7.1.0","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.6.3","fusion-plugin-universal-events":"2.5.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.2.10.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.2.10","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-7mjbv6uxztZ5lCkqqpWft8hvC/m5lj3BNWHRE9A8Jedb+puKft1NEC3ShcPUmcXHW86QXRhjLKw9vSz1sX0CUg==","shasum":"d6748dff9aa70efedca789fdb996632219c0cf6d","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.2.10.tgz","fileCount":12,"unpackedSize":40732,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrHnAC7k6syljOeI5g3RW/KwARwCKcGewHSi1lLnMlJAIhAOG05xKADSAaV1gpsCj/kwpJ+wv+qZzeMAti2NSnPceN"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2Z4UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpnZw/+OXlkDApSGKnfYl0q+5hD0GadyLie9JKKbLWDFbRj30qZQN6U\r\nYEeWG4cIKoeiDCIaqsOy+5XcuYhltuEGnTX4Vt9FqYlBSGWKrAPVvHuoDTLz\r\nQzozvKD8x0mz1gD7R78bSYGMEOgaE3GwEavLmFFfFhrJKvfY+G4djYWaUK4R\r\nrKrtDORSyhhWi6R36RempYVNeA5R70ojmMA8sjIMGmi0Cm+gzC1winZhUcHk\r\nUQ1azOid2pz4Oy3vFu3q/VVccoUX4pwi73Uvvc42cbU91SPjjWrJRzjSAXKz\r\n+tilsiDxbR8eRUqSDB3sXJOdw3RpQn/L8glv5B5JFGHgR4dioRC+dDxiakJd\r\norudf9aFLl7VbSFVlcG6uJyxyWqwYv/VjIPP8Zr1MA9M5rt8vKk4rsdwAr2o\r\n2WfruVi8hj+i7BLpjwoqiTlMkRRuvMNQBsGLMZkX5wghfenOnyIE9GDItU2E\r\nJ1mHHKjc6ea4DxQtjyA1QNrE40vzLHxVsp8DqSib0LzqzUiEcfNUaF5RI898\r\nN7koH3K09etkLrgQxX9sJm2KxMOFPYLB7W+XC91vpqsOGWySzHKj5BPGk0ky\r\nj9hum0hWPFPXBKXijK1uS+jL+tGkl6DfG0QYx9ZBJf8vfn0Q2Byi1BTI5Xj7\r\nNXNfKheu/VmajHbGz8Rd03q+/6hqIElY6uQ=\r\n=TGaq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.2.10_1658428947800_0.7542224743119399"},"_hasShrinkwrap":false},"0.0.0-canary.a682711.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.a682711.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.a682711.0","fusion-plugin-react-redux":"0.0.0-canary.a682711.0","fusion-plugin-universal-events":"0.0.0-canary.a682711.0","fusion-test-utils":"0.0.0-canary.a682711.0","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.a682711.0","fusion-plugin-universal-events":"0.0.0-canary.a682711.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a682711.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.a682711.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-uNHQCsfhqKQwop2EQGGjkaAlx0ykF4JGZKRNGNWddJDdlzxBXHWV+a7ndZ2NmTs4pzAV9ybntOzxk+2HdAqBuQ==","shasum":"e55ab24333265c9002f775ad42d7f02436ea9aa7","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.a682711.0.tgz","fileCount":12,"unpackedSize":40850,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICHzPZuWw0vUFwqkgkK8yZg9Mwp2jGNO6YKj6j6ESELsAiAfJama8oWsSaZs6TuyBGF13sM9ajEAk/eqHDtnw+W8ow=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/ABTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKQg/8Dv4K7BuXaK7LhsErneMxtn18nk2/wHia2B/HItL/dOk1Ef3Q\r\ntk7MICd/Xyk6irDSFQ5kVBSDXhqJxtQcv1PQcHfjkXIMvDjGl8Ye+YC1jQYI\r\nBbZKhyLg+kp1zPjCilkMIQ5pF5LidmtdURCgebjUL4FvrXb+KGpSm3A3HU4F\r\nnCNV2n/hk5otWX4UYRtgC7XotbMwN5/sCqSQmCQrGMerGF9zpnZeDTpon/2V\r\nEYLaiEYYYxpBdFgRdYsi6Q7s8XbalmLWfUwdh3jmtzspdWVrvIoK9n0yoY1F\r\nHefg5k/4KIK5w7YBqa8cSRxvRVm5y0fekkqAmygbOD3ZgMNvjld7VJC/ZlBN\r\nu2xCuDBSQE08I09YWDI4c7DSXyqHYV6t3t7lNUEIKayqMhR32XgUUnlyIWAR\r\n69vMmnilI07wvrgR2eoT4kAeb3tYmyWB2UV4SArSTPagfdudizWDNxcmUJTI\r\n8fYSmaTVJX1nbhfRijRApRTOemK7d6ZIAQyx2NXpYjyoM6Kuy8LoHFGVobM1\r\nB6Q+ZocO00T4LB2gPVt2wfcGeE+NBHkh7ZbF2pMzNYn1vxmlLahRIvttsreZ\r\nQ/RUjNQU7NjUvmISZo3dQFkezvDrLIdKU8RAXx6oSC9sV+1jdim0+k4XjcjM\r\nJZGQfrkqmyH86QC4fKjDZLSakOVWKVJ2bP0=\r\n=yEgm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.a682711.0_1660682323343_0.6541479916520756"},"_hasShrinkwrap":false},"0.0.0-canary.47148f0.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.47148f0.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.47148f0.0","fusion-plugin-react-redux":"0.0.0-canary.47148f0.0","fusion-plugin-universal-events":"0.0.0-canary.47148f0.0","fusion-test-utils":"0.0.0-canary.47148f0.0","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.47148f0.0","fusion-plugin-universal-events":"0.0.0-canary.47148f0.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.47148f0.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.47148f0.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-SD777oWQoBGKxmIcIOsjTKBq9GGSUwLKYW1vTST0XocI7aLuCm/XOSKQW+chF+LyMl3VZ2VQqutuE7DeVeP9aA==","shasum":"163a3fde924e7ff96d128847055a393334f52bae","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.47148f0.0.tgz","fileCount":12,"unpackedSize":40850,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDx7uKu8fsnIGQZkTjfdIBHYIO14hBmcGzc3vb9/FjQPQIgTLG8uaQe6zMwf5MYtIVTDThzYu3/XXJSDW5eu1SDqAw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/VBVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCcRAAnghzGrDVksqUn+npLc0SCeRVitcKR9/Aq5rKitqNWvJP8Z+N\r\nUgBn6VgO9rEkfuppAEMwf6xuH5AJsXAtTyVCcuupOR/1y27iqV1sMCXoreHn\r\nTajLC9Uyk+FBmaeS7vhrCCcy4uv9K+cnZ1+EeYKhHYQyul7mH/Qd5XOh940N\r\nY4UUFiD7Cnr+8htIA39ayyD2y2ts4RNkpKcouJlAGLImFFVxkD2LtJlO1DnO\r\ndBdhWIIa4HBjHCpQWNeC2NLG3Sk6DqKzIURqVFIX4TuDzt01enzyILVd4rdH\r\ne9BZOPjpvocYlv3u/+MMPws+NUDZ42D5k7IKXlCD/MQMWZNVQV3A3HY8VW3O\r\nN3OVEXZr0yMjtinyppNAC8RWAAqPDY1burEfZC09lhfMkYKH/z2ie2NTIoCB\r\nbNakgXzUqYbJkpwujyZLJXTNBjOXHuwN5VJVlS56Zvr8cMMJ8bRgDSER1CGw\r\n0qJKmbgYU8Mlh7Fyehle0DEzPGoEeKvwE91YwNB898rlC+aisHW0XkzVMYzR\r\niOD+RylT+2wxPuxHMj5sJl6b7DELzi50DUIqI12L0FuF/tbf6T9Xln6qXgY9\r\nN1i3vdNPrUT4wm33qBnNHPVEYUzxHs7IqKVMgzprNJBwWPqkJFTyYHj4dFC5\r\nw9rMN0MHTgdRvoXOPETEfyuy16Ty/8vCKy4=\r\n=cx1l\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.47148f0.0_1660768341234_0.13066821006943163"},"_hasShrinkwrap":false},"0.0.0-canary.2645e7a.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.2645e7a.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.2645e7a.0","fusion-plugin-react-redux":"0.0.0-canary.2645e7a.0","fusion-plugin-universal-events":"0.0.0-canary.2645e7a.0","fusion-test-utils":"0.0.0-canary.2645e7a.0","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.2645e7a.0","fusion-plugin-universal-events":"0.0.0-canary.2645e7a.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2645e7a.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.2645e7a.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-7PyqeqiJGz6T4280gaPzzhwaqgbMbyPQqS2C2NhN/nhyb9BBOfdEC+nj71GwoBU519t516vluSNb7T066oSnsw==","shasum":"f5326a6374f5b8dc947d0bbc803cae1b3a612f08","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.2645e7a.0.tgz","fileCount":12,"unpackedSize":40850,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGZURO2GOuKfxOw8/jPXrDrHF/WnYrwfc3wiLk6xHs1pAiEAtz+yCu6OmLzr2GZFCDXHJA9xOzAddE2nNMilf7OV0lU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBnFCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqqXw/9FXkG9DMyLIh3jmZGWEzdGVXM55L8Du0cDjp3KXEFVWxRBVm3\r\nC4TlsFseU03qOXx3b7fQlgmuPeb0Sc7NKKc9Mg9zMVJxH0XhOgyU0VWHA89o\r\ngr/zAOdyt+RNGddQg9JoEsHN61Koylh55HPHUdFPtBDocaLw6zkdh+V/nWWe\r\nd3yzHGkvZZIk6HwsHUh6xG60vofIyq5EbST16/NiYDHN33M4D0mD+2YyBJhL\r\ngHb3wyo/ub3AN5aPbjlRu7JgnWlKwdmIBFcvjkpGtEs5urXmqkCiqMKSHonT\r\nFVDMnMrW2i3xTulAUGD19ngTGJCDplHy2L3nFlwC7cqm3uX8sfgTKH0cV0LP\r\n/NGsUvdntgxCMdzWQ4ZgHNXC1AOJIxPmMdE4m+aUBblmbTl9WSmZzkwDnhFY\r\ncCshT5erbhR/RrkJFPdGCJix9kjEfaR9jx9EM780ni9X6dS2Hsur1Tom5gQU\r\nzcs6MRgQoFAQjIeouCp6+dn+F5ihE04+bbiOmHJPbDkpBVPipc+5XEm7qfPL\r\nYW7ac5tgiroxHJtBu+xHi4KBf1eCDJqgBNhhyHwJBnlW9n0+09mCIklSj4pd\r\nkmmQd9J8p0O8zAcWGmwLMokPVWVTktC3yKZ/g4CUfCPQtxTrC9DAEck4/olD\r\nE68l/ogzW8LskTSjENZzvbyphwbdwUoVq+4=\r\n=BD4W\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.2645e7a.0_1661366594711_0.9157144079912469"},"_hasShrinkwrap":false},"0.0.0-canary.d248f7c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d248f7c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"^0.131.0","fusion-core":"0.0.0-canary.d248f7c.0","fusion-plugin-react-redux":"0.0.0-canary.d248f7c.0","fusion-plugin-universal-events":"0.0.0-canary.d248f7c.0","fusion-test-utils":"0.0.0-canary.d248f7c.0","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"^4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.d248f7c.0","fusion-plugin-universal-events":"0.0.0-canary.d248f7c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d248f7c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d248f7c.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-4I/6pfvZMKQsHzFbujo/v6hVqihKNaOUuAeE71G1rxeuJqRPmzIVZnGykjhhbMmcMLk/FTzH51jRI796XRieQA==","shasum":"8c4d741a888435bd64a6687f3a9625761988db57","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d248f7c.0.tgz","fileCount":12,"unpackedSize":40850,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7YOXGJ/zwS/TrQ8NYNcuKbD7joLFsVFyir7WCp7VCcQIhAMc+Eyvd8/lu+s1jkS0ooHYUoDqadnRShB14GqFsUQa/"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGTgNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrozA//VW7cBVlsgqggBhvPqh2b3QCpH2gQ/KUPel/R+HEglf2sjTbV\r\nTRbdw+Zpmf5ZuCaL/6cZ5UcC2fx9H2ZLy0eo/gGdJFgcXH1QYtTxnkTuaLnc\r\nCILP3ocOOtxbKxcoVOjw/X8COvmKTGj5qz6Dgief+cOao3iplt7pLjFrkbs+\r\nR06Xu9A5JaDcIE61cxz05L6mgvi/OAiX9dFddAgxTtyf9ypL+TLos2k8QlYH\r\nGIzFgRPqRoLaORYEp8myCrjCsiTnD6628/cGmGDQUUKk0phrFpTYlzmy/hjM\r\nQiEkC8SiMfwObSe+j4poJflRc1WY2TbosxTpRREznQuuY3bFRNEBFLJWe27w\r\nLgJTFuOrpFWw1qSS0q00D7AoA1+6o/CCf0xuqxmWRgaHB6nlSV6YiWTM/3l4\r\nnQXUAA+MW+2MzeHhvrvPCG1nKiohXji5l9qV3/nMF8qilAzualwc9rSuudC7\r\nMOJ3cyo6C0Srk7Oz3BNB5LS8R4eS9dtao29Teez91Zw7JmjP0Abkr/P3Atjz\r\nfhFx7c7WitNQn0uHYAjP7PCgOj7IcTy21ISVA0k2M2HVRBOYo9UcENCN4XdG\r\nbnT9rN+xrR3nC39/XYuweqVHDWlWWjd7Bmoc8F/UbS7RbaZWMKuXdCNmv9qe\r\nIZ4R8zoYeQxuyzhz2ur6hGz1blYgSPnFd3s=\r\n=G4eW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d248f7c.0_1662597133297_0.711841045312094"},"_hasShrinkwrap":false},"0.0.0-canary.c77e60d.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.c77e60d.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.c77e60d.0","fusion-plugin-react-redux":"0.0.0-canary.c77e60d.0","fusion-plugin-universal-events":"0.0.0-canary.c77e60d.0","fusion-test-utils":"0.0.0-canary.c77e60d.0","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.c77e60d.0","fusion-plugin-universal-events":"0.0.0-canary.c77e60d.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c77e60d.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.c77e60d.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-W7x4XIHMf6gdbks9d4Nc16VTw+9XZYdjoEVPGOsetKZTnN3DHsmk+tks7Uf+bcesBwb1/Z/1kjcI6HXGBvhsOQ==","shasum":"306da2627ec0e0830132140d174944b1e75a8eed","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.c77e60d.0.tgz","fileCount":12,"unpackedSize":40848,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdkJD+VOTwbLbHhBERsZLSUcvTLbe05KMZh4YNUQCgyAIhAPC9EyQHohTcrazMXIzaCecSSJ7tHTZChq/QnsPb2NUx"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKjhUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEeA/+IDp0CXSV9zJQpGIt6dZ7nRU02WMWPN5V/DbitqCctMi2osCf\r\n44hJf5tY9SLny7IUq6EjkbwrKXYVyAa8oQYO5fIhK5+2F91skR5QuroYlEo4\r\n0Lj9v4uPTbUINH7xUKpyyJ5mFiPT8CrVjnXrquE2o8FsNCOgP5GC54zZw+pG\r\nP9luWZfAzvaBc9L8qL13bF/Z1haC7z1CKkb3JnWitjWuvD9GkNpIvUf4lBTt\r\nylSblxYILwFdfpdt3N6uF258Qcb2W4Nxbom1bQwYjijOQt+L+XOWsxKf6PmD\r\nKjaKWRlvlngY4xageN2snSpiVbr+2rb717fe/6IRf9ycYVD/lVINQTm8BC+9\r\nfFxurH0n1uQO97JGLfjL2VHrcZF8r5l0cEmIINdqYk7cBK8UOzmE6tMjwZKx\r\nyDQhrd2bh2q1KEAukfZgBGpMmAvIqTJkzIFeHgeaVApBPRYiinKIsBea+bDG\r\nEK7/JwfHPboDShoiYv8u+Dy7fK3guOSuXYqRUV0qhuGcB7M7EA/8MJjHg4OL\r\n2+Vr8RlKvYnJAaUCp1UpaeYAIgaEhiedXTsWswd4FpYPrexbKCHqwOwLQdsY\r\nqeV5Xy3P5+aRRks8aWkhAnO/6f+SBTDtZ4FGuD3lp0nVMk+dmd1QpF15fNvY\r\nHL/SkQ+o3IqHVdrf3ha1iT7En9RMC/5PYas=\r\n=Rlvd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.c77e60d.0_1663711316623_0.49473595599228504"},"_hasShrinkwrap":false},"0.0.0-canary.5f297f6.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.5f297f6.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.5f297f6.0","fusion-plugin-react-redux":"0.0.0-canary.5f297f6.0","fusion-plugin-universal-events":"0.0.0-canary.5f297f6.0","fusion-test-utils":"0.0.0-canary.5f297f6.0","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.5f297f6.0","fusion-plugin-universal-events":"0.0.0-canary.5f297f6.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5f297f6.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.5f297f6.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-HbLfksmJmE6yjcTd9EA//b26E4flXUEd4sbPbiz9cSxc85NmElNbWZuIEWK/HuN0WSSORO13rOmGsot/xHfEeQ==","shasum":"154089a8b9ceeec50bbd7dddba45256092fb4211","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.5f297f6.0.tgz","fileCount":12,"unpackedSize":40848,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWJ1po0ClW4sx1pgqeoO64HON+yvNRs9ToPZ+QDg8ZEQIhAJcCF2uxQExaz3o4VsFt5r+gJ1Z5dv+RWY2086BWAvCz"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKkFTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoISQ//VeiZsfLakK6ntwrPzYzkcGqi0i6mfFltmogCc/mfGgi1XteB\r\n2F3G8LeRC2mbmQD2/NrVPWR4AN+oSupa/VylcQJOir7kRiOUWqxjmtRtLQqM\r\nDoZYWuDqyzF8341SKEF3htwEPbxAu6mXOKcwr2lQxtx3m1MzZzDgFtkOuhKK\r\nVnKX5HEiZ5gK0Kd58GTHHn4lhhjChgEhcBLYYgNpLkXgClpZ0KzHa5J6HMyC\r\nxCUFE8d0+2wImcy30dk6ZN7KXJRWaHPQAxOzV+TSQM9GgIncc2CpGTKW8bF8\r\nSE3/ZuhbyODhzG7Y6XJdepz/XYtQzPD7z1B/XFIA8NbWuYwNKtN2tUrzK2ce\r\n0LSubNtG/1mJidfmRy3Achur47ZUy8NgyxP4lbZBFhGKdNHzwVE8rB7NHY5h\r\nOE+U2QX3CVXWlWyhV9kLRtQeDdRcwPfkJFRqVr3RsJTXp1wdedhJ154WlZYD\r\nGqaU8KBpB9D54EsAjzD/3BHwXnlgXu5IdSXtrb2AlRfew1Y/ylOsBRTg3Nyo\r\nEcz8XFfU7pOPJ/jYfVJ0oliYtb31bri06JwscsVa0qRPNFxgqn04UXANcB7E\r\nVn3Y/Jf1hcU93B6yzV1kp/2ni+2Vc6IYCh3vR2iAr7Vv3EKcQyhSO5hFb299\r\nTfnsATfbI3sAPPcLFbwgVEGpmj92Z6mwi18=\r\n=Lzwg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.5f297f6.0_1663713619563_0.9696763966135178"},"_hasShrinkwrap":false},"3.3.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.3.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"0.131.0","fusion-core":"2.7.0","fusion-plugin-react-redux":"2.5.0","fusion-plugin-universal-events":"2.5.1","fusion-test-utils":"2.4.0","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.7.0","fusion-plugin-universal-events":"2.5.1"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.3.0.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.3.0","_nodeVersion":"16.13.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-sIXBI9N2CZm37gGfl4xmrpGYw18XSxW7QWW2yNuMb+fFHX3BGOAuYTvXUHCcT+3/I9THYm3IhX701gEELycX4Q==","shasum":"d561a1e945a307df8660b11c2625a369727f29b5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.3.0.tgz","fileCount":12,"unpackedSize":40729,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfI4tAGDfIIynPSAgC1h7Y2giTAP1C7OiP8St0KuppzQIhANWhS2dZatxFHX/yRQq1n0I18wUQh2X9ByHSFeu7wb+h"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPH0qACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpgrA/7BQGaJKrn+3wA4qhlFpuK8pBSJFm3tDM06Sok80u36fYEI37w\r\nNVWgZ92sXfLX2yLe0YE5DQLzJTGK0Sg0nyemtb6PMQ8Cg01N2cuSeFjICAX+\r\noz2qtgwQUiJqdW6v/41F14X2z/BErapRlxxmV4tDBQOI6Ypwj30Mc56Snc3n\r\nWrxuc4UscN6BRUSP/UzK2nIqyJ+pY393ql0zapVs7gzZDwGIZvf+RES2Aglv\r\n/JjtNLZ1ML2g2FuTmIIrxggxbUDChOsk7tFJHxokzipCfS++JV+7sNJguo49\r\ns3wjWtRN/n33ubVu98cJJVMssUq2fkwFF2/6QUufka99960+6PKuOGQOo9sy\r\notj1ybkWZx4AuBqRnWA3fUNCnlZOmOpp8yAyyXJZeztBMHFmJZwKJfvnPVPG\r\naC5liaFfl6nDKeioHPwFZF8u8QrEjmrz2ae9uyBwA32mUbfTWmAaR1waUGH2\r\nAL16ijWNbdGUT4nTg13xkwMPFJBuxOK1VcVX0dOukqQdvnV6qX2VHEl5Cy1A\r\n/JguYfC4PvKuJottludrgkYkoLqPZmQWYxBJgJZ1E/paDW+p1AQg3dJ6cMeF\r\nYzugHtvUE666Wp4/CuWbA2hbg16j/Uzpoc/IftF3NfHpHdT9z07mi+qRkMWZ\r\nAiRl+QFSuiqhdogzZrrqL8Cwi8a7DIorCqI=\r\n=wCqt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.3.0_1664908585767_0.5436412649045312"},"_hasShrinkwrap":false},"0.0.0-canary.df69099.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.df69099.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"0.131.0","fusion-core":"2.7.0","fusion-plugin-react-redux":"0.0.0-canary.df69099.0","fusion-plugin-universal-events":"0.0.0-canary.df69099.0","fusion-test-utils":"0.0.0-canary.df69099.0","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.7.0","fusion-plugin-universal-events":"0.0.0-canary.df69099.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.df69099.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.df69099.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-GVb+tNGXEP0I3GLVXJrH4bDIb0//DkZ8JpvgPa9+kv9b3a19knhS+qhMaespAh1ApFUX3bcpTYbP8100I2Aong==","shasum":"78f8ba9edbb7ef0dffac024ae2398c09f35eaf37","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.df69099.0.tgz","fileCount":12,"unpackedSize":40814,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0riUPj+6O743U9Etff+i9NuAZmWVqVNEXnj6TunjLIAiADxf3Cx+nEu9jXCQ8IkM3l8OJ3CdfQZiDZTkbxzb8+7A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRxr7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrxRAAj98Ln4SN5P5pccOVp23QL6Xt27pPKBkEdRgaPpQ4GbgLzePl\r\n70dF+mWaEsLi3BL7Zhly5IBNqrTMYCRPpy9jzRLWsxPMBSHfFisipU7C9ixm\r\nBmTMgbpV125DynXOD1u2zVVhto1uRQjpiO+yqxbFQD04o9izWwOF1CPM/ngT\r\nwoawtDN+es2au7c/Wp+IN/7kkI9vpsIz/D0WIwiOqBtFT89EhdKesayR1nQB\r\ngbERqhzndc5CUat8Pxq+6ciPu9nUAjiDc4lVg657JGN3ruIcPO3frfvtDoph\r\nHdpgkLXfq9vzzzHKlGsJ2oLYjiwLQcGBVpm5pv0PwD60LErg8TKnxRQD9zMd\r\njfgtZGYz6SkfE51sY9qCVyGV4lzrHWtgrX6oYgkKHUbpttb6Ttkp7/J6nP6z\r\nlEdi2dYOg0YI948RuYyGpsRyrykr89AQolcNOIyhi3m6rHO0o9yeolxphyOc\r\n1YyRi7robXxkNfU/hhkvKRBO9sGYZ++147lYK0kaqgyFfEfd15vKVskkal/9\r\nsWdH+lMZ78Hm8qHDQP0Uu+I6gf8Q2WlfZmvBddKjeiy1St9U0LTp6yuTXW6l\r\nh7KLyMXa6fYmFuXmsR76wK+x+ikSXpsyHGvvtvqzEWeat2/6Ts8QAIpE6RBn\r\nNTHTY6ni/gc0cWlnG+hqfztuuc6/U3+dTwo=\r\n=TGO2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.df69099.0_1665604347511_0.3995168895462331"},"_hasShrinkwrap":false},"3.3.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.3.1","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"0.131.0","fusion-core":"2.7.0","fusion-plugin-react-redux":"2.5.1","fusion-plugin-universal-events":"2.5.2","fusion-test-utils":"2.4.1","jest":"^25.1.0","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.7.0","fusion-plugin-universal-events":"2.5.2"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.3.1.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.3.1","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-/tNXohEuBHJTqPRbJeh34Ur5SK+QyK7BY8gsjaMKxIT22BckYi0pVtn15Oj1JFlgEZIaL4kNDmwdE1WPqsIxJw==","shasum":"bd84ed8207903a547f56007b4b32b79636cdadff","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.3.1.tgz","fileCount":12,"unpackedSize":40729,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEXfy+8/OQUtpBoVskZQOIx8k4d7uilCB6V2WZgZ7I2JAiAubYr232FEoxOL8EvpN6P0htUSklECx3CmCzPRlWzddg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSbfmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0SA//eWoYW6l0hVZv0o1hoS1metTxKzYqEm8/26yDBXl0RLe9L8bx\r\nyxp+HpQvmzI+1FPHOrzdsrJAd+Qs9HWwsWAkbvNTbivupumpDyBVFLIbKjNQ\r\nkvjLsONZWyhwNyjcGYIgtnl7gZlfopSf/ecvscqLRK35JG/3Nl9zrnaVks5J\r\n5kLv96h7I4abNa87OI3Wr9f9f+3h9+8Y/D9p+3uI38PouBA/Ulgq/vcMcpGk\r\njl7bTV2v1qpI4KOIVcTsUopZlsmJzplExcrRvgJfCWrCqj+86na3BsVzJ4wD\r\nikgxqFwV4VYcu+maeBuaEN18OQGo0B1QevtKIGFXLnLZWF8bRlVOtv5O7Z3X\r\nWyYOh/5p/mU4ItR2sDpJkLstsNLNAwngaAzo55WHih1We1jXf9So5qojIZP0\r\nO71jjSrywLRF7a/VjePEjlY0VmvSAcvOpCTK+J2zO5e5KbltPelK5l8Katyk\r\n6cQENpzAiltLyM/g+AkHLKNuBz5TosrXGjuclhnbw6Aoy4WgKAFUCrV8KozV\r\ntvgZV7oJmWJe4x0ALge8rEgP/sc5FoUd2bDZvgFupa2BnfWEtDNoNxzEhQUl\r\nHPILv5MFrRFh71jaR8CSFxnu00lCAAknQNkCIaKVRy/Sh6JSZ++qoPYG4z+4\r\nG2OsFUz2/6xzxKuZyj/4lhf/Zr1Y4OoI7eE=\r\n=FsRZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.3.1_1665775589970_0.6109330256624463"},"_hasShrinkwrap":false},"0.0.0-canary.7982e16.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7982e16.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.7982e16.0","fusion-plugin-react-redux":"0.0.0-canary.7982e16.0","fusion-plugin-universal-events":"0.0.0-canary.7982e16.0","fusion-test-utils":"0.0.0-canary.7982e16.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.7982e16.0","fusion-plugin-universal-events":"0.0.0-canary.7982e16.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7982e16.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7982e16.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-O6pPiH8AWoTsZfNf/JH+iubMQy+QD/CeSModGRnA0d0IkAKoyBD2ew0GIet+cpenEToNh5t7nz/uywIqjZ4p4A==","shasum":"0092005d5a2576423a990786b6492dd86b74a106","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7982e16.0.tgz","fileCount":12,"unpackedSize":40889,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9T11QIHiFszSR6NwQYlcf/lEfma3+DNHwfD2ezu3VwwIgM8cb9t+0mwNJjgIXbQ3LZ/61ZJKSu0cfFWqWd2fdi1U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYwcPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmryrQ/7BdFh+3irh+pmwcIaOIY8bSlB6fdo8OUiUUZfpyCPxJriUs/r\r\nIr9ViFsHMWAEg/1I1lptFuTpsz8hcQsPjYtyzr5ZtQ8Iqu0evYq8MGo59vfm\r\n/XOHZ/xhUwdLHqFGO6+PDbbH7jpt+u111d+7ewa8azPhqa0zLgTsPYzfh1FJ\r\n8Q7QYfHAxKH5PZEuF5DuqF0qfMVRierfoCxNKXfuVZAVKXJoPHopJvJimejl\r\n6cPFqUCxs8AUsbPKrL0aI/tnsAlnrGG7yQ/mlslJwXziV7HXDjN43UadQtv0\r\n0LilvibwaivxEXolA9ZyRrchIdebdHAleyFzMmfuAOhPPrFAeAiLxYIK9rvT\r\n1shNJ0qAXgCXiuM0w4OVL9rGxWKWh4gHHfcHdON7Q5ADd7o0J298vLhGFV6y\r\n/rkQkcjNOf3Ib2jig7oylQlR+MR1N9K727Uv9iqAJvcrHg/epM4/LH1ATfsr\r\nJMF00iazM/Sk8/4jEiy/e64gQ8+MZlVZL5B3w3OKcqFp2R917KJfp5llnfTV\r\nnZUL7NhSPOYWsesjiWVsN3N9v424tW3A4RbN02I5Xw+zn6ftYJjZsQyPVM6/\r\nV7vlWXoO9MJXJChfnat/ULXPqHDWEIzyDx2NZUQddoKLrcYmoCFdmeeVubek\r\nRoLWQi+2GQ2J/RjuubQKyvtPDhfXw54zbL8=\r\n=G/f7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7982e16.0_1667434254969_0.3144362972011965"},"_hasShrinkwrap":false},"3.3.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.3.2","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","create-universal-package":"^4.1.2","flow-bin":"0.131.0","fusion-core":"2.7.1","fusion-plugin-react-redux":"2.5.2","fusion-plugin-universal-events":"2.5.3","fusion-test-utils":"2.4.2","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.7.1","fusion-plugin-universal-events":"2.5.3"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","flow":"flow","lint":"yarn g:lint","prepack":"cup-build --force-flow","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.3.2.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.3.2","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-weAAiiUxxiwRRKSkfePmttMB9A3Kx/XRCIM3Rh+raB82NhlJNz8c+GvXt/vQ36T7sHregOMcgmNbx1RzN4UQjw==","shasum":"642e393072ed0096d216ea47f828360eb19953ef","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.3.2.tgz","fileCount":12,"unpackedSize":40770,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDc+qhFjWBZqO9XMdG0dVkTxJRsx7aeTvp68tNr/fr2pQIhAKFRqM6b4GAmY1KXM/XJKtpxpgjNhrn/CkGkQDpmCC4X"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZZxzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZwA/9G9jcvKegRLhKQaQrvY6kVP8cAVHCR5DIhFCzHihBWx7D+2As\r\nffOUxnSfXHh6PWZA3pRkqIDljSf8EmLmZzChqZf/E6uAcAVMvEB8vBqYbexN\r\nKoTZUnoTnW7FOUg89+RZfnVXEDAux6C2qTJicRELewzr5jv1PlHf9gSkFAzj\r\nfVXusYUiyRYpsbeqn889kfiG8Y+gc5rcRXmslfZxTCOQRgDkHa707s5EAam0\r\nDeN21x9HBa7THRSeVwz45UEKyvp/B6+MFGuRHRxBttx0ZgIrZ77+nySRKg/C\r\nxrtieS3UzhfsFm528r6wNdV5xlyxDyhFToJQ6qU5N72R0YahsNNgjWPkwdwq\r\nyU8FPPVswrSqgA7YiW2nsh/kscj8U/7dUQBgebiLNGWxSv0V6DX4ZEQ9wNzI\r\nihKQvip1oV6A5+gcy/03BPjYxVaJJzCg6ju8UP+56/lMDJvSOE2FRGXrr1y+\r\n7QQhlVu7OhX2PTtlt3fX6UE5eYrYK+FIhVWXt8945OsWhOlI7Rl4u1nDmqZS\r\nbynxKD3KPKV1gvuQTWCfYu5QefWRgOVMVhap1efTF89fxdK1SeAP9rlwqrky\r\n9I6BRjp7G1aDZIpp3lurt9qYBa5hn7dtU34UnhJqS4QHI1DTp23ksuDjbOpz\r\nvgqtt9aGeQcDoQHyEzz5HULlQsiO4O7nhxw=\r\n=8rXg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.3.2_1667603571608_0.27586001323105647"},"_hasShrinkwrap":false},"0.0.0-canary.af83905.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.af83905.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.af83905.0","fusion-plugin-react-redux":"0.0.0-canary.af83905.0","fusion-plugin-universal-events":"0.0.0-canary.af83905.0","fusion-test-utils":"0.0.0-canary.af83905.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.8.4"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.af83905.0","fusion-plugin-universal-events":"0.0.0-canary.af83905.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.af83905.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.af83905.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Ss3HG3ofaH831TYfiY2DUGdEx9e9xeL7g9F0KxGQTwOKQhP8V0tnAmxN9oz/wCVOzMPWVepZ5WvxQzaG1JQlwg==","shasum":"7779538b037106ec8cefe3bb0403f8d95a062eb1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.af83905.0.tgz","fileCount":24,"unpackedSize":138938,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHW8rKjHTCohTR3xFYuFf1h/6285NgtgYsPnFH8nGydjAiBY0qvqX1gVnzgbY2oGMScJUNKJGiHDNiqAnBFuzZlwAg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh/8lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrzpg/9EkEZ8j+b07/+tZ2yK9tosQ7z1HFsncZTqSTWhAIsWXU8DQY2\r\nQXtJ6jUL/8gVLzAOavvV/BrWBuT4b6b9/8N/HytiGSQPUb5XDa0pNHVq+C9k\r\n4pI8afDJjeXXTr+/Y8fx2uCtlZRRJWNx74CgegwOH/9lvjzSeW/CqSexv1gV\r\nd6g2ltUFvnO6RgY4I067Sb4ALS5SXPNvlJAOc9PN5bXTbavU+88E/BnzWBuy\r\nHjLQ+XMPcZ3rBLxJLNZEypkO6Z+BsFZNMMrDI9lTdydVPwUXcA/74EBLZXPD\r\nUhpRl9+KcxZDpxHKyqmdczPWmz6UgycX3znR53NSKqMOSKXs9a2CmX4V6bVH\r\neD3f1V0VylWTJ8775pulcQNS6a4vTN3SF7YGWzARUV9QBQNAj/rwss8P5Ih9\r\nfsWpIJ62LKbi4CzwJs9sOyNNzEujZmpWvV6jylV9dpzuGXhA6N7eg7qOdjhJ\r\nHb0Ixs/LXoe2pU1NqP8zN9YdDk5rdjZwoXz82XAEYOBw0CCBw22CRPvkdcIl\r\ncW+rJAdulE8u2wdzlPhc0msVszOHR7kMR6OGmtKBV9ufEIwNNNbbGSwSJeRO\r\nOHQ+J8XYKTdi4vChMeMLCKFSf08XaHC2/P+iNev76ivTked5cF6+rbYq1ln7\r\nqP8RbFb7pK6HZ4WweeBcQDBh8pVZhwy8VIw=\r\n=BB0Y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.af83905.0_1669857061251_0.3139761065547788"},"_hasShrinkwrap":false},"3.4.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.4.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"2.8.0","fusion-plugin-react-redux":"2.6.0","fusion-plugin-universal-events":"2.6.0","fusion-test-utils":"2.5.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.8.0","fusion-plugin-universal-events":"2.6.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.4.0.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.4.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-MkSWZbWrnaiH4hUfQDqsAeLypw1MhD+GSeUT4ORahfcCDneYOPdfRjGsdTQFeECE4Bif6YY6riLQZ8UqdkzKcw==","shasum":"30145ae1a3af3d6fee934b05ee1dce57875e1df1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.4.0.tgz","fileCount":24,"unpackedSize":138803,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPc8QqzgYAFLkTR1ZFcNHE0Z6I0Sxgo+D91U6f3bUVrAIhAIRK3W13gImGiC08RCsEdpAnp7OuX5Y5PvIn9cPYXVhl"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjlYDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqX/g//XEz8fmOsl7zFZ4vJwxEpbSNnhIxiQGJDi60kFE71s0dnoRQt\r\n3PK6cXIn4FTLA4osRZ3+WRgkWAsf2eC8Ou8OKQPfRbTjTis2nHxC/ROniNwg\r\n8UrU0C5+cew/7MI3F9Y8rqtixJ20+ZmGSKzapV3QdaZ+8nqlyJCmR9Vgc2zl\r\n0Ah/HtywOqBKhUXM9+wFSUG0/7oADTkegLmJkAoY7tJJioNnTFj83ez5DBHw\r\nUXMhUHLjoLzhTDVte8XMpTp+7UE28EpJ547VQ2c78DPcQyODU7TQuniIB6zm\r\n5w7fN1VG3dksxEeRdAxL7tyZOiglMpX2TQAT1EMaxyxgwI5KlbD7eDBMqUrQ\r\nsyYc7NRAfoFtWT4JVLF3Pi3GQZfLokZwaNWTd2YV7ZatZj6GVmJZW1/PMrBf\r\nNwzcEywB5F1WtQRcPapu2bmorqSxysqnc0S8zCxO5ixUUHYGg0Gu/5RGxgp9\r\nd0ymmG87qb9czYS/RpdRo/ub9XT5Iu5nJMCprvodYSsOSs6Q1LyM/YQJnLP0\r\nElg6b8LdJqvXcpHE721b9B1myC+cEtYPvqbugP4WzS2Pe5tirQH5kFvPcRwu\r\nF6s19kyNix2zF99oIeefSR9PCf+U/qZGeWxgSvGslaGkekbRpHTviO9sKnJq\r\ngqMif5Jo+PxssP0c56Uwsh6W2JAjeHbfhUE=\r\n=er/i\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.4.0_1670272514886_0.36565982043189305"},"_hasShrinkwrap":false},"0.0.0-canary.cc2fb77.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.cc2fb77.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.cc2fb77.0","fusion-plugin-react-redux":"0.0.0-canary.cc2fb77.0","fusion-plugin-universal-events":"0.0.0-canary.cc2fb77.0","fusion-test-utils":"0.0.0-canary.cc2fb77.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.cc2fb77.0","fusion-plugin-universal-events":"0.0.0-canary.cc2fb77.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.cc2fb77.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.cc2fb77.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-jrOraiku6EqiIVToWC2tnj1WlAr4hzkpDIf4qEPfQ5oxvqIdTVg0+o+n1R29dGxzYUDRnMVFSRAbjraQyaQyCw==","shasum":"3ac08fccb69e06ca58c2c667f376cda6e139fc58","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.cc2fb77.0.tgz","fileCount":24,"unpackedSize":138922,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIETcaIdfE/LxygE5+IOqIKwrH5slJSkvES4Z9UKEcDJUAiEA7xOyIZGfO6hWLwWjyUG7rXjiq3lrP2U7Alfhqlv0CJc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjqVHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkXQ/8CulQRwpeflgAUnMNqyQFhdExpTtqj3cuGgwX5cvJzBg3ivgm\r\nvU0Rw4kPBuyshnr91Ih/BYQqro/m6oW0CqdrrOm8ikLW8hSZKIYxBLeFImBv\r\nkXDh8kCBJjoQo3gNM2zq6GYl7xPOc1uGqF3E5zAcMeBzssdRDQ+29hRMiL9W\r\niMFis5XM0DzQftaBDRF/DGG0Cob8HzycJaCmzwCj47dAzlqpwh62rcRGs8ez\r\nC5IHaAsgOS9UhnEX5rRXCUu3yhlmN9+dgnooTLs8TeP7So8tKHxWI4nuEY3i\r\nTHAA5o0OdXyxMyWrCaVcd+E7LlRzFsB58xLAah4IcoBCMiekUWuqGKA8qblG\r\noW+SyxP1/crezED1JBvwOXCy6l4oGi/EM2rY2grGqAiSzRZBcugqF4bhWR8c\r\n+zBKI5Hec7eCQqYXTfcadI/uGpO94WIVxGL+GBtXV7h0nVgj7DShVdXd5GXz\r\ndoExTGonJsi3x2/Rru3JyK0p7McTUHumLxFosPtuckNsiWgfSgwCsC1/Kt9G\r\nHVLBRFcGgHESQ1vSslFZEmqCEMzNiifUM1gjWDFfrbvT3S/iuJNwu0tAmfWm\r\n9C2hVQMaoDqZZxT6dwZGZCK4vtCEQ3e4MCmnnFCMJ5TR2nIeIETtvbMiJGg6\r\nKA0d4lWWTjAvxcn9IXnTftBB3LABNaYkqw8=\r\n=YR/q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.cc2fb77.0_1670292807535_0.09027192851983235"},"_hasShrinkwrap":false},"0.0.0-canary.d18411f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.d18411f.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.d18411f.0","fusion-plugin-react-redux":"0.0.0-canary.d18411f.0","fusion-plugin-universal-events":"0.0.0-canary.d18411f.0","fusion-test-utils":"0.0.0-canary.d18411f.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.d18411f.0","fusion-plugin-universal-events":"0.0.0-canary.d18411f.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d18411f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.d18411f.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-OzVIjMe6t/ewFqa9NMQkYGxD5fSLlFrtfGNwX4dIxrsxMMnPJHMDvfAodeC901n1Gm5N6Kxf+m2cvyDDhB1B3Q==","shasum":"2a81ba2410b4a15fb1ce02babd52cad158565442","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.d18411f.0.tgz","fileCount":24,"unpackedSize":138922,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHEjUXqcDH5jBDMqnwg/wTPhOY56juayo4wagcy0KEleAiBUpkIouTWv2ZHazZSNPKMxyVpk4/L5XRqagNQK74c+GA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjsb6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIzxAAoVo/ndh2xlpr0/PwwV/iRwygCv/q76YY/rqP1Ec+OWmYN9WE\r\nieguSeCIoyLlQc66eprIOEjnuurWuwtn7SGL43QMb3bkY5nachdwYIO/2eqT\r\nE8s1+NF+dJiZQ5D9wcv2HnmvUV3g5zRSEnxLhVo4Xo4jl6EWPF8z5cjiVwjt\r\nXRGblQuEQQ0kVe9Q6E8bLrcT1uTictRKjqbwXg8Of7IfuG5dzEJFtwzmL2Am\r\n/nCvZuS8KCHypp6brOM/23lAwY8ZuN4knLPEPjebhjwvxt5bao+GmfVJlNZ5\r\nizlnn6SiIWKdjCc4vNccNX+NkYkgscdgAIGs2Sjp6GJfaThhIHmoVcYcQMyP\r\nXpswhFEFFVvCKOmB+w+2VNw3hyEuYeY1HwrpdIgPOrbu7SGYkj6itb0xXrZe\r\nkUJSa7hEymqCOhaR4ofkYiSe+Ux8NAHHMR4GJ5flwxHjAvAZJOVwIBGLgqBf\r\n0v7z7VYhHZlV9VERacRVV9rYRTjVeWL3a77RtnWhoRuxiczhRlYiCDofwT4d\r\nrQUvuxJK5r8Qeoj3i902ZIsLKvnzVuHAk7GlREOtJxKSaNGCWJ/AmHjaLbtE\r\nDVYX5cx5j6sH9bUBT8MKy8GNv5XI44NtLLzhVM0GuvnvZN1YcCiK/zi1MRsC\r\ngWjawoq0dP/XgJ56UKV6kk9YVaR/iFE1mQY=\r\n=koD5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.d18411f.0_1670301434697_0.5558890041069715"},"_hasShrinkwrap":false},"0.0.0-canary.7f1cb1f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.7f1cb1f.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.7f1cb1f.0","fusion-plugin-react-redux":"0.0.0-canary.7f1cb1f.0","fusion-plugin-universal-events":"0.0.0-canary.7f1cb1f.0","fusion-test-utils":"0.0.0-canary.7f1cb1f.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.7f1cb1f.0","fusion-plugin-universal-events":"0.0.0-canary.7f1cb1f.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7f1cb1f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.7f1cb1f.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-9XiDtQEP/7mkYoMlBNC7OAX82ZvmGb+TY4vrvWnUcmuTl1zKkGfVzVJ4Pj4phMNj6hffaZYSpYkDCvZ4rMAAAA==","shasum":"cda1f5390e5c409c28e06ea762910cd7df20ec95","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.7f1cb1f.0.tgz","fileCount":24,"unpackedSize":138922,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB3Pxx2y+pQnqUzLkYllGCIY6LRxLYea0ISmJL2psJvJAiEAm82M587MwnM2HRVPMXFKLqA/41+4EFKYETEc3zCE+7Y="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjtvxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmooAw//fAcW/cSlvHhCyjXqJLLkBxTtRE6NxA05m8Lp1aAO7rwGC82G\r\n6eUUyVN54ZMHLDhnewKJnq1abmByIJwcUjHtICu0N+8Zc5PVA6C1aPN1lUm2\r\nnfZr2HmsKbd/PHL6HBvZbkfl+azptr8Krze4HyhVY46ol7h7stMUK2zBWKT4\r\nBGa+eOfenhgFgBpvZBtd9vXCqF/onG6qslPH4TFitD1qacHo7/AzwPFKGqcQ\r\nXhVE24oDVOZ63Y2C9elIBe+BvryQfizu62Rj2k/qmW01AptLYzETNsrYngFI\r\nHm264hwjBDfqElWRFfs8ko8BQO93VwOmkF6w0rgl+KNCZwqqtf6vxb9V1k6F\r\nuF0lOuNvtlxpqYBsyRKQ+5ge8QQsIK3beXntG3myHX6rv/YbbW5a6GMMYIk7\r\nHaEsKMRbSJFvbTmH9FDhNRN8nOiknKNaPGP5z22hqD6t9ne0X/kdQdljiPh5\r\nA19NcWepalWQyeaMO3xXw5ePmJcFSuGEuUjbZy99H4oVB+hKBApwL35HidAT\r\nRKUhqit02cjN3ODZ5kF6chC7fymHXEiaP0TZ0IKdBqalfZ+ytXi8vbyPLPf5\r\nS8f7arbVV3y1QySXA/rzb3lI6Fmn2T0P7aHSHjVRSM4Y2CacTyhnRkXCLhEg\r\nlUBjnJtWm6sbspGYBEY1mi5KSNO6ico2Yf4=\r\n=AO58\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.7f1cb1f.0_1670306801057_0.8881420922293182"},"_hasShrinkwrap":false},"3.4.1":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.4.1","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"2.8.1","fusion-plugin-react-redux":"2.6.1","fusion-plugin-universal-events":"2.6.1","fusion-test-utils":"2.5.1","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.8.1","fusion-plugin-universal-events":"2.6.1"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.4.1.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.4.1","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-aQHLdzzCs6ZnDRSuqciHQXJf23eVD2Z75x8wpEopQleOT0O80Whd/5eWPLpt2PE9QDXRXCRj9qLEkY6PnRQB1g==","shasum":"315db0bd4706fc3245c73bad330699be94123554","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.4.1.tgz","fileCount":24,"unpackedSize":138803,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID1XPhIXLdFu+aCgXIEB+f0N98NMGjM+cajqmjSsfQU6AiEApy15Vw0XmNcFWjQ70FXUvB/1/WPUHKV0+LOBayVtFBw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjj/LaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqylA//VRgVF3h7uCN157FJnSFoY1m4Zn+FKNKcSG1N/DjAXjQYYa6y\r\nffUmeg0qu0zJ3lQz2QL085oke0WZwD2LBgN1EmDFlL8/2KYsyIN9xLwem3+2\r\nF0rqToMKEy5YXx+bbCqsE0f01e8gE/JPgETNQSP7dl6T6kisHyVUc/43A/VG\r\nzlbKC3MmGgM0Wz/k5vBTT4hjoGjz9TuS66s1KftwpqLNViLkY8Zs3UV5SXLK\r\nG7lceK4cMMwzAi1K41sJcYxR+kr0TxZPtP5UXvD8X5Jwjt1LRTwks9EPVoVs\r\nkx5PQEvwDahi8sOH0jQ+Y+HUea5cY8WZ0ttaGy+JSFji7YCuBh3N1qttWgBK\r\nRQzfU5kJmU+mNayOpQFOBNmtIlFe3Oy8mDoYP0QhICNzzbY2XIHKGbTaoBPl\r\ne4F23V8/hvvG7fhpE7cUCPWJaAbjDlfKDDLW5R3nQS9dVKPzfVCzd02os+H7\r\nFemKmEPOUCCPpyv0S60Wm7azCY/Uk0irGSPFVYoZhrJ8by3m0MnQ8KdbJbYP\r\nz8I7W6y4SOJLq3rofNbqCbUSCM73TpVOrjZpFp3Gy/Mgm70/FNeJ4D5/1Fsh\r\nbGctNekwg+/u5rzgd179sASeNGC9EUHjJEr6/9WtTNlsA6d19eXY0KiCEVgu\r\n8Vd3gUZ7KjXuR903pmoaW9OZ7snoBRxBWNs=\r\n=p9V1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.4.1_1670378201836_0.8801220394992488"},"_hasShrinkwrap":false},"0.0.0-canary.1ea3b4c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1ea3b4c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.1ea3b4c.0","fusion-plugin-react-redux":"0.0.0-canary.1ea3b4c.0","fusion-plugin-universal-events":"0.0.0-canary.1ea3b4c.0","fusion-test-utils":"0.0.0-canary.1ea3b4c.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.1ea3b4c.0","fusion-plugin-universal-events":"0.0.0-canary.1ea3b4c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1ea3b4c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1ea3b4c.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-6F9CFoseUruTYweYbPcYkCbRavt4GH8iItIGUexkp5Xh+0a0CRrHixJUnIOVE/oWZjw50bqcE4tYKweXZaxFNg==","shasum":"4d1d34c3f58026602c8f526cbb9ab71fbc7e5e9e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1ea3b4c.0.tgz","fileCount":24,"unpackedSize":138922,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFgSKqOCYGpIchnZm6XV5aBh7O3zMdk79HTbWfFrQ4MRAiEAgnhgdPjf5mIf7S7TtRHUr9KhqoRQslPcvtYrWzk8oVg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkPgsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFnhAAoJXNqJQzrqxSA0xZZcXhHjYDh9Mru2N7HbNwUr/NxF5bvJe2\r\nKbaHAWursL5s4yufbcUZAtJfmunHXs2kkd7HVi5i9SbtUGgO9w1zE2hZSS6/\r\n4LRcnlZztJqZTvetgbkYLJA3ujSCauaZWxWpcgrqifsYrC7/J94ghts8YHlJ\r\njMz+gXcBMOqYYVB8IhUjSg3hee6lC3lTEb9QAVDPDWMylETCU9wc+sEpLEhD\r\n5BnzxXpe0Mbem7fbqhwLjS5HNrZC+EhSIvK4cZfQQWgNDbRKe5xaZIznQFHz\r\nra9k47Wf2klTdyuHq1+e7yK92acTV2kCBBmLQBr+qfpNTSv4ls3A6YNPbxL4\r\nZcqDERiS6jGastldSCWbOYanUxRKZT0Nt5I8E3glsKPEVgByj+bQXQHs4j+e\r\nX1ufhKmqBxdq7hKHcQkrO1eJ7EuI7r3aVpB+RktFvVwu08W5YKCMsN1uu6qR\r\nTaB5zi7vgIFFBAMab7dan2zsV2XXfOeQUUY4CIS74zsZommqPpuJ8xfDYrW3\r\nTWs3KZ5FLInr8KB9bnUWSg3ZPOozWOrLRZ8LBK7MRl/B8fgADuPFIb7xd/+/\r\nBmGrFcOaruV+98hGnIlNPdDtuR6tp5x9rSOZBNlNbMd4Fe8jeDZlhPkWKGAL\r\nVjqpgSVDyIQBvb1T2CLUSXASfVLr1vZLIRM=\r\n=zkdH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1ea3b4c.0_1670445099984_0.10662301114610617"},"_hasShrinkwrap":false},"3.4.2":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.4.2","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"2.8.2","fusion-plugin-react-redux":"2.6.2","fusion-plugin-universal-events":"2.6.2","fusion-test-utils":"2.5.2","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.8.2","fusion-plugin-universal-events":"2.6.2"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.4.2.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.4.2","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-VJNSExAJkt6ymWPZjXpOCc2O8hKcCdOI9Kjyorn41rUoxtcFEGLyfHBD8NLZNpDKkJxUj/RUxll6grlhZPSyxA==","shasum":"b37a9a18b7c9e7f8aed39190d0401330722d1a42","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.4.2.tgz","fileCount":24,"unpackedSize":138803,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHkLxKIzlemKlWWgkbzkq8GF2RuRasS4rCAKJ98ojwZkAiB3DFAxftL1mF6PgLMs1/MFvsNWcUp1LGTOA8JvPVi5FA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkTREACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpaNQ/+OdWUiWa8TaauGitWBQFx1U+XBwXFKG3bSRh5kfwclW9JyUe9\r\nCYggekl3zdliUeV7FOJmB/+YTi3e5SyYekrWOqwmtFuKL+FHsTOXR/ZuRpqm\r\nns0qix4uLCE7wS62Iv3mNp0tOf/Yodv4/CS39R3yy4SfNN2LnvVIjcYMeFsP\r\nYMX3XTzUK70DPU9JHSCO7fX2/V/J2aGwNTFqJLUpFhKxZ9XC2ntIKpLGLpxB\r\n+GulMi91ksKtx275LxCT35uurFOP9vqc2I3iGtZ6yicZ82tvPm3MxMXk4Eq6\r\n1vWOhqllFMhXMdy+nMtAq6sEHywVXgzsl5y0Y18G2j2+RJFuxDnCjO5Jv+/1\r\nhX/aoe29Z/EVdoqFxCAmqQINxZEfi5w8OxJ85gHCiFQUg+zC3342H9xehKRV\r\nvSG5sbVRPGp4AfDKnPdoIH4cf/kHCXdvE9FUwG+gns1ILHy0KFCUrBk5mLn+\r\n1pYZEqo6OqZMH/+m4hzdLc2J+f6ICPROOnXUegXTccLFtrQvBAtHjsO9H4k1\r\nAxzyccGeTda3aEl33fW95qelqeCDEgM7jVdx1FB7xmuBbliCo+e66URSVPMs\r\nU2noEpwkq5MAxuUIjPdnb1eis882K/1Npmb/xki61elw+IbW5vjGnErDCnKi\r\nWqGGvB207oexAd3Az3pQ/YdwxQFuFMc251Y=\r\n=SmH9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.4.2_1670460484132_0.2383860394984676"},"_hasShrinkwrap":false},"3.4.3":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.4.3","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"2.8.2","fusion-plugin-react-redux":"2.6.2","fusion-plugin-universal-events":"2.6.3","fusion-test-utils":"2.5.2","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.8.2","fusion-plugin-universal-events":"2.6.3"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.4.3.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.4.3","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-VVu5cd9Oag0zKSvGgb53i8oqWvELC+asCla9Usk54si4+95LWN/jJhPEN58oSwcM0X5IQWQFXF8bt/ue0K/L/Q==","shasum":"dfbbfbcbf495731931d65a3a073cb948bcd0c5a0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.4.3.tgz","fileCount":24,"unpackedSize":138803,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBgME5uoVSuwAT5e5fMyPxLXM6Tum3qqN+kPDGkgjcvwIgLxQoyAnL71lxZxorfJStFSb5Sb/oSdkc91Rx4tZ4ygk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjk+RAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoprw/+P8gviI2Y9nauJ6tphi1d7KmmZJrD8Jlto9rc5vTIgKztapDc\r\nyBpSyTkWhSK/S7qWnyvznSo6/PDvykjGgNzDTB5/YeZU/GfdDych6w33Uvyr\r\n91Bwi7Jqm1vsy06IDfgBvYTX/0u1HfUIndCJmD5mAbFecMp/ZJahip8qPcQH\r\nvsHvhmqJTxl30SWSwXHG2JIIJk2EEVGiD5V3MEivAzbDJSojv/QM39MkMIOC\r\nvuc2mgBLCKKsStIxI9crnVcH2pkBRKYykGEQpYqOy+hDpK8fMMM9giUIagD9\r\nVFCF/nqclCUuAqKO6BganQex1L2Pbp0cFEt7Ovqh0T6bEgECYwenC+rnNxTy\r\nRaAJdFrHLpI0XLSM3hD8hwCmxAgdF59PG7DOz2vPEUP82uoCirEK09j+YYoe\r\nw7xY5NMg7rRfNJsKw3Wa4XuC43/UB5oi5oDhZNBfy0G4ISHQkiF53FrHkmId\r\nr7YiT4GRzjq0OdwR6/JJ/DkD8IaK4a/kcMFORZZ5YlWbWOdC2Edpj7w170by\r\n4UblDssuRcBiAe5n95VE8utij3lGM71nsRfbo6cTRg3ij1iS8vCtXcTipO7C\r\n5EjeFUawpPsPvEbEovEBlNLW3P++KO2sPmz3TC1k3DNsX93xZltZB7Mftufg\r\nh3TcqqHUYNiKnV5hfCnZ+ysdIwjtzoJOp1M=\r\n=DVQp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.4.3_1670636608756_0.8729353489519323"},"_hasShrinkwrap":false},"0.0.0-canary.1d6a860.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1d6a860.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.15.0","@babel/plugin-transform-flow-strip-types":"^7.14.5","@babel/preset-env":"^7.15.0","@babel/preset-typescript":"^7.15.0","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"2.8.2","fusion-plugin-react-redux":"2.6.2","fusion-plugin-universal-events":"0.0.0-canary.1d6a860.0","fusion-test-utils":"2.5.2","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.8.2","fusion-plugin-universal-events":"0.0.0-canary.1d6a860.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1d6a860.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1d6a860.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-mVHLhhT9VkApa3SXX7gW7d/gPsN+lC5IdzSHlMAmhvUQoT7e/DM7P3+0nicvcXp8DU1jTez8ixilFFbkqWHlog==","shasum":"79f7283f53a8a3f42855442507fad7dc676c0ea5","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1d6a860.0.tgz","fileCount":24,"unpackedSize":138854,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAxOFBjiRq0b+KHmYCASCb4iWM0zY/BsD0vmNekT7XfyAiBIAXSJlxLv1kSjCvgYEjE8hBlJF29LUQ2Hyq0OhEDjjQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl3IKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPEQ//USAenCxKRVsl8pFgyYL2HOYN9i43CtKFZ+FgFdieGA6h/UXr\r\nZPOSQ+WfCdYLaNz/ZV5TP/NU2GltxcdfEX5XV2Bg9KPIkjSR8WqlDsA9pBtr\r\nWeCxLSHDzaT5nyVZbyZ7XXHnTF5SqUvH71safH0WT8U2UIk0tGJwgra+l4ya\r\nGCzo5oKKxA68+M3TqUKu2mB8G0htO38ifTjSnSzcjGcef5JXkr87wmZUQHdI\r\nZ3ywWUm/XfbujqlXDvfcpWUOgMWuNZ0EodLiNiabtUkPz02zcRGbTUaM6Qw/\r\nUlSO3gLI+wgz54mRF9xMCpfpzclf30HRUFBmmM9uJCIc2TC2LWhDKiuzoglT\r\nIAdblFQGlK/UNwiUHKT9u3gsi7RQYZujfEbD2byV4G/fP0cWzH1FLBEQ4rLh\r\nFP4CCYPWsn2lLnEb9Sij2am7+LAmh05LdgjOMUk8+yQ0JOGPCF9u0VogDedV\r\nf2ZBu/W3gfjeaPrCteUw92TapKFYI2VUCQ4v9gxFni1yBeh/8goEtd9P/0VL\r\nMQ18m3NYCE3HHDcKVhjzvMA7dIoy/m9kYUCReNRNYemXZAz/Yefd1XVI0fwi\r\ng+sse53dvXILBTgDGnUbne3lIRU3zLqi2dChDCot1fyO4imfewjF/4b1R5xE\r\nCQJ3fhx2HTUUh4u7jYxB8YPy6T15NX9In10=\r\n=t68j\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1d6a860.0_1670869513953_0.5793955510489992"},"_hasShrinkwrap":false},"0.0.0-canary.f1ab874.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.f1ab874.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-flow-strip-types":"^7.19.0","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.f1ab874.0","fusion-plugin-react-redux":"0.0.0-canary.f1ab874.0","fusion-plugin-universal-events":"0.0.0-canary.f1ab874.0","fusion-test-utils":"0.0.0-canary.f1ab874.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.f1ab874.0","fusion-plugin-universal-events":"0.0.0-canary.f1ab874.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f1ab874.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.f1ab874.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-grN3U4vFmDG4Dp150K6tcfHHligGZjdnt2JloRIcUprtazAXDx+rszqMh0dR33wmBXaq8T0OlgFyjdDd83EWTQ==","shasum":"bb8626cb45959d4591ca631ee443b09b03ae2c20","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.f1ab874.0.tgz","fileCount":24,"unpackedSize":138922,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDslYPK1WgvLJatGdQ+NSq7G3sk2slLfoJD3TxqWTo2OQIhAK4i3ATJb6ma4j2YvlPHMK6cWngvOa5CoXS9iYztH4Nh"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl4ofACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqpzg/+NuDEqgRaehbi0UP6A1Rj7Jxshwas7/S2VY6ctYhD0/l0mHvK\r\nFKsPxwTVz7urn0Fb3ds68wLd1YQfq1WzU82Dgx+azXBdnY0r5pAHuab9EoGJ\r\nLPInZQrLpRjzcg3VxDeNYda3A0pz58eq3hwECNf8XjTzNjuIiU5KLhOIGzBL\r\nVXMVu/FLyvzKQEMuGPeWCPvNfFm8MwHOZly5a4vnefJ4KmGbPLsbfxrHGR9O\r\nrea2CkxcGAQZtlTOsc+W+3lsgNR0stBnXOcewUmkTVGYe3UNpMbjTo2qa2Cs\r\nKysaN7dvoa7HIkUkUYWPFA1GUe9gyctrd62GSYeCqY20FTb0wMPn27wUuZ3I\r\nqVwT5C2r1+jqi8pPjiXNa+d4Jb6SbKn/twZhK3Sa1KgPap2NYs88B08ZYj3t\r\nF/8F9Pmo9CQxhM6wCNqx57RWZOCzwkqWSeaZh1nhfMkw1uZnMsXDh4ixDw60\r\na73aM39yQqVpbjfFfbHTgta6c3HxPopYD+7Iu6y1kt+Nol9gulNJWRB05ppS\r\nr8fQPVVHSwS/N/7IDD129dtAggoFaLQaIyyS1niXcsRLJEA5EX618njGWlgY\r\nDXlswdwPA59KBfKmhXSOK61V8SbqYt756A07CIxOKQAOUERBCPCnHKzSMWVw\r\nNZYhpKejyWftPfIH24KpOAuIFxluqHb7nPQ=\r\n=JA4z\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.f1ab874.0_1670875679219_0.9913691614199702"},"_hasShrinkwrap":false},"3.4.4":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.4.4","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-flow-strip-types":"^7.19.0","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"2.8.3","fusion-plugin-react-redux":"2.6.3","fusion-plugin-universal-events":"2.6.4","fusion-test-utils":"2.5.3","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.8.3","fusion-plugin-universal-events":"2.6.4"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.4.4.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.4.4","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-dN6cjxWfuCtp4Z+AFclUJmxwzWKLjV9lCt8t7YzfI1+6BOTAl9Oj2cqYArgVgxNN0u1+4pGILszGhCR0anuTBA==","shasum":"021cf29a968b4113c10d7b19e7b6d9357bf2e44b","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.4.4.tgz","fileCount":24,"unpackedSize":138803,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMmd3f34jy4Y6aS8GHvOc+lM5+OExdfFc5Effgp4q02AiA36oTG4XzJjOTdOYstoGt/+umrTLYhknvMNQV0zzDEdA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjnPOVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNcBAAnhVTLh7tISXFZ0Rgff4OvNJ2qrqsCbB7ZGNtqMVVSpSOYhNx\r\nPY4aVWVbySIE7OyT/uVoEYdaWgjn80z39Bmf3TcjWUMVu+gTqZA8ZX3P/ih0\r\n0iavBihrf+Lp2iFNyygoWstktCRxD1hc2+atI0iTEtIG7INm4y2PVRalvG6g\r\n0MV7uT6RVVh0me+d1SSisLhLPjrS7QPYBAylhVnljHm21vnUJVborUYNHYcJ\r\nUKYnEjXYNFKhT/Eibe+k1NjLjnU+IE/2zMcZRmpfNwaNOUEnlI5OEiYRq+Ih\r\njIqksWO5B9YUF4H0iuLHCsxkto54/Rlnuxvgtel8BZJWBgdLU/SPQv3/gzUf\r\nxjomabOy3eVbNqSfwwb2WPKvYYP1UQ3wfSNH9wQcG7dKVpT1GZOAWm4NDAAJ\r\nsC1N8/cIPeTq14OaAnL3A8yBiGbEQ/O68vZ7VR524gx3edWYwdco0tDfQ6pe\r\nMA7NfexynnOTgqBLBVdvHQ9V+uBjAiM6L4kXIuLqB34Qpl34DTXpUOfLvL13\r\nokmx7vHSUJdA4PndHCcdByR1RsLOYyc6jnFSZgkZ/+yoVL5CvXNZttkW92OF\r\nv9Wz60wIsEQPtV5d0HOBk65DwKv46KprPOFa2mtWBaGNZ720fKPNCD7MrHVa\r\noYvWykgPfPW4Xrpv2z2JUERlqEaDLMVLKy4=\r\n=nYX7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.4.4_1671230357045_0.7411755882300581"},"_hasShrinkwrap":false},"3.4.5":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.4.5","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-flow-strip-types":"^7.19.0","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"2.9.0","fusion-plugin-react-redux":"2.6.4","fusion-plugin-universal-events":"2.6.5","fusion-test-utils":"2.5.4","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.9.0","fusion-plugin-universal-events":"2.6.5"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.4.5.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.4.5","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-VlyyVME1G4xhK7PIcNUYpQbncrRcf+D8e7wEiCSIkR3btMPMWGYHiV3adin9uBIoaro+KPLDLP+8/BxpBBTDhQ==","shasum":"8c91bfaddab37dae20e3ab6461f63e7c5e621a5e","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.4.5.tgz","fileCount":24,"unpackedSize":138803,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDmJBfTze8TpyWI6lyC7p00mwBbIyiTgQh2zp9s35lciAiEAnM8xCEYGik5kXysajRsb5uFvJ6yUI3lL3JwL00UbWPs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0H2ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrlCg/+MqfflfLYBziXPT2pNrmu9pFgMirH9udwwmWf3h/OiKJPHMIb\r\nN3XnC9oNoSeRWsAAfVSzwsTgkYcMOuY+ba3maPiZicxhw2NbBpYwPHBIZaCL\r\nxvvOgE70OQhymnnBUKJSCsrRddSRxxoZoK6L6fc8R69GFz5HLHDl2zq78zOf\r\nqfCAD6LI8JUH8CyCTYCmiZUQW5J1d49623QW9UQAPJGGiMLo2Re4cKt+ieZY\r\nPUyoU0HMMEH1IuknqNimmuSPViZ0AHfnJgZ/iQwayH6zM8VmBGCfIdXtpzwr\r\nlRjirpn8+lWxzlkT9VQ3gS6XZN5hOp+Ed6DUqPm9JvhMN7ZN1b5Nd2GWVNUx\r\nuz1jMBaeSxRQPBdGWwg4NPWz0jT2q5HIrB1pgYIHiAqGff8dXeLdmdW/xUH5\r\nxM6dO1Fk7v5UdfbeJrVNPJYDHrg85syi4TWnRPGw0qPlGZOHv9L8nS5fqa2w\r\nbRG/1JCcpAYgie7WGcDlwz/FrARP6LYhciQgOWoYUtMwJRK0jfMnjl6d4O/P\r\nk6C4WGZqf88qu8blZ063ergxWLh2jcw5Aa0Jd/PhwxF2TSk7x1i30sw6vO2b\r\n9DpNUrE/SkLoPOORgJRU4qRciQBaR+a/KwHlswJJnzux3ypDX65CdDghTluH\r\nlQhEwJaS0vh/f0js6cXUabMy12g/yvyqMrE=\r\n=2N8e\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.4.5_1674608025201_0.8487740520835505"},"_hasShrinkwrap":false},"3.4.6":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.4.6","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-flow-strip-types":"^7.19.0","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"2.9.0","fusion-plugin-react-redux":"2.6.4","fusion-plugin-universal-events":"2.6.6","fusion-test-utils":"2.6.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.9.0","fusion-plugin-universal-events":"2.6.6"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.4.6.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.4.6","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-UTtKyiR3L8BVdZ5FC/8Tdijd5ZHdVKwWqG03/Q5U1GK8HCUOQ1VQupg6YOKAGS8K8xGaQUHHg1FBmABtOEZBhw==","shasum":"9c631f77a2866e05d3729b661dc6a106641e92c3","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.4.6.tgz","fileCount":24,"unpackedSize":138803,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGykyULqMLhJwXr3UuL94rtNDSiwF0OqzsKamxl5vZuFAiAoFU95aXZ8orBpaege8uXp1kGWFV0eTO8s+EVmlczRhg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2tO1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqb1RAAl0263F5bcSRLvV12DNGmgWbJnVyFBm9N0R/BZZjKIhSmcLkC\r\nanei2wZVeENb6hrvQu164y1gTu9Ia/EUillH33V0p5tEfqF1jdDQYzEg/kfQ\r\nNvPgbne+Wk8HlPZEIHIR2AvFD8jecEUh4O4ME++4DsO30Q2Klk0fLRSLL95x\r\natEEGNtv0e6LTq3SpZ1p7PUDP6Rb6Jfmn0jUN/haGbWw8UZCGPKqpDH9ZS/H\r\n+yhyjYTwMaG8OrVMoE5TXEKLLwfGNoqBLWGyaX2+4fGwNIIxrXVbbjPZK2MJ\r\n1k8saj4yT+TkfuzLHaEdj9KwF1AhlQnUpGNvh7Nx1RIre3gCB3XbWvw0e4Ze\r\nZQ9q4aSLDaS9w7gpaDd2wfSgW6dM1VpEmLsISJq6D0EJcvFaCY+y2Z2/BFLV\r\neWAeufa3SuahCbmV1B32QFMlgR09XvqCePGq92ywIJljavA45dX7744AeP6I\r\nhSZtbZOBmU0qVXPQO4zPDR4yLnm8ePdEL/UdM4gskPwfsfLrZt/Jl9zLP6bz\r\nUQaL32xQSMPq0uZIaPlID518DHfvJbQECfrnWQ7zDOBBjQM1+4dNofFSpryb\r\n84gIHv17CGDFgT2q4wLOJGlApTn48vShzL0xJopsX4GQ610d8U4r1+MmcNfs\r\ngpdRTK83LYlcNYIafyi6aX6pU9h49WIOiJg=\r\n=AQwB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.4.6_1675285429020_0.858760337131319"},"_hasShrinkwrap":false},"3.4.7":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.4.7","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-flow-strip-types":"^7.19.0","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"2.10.0","fusion-plugin-react-redux":"2.6.5","fusion-plugin-universal-events":"2.6.7","fusion-test-utils":"2.6.1","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.10.0","fusion-plugin-universal-events":"2.6.7"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.4.7.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.4.7","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-LgLPR9dSzI9+waAKxXRE2OIgyebkFbIl5YuHS1ZLPcwJaoIO48JFwrh8s/tEECty1JAY86xS6n54i3wsyslukg==","shasum":"a648e2332ca9c7f514d0ee75d2390cd263ed72f1","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.4.7.tgz","fileCount":24,"unpackedSize":138805,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICA7YY/RTCx0LfyjgkklsEpu2oUmTnCEAjh1OHK/9TZAAiEApw+/IQIm7mToWX1/vsfUcuO6oonkfQY4lYVdLl4ZXiY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5E9WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4xA//c/9W3Six2tDR2+vlQIyMVHTdIeFf175YQ+Dh8UXYICwB0+PD\r\nZAW/ZBTClMT24lWvgGS6vg/pqqzVyB09eGgGyo5Top9RUd9/f38Tap1418zH\r\nugSPCRl3KhrOItc20lPlF+qujRqC8eDdWDwOVJf5Xri9y0UPpzMl9VNSzIQO\r\nX0cikKmEp9A5wGcx1ypNEsLskyIM2MwINpSgbu7wud+4snWhSvDHV0HXn9ZX\r\nqom2Bv7rpeMgzTmrAlxnu4er0eSMNUSrBQc9jwE/vnWhWVp3ftTQM8t66Ki8\r\nKo2rys3Omt4BIr4qb0OvDJlJWW0ujrQzPsBKxvjUXkNLanj/exrnumiAv59l\r\nHxojSxVNwDI8ZmFq3i0rQjlkQmTKvC3PdxwHySW3jYfvs4JQhGhjs+PG9Umn\r\n2rfQDQHScwY2iSae74T2LLB0pJ2JvAgbsyTs6Z8ZdS1lMBSX4oqdaZrh+n8u\r\nLtvrMyYVWRTYJpP9Hs7BuXSUAusP58Qdhl2SxmVBtG3UEnRc5AXUKWZSFvEE\r\nsacjuMVb/5vQg0Q9etlqK368Wt08C6KdvMm6tGUJ3TRzgP07Zjmo9oLrxDcR\r\neywpy+C7lpoI1x6s4k7vgJ8XU7EkWH2rwY6HxtrMIVIqFCMkB5S+19vUL0CE\r\njMb5eKGSlGtIzGltqeGNwOpuV73SDUut8WE=\r\n=HaMy\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.4.7_1675906902252_0.5647269627946923"},"_hasShrinkwrap":false},"0.0.0-canary.1cbe20f.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.1cbe20f.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-flow-strip-types":"^7.19.0","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.1cbe20f.0","fusion-plugin-react-redux":"0.0.0-canary.1cbe20f.0","fusion-plugin-universal-events":"0.0.0-canary.1cbe20f.0","fusion-test-utils":"0.0.0-canary.1cbe20f.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.1cbe20f.0","fusion-plugin-universal-events":"0.0.0-canary.1cbe20f.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1cbe20f.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.1cbe20f.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-NZeXyW6XD+gzfeAbciEUFQvnMZJhYyT6pmqxsSjuo/lmCYiCLG2szJKOO95B5mgtXX2a78o/Bu6WxA1iQxznEw==","shasum":"fb8275c4402b7e77640ee96c48861c64a40393d2","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.1cbe20f.0.tgz","fileCount":24,"unpackedSize":138922,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDe4VMTBe0la8qgd87uixm/l8kV/dR2BK2PrjhMiLubEAIhAOZEbwybN98dktoBxgR7ccOsqmzocth9n5wGBikWCCZg"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8BVvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmquvhAAhbZJWFAbdv0moY7/j5oxEDMnf8pt6mUgvBoqpAOWJV3lYt5K\r\nyjhW/MON0uy4GAL2QfOsUuo7y/udyi9XA78cGhOQV3r++bB0DNlCa/elAH8g\r\npd2mwo4CbDs/dh890PkwDXcwmZZSPqV+Aak3jC5RyCsSVnuiYUlyigq6bZyY\r\nPlP7RCPAE4Ag/86CwTBUqVoX8bA5YMuqARE8ThNLAFDIRJ/YNb1ZIoccARqw\r\nSDAse1Ud1ONI6uovpKuobA9iRd6Q/lT1L6qzZsFykzaKPQwbwANHjpyhTmrf\r\nX7Ue/YzXC+GT7e54jKhrNMNsH0Q4GYIn3BMYP4WLuG6hhUnjH3cgpp144oIc\r\nV6P3VsiqIUPKQ1/aGd3jVwFLo8MgoJLoXPitU04Oux6MssDc89ur/aY8XCep\r\nQXnQ1uYhny9nQPJIZS6bJobG/zii0yXwgYb5mp5CLDp7xtbEr5fdhvIqw6gD\r\nn04zA8nIoqfYellYzxUS69F07HYAWyKoDTSu6askZFjF3tusbHla8/9cSTVL\r\nyWJEeMMCT2o6Umcswpc6WQV7q+WId7i3TlU2dW6lRs9oPzNY3T9xNd5EuD6z\r\ns/DONny3tO83ctg1Ggq976dxoDdBEo2sW4T5nOPpeu3kc1wk84gWfYQ5PIZa\r\n1KgMSVoCXSIMFAFkplsQhcRY4p+SbqF9qBo=\r\n=O7G7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.1cbe20f.0_1676678511357_0.5229645989803335"},"_hasShrinkwrap":false},"0.0.0-canary.52f9d6c.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.52f9d6c.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-flow-strip-types":"^7.19.0","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.52f9d6c.0","fusion-plugin-react-redux":"0.0.0-canary.52f9d6c.0","fusion-plugin-universal-events":"0.0.0-canary.52f9d6c.0","fusion-test-utils":"0.0.0-canary.52f9d6c.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.52f9d6c.0","fusion-plugin-universal-events":"0.0.0-canary.52f9d6c.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.52f9d6c.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.52f9d6c.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-jPG3NlgW4lB10YhkY2Q8r3TeNV75O2+rM27cbWGuanOqMTFp+sHfLMkn4WO09qSIrdWApuyWLapSLXbYlHDn9A==","shasum":"7cb8fa8740e1fa36ec8c59e7afe404bd014ebea0","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.52f9d6c.0.tgz","fileCount":24,"unpackedSize":138922,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCYyCkRM1WIcCFSSKKiC/wW+uBeCBwQAaeJcZCZfZxXgIhAP/MdoqxFidSTxah0N5CtBbeDbVCISbYGj0nC1FEI7lq"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8DaOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp0qw//dtm0THQ6ieYc2bozRLeJmu5yHoaSTjGw1q1z8kRBeaOkOian\r\nj/UGlU4o+I+/t9LyI2o0/cC4FqHEUUyJoFHx2WMiM+Z34tF7OGa0jHijARNY\r\nMsLYVtvOls/lUj0HC1EJrr6stp1vj7C6euO6D3jM0DNdJmFKnJ8u4MvGSQn8\r\nOGapaV2wzgMkZ2Lw9zGOPrNe+6ZXBVQ7RQtRXyro5jgeJE0VZxA8WSKFIqmR\r\nvpW5EhwwpSEHsjEFky9Tcz80cdctfzmCBYaGS6b730jUin1InGiS1NAPrqXD\r\nQFpxSLwrSwKXhVumyEX1hNMxebfiZstYFHmsmeIkbRzsPk4wfyqIljRK7tS0\r\nX/Xb7lkB8fXRAQuA7IKjj7vHkhRykihAq2n3NI5ERrLpcMNGueTZ605PhaMd\r\npG1gdxXduxk6uu2fiG5e+6ma8ryjbiQ3zD4pqSLqE3YqHV/GaKBPOyN1Wczr\r\nflzA5Omyeq9rTpL88PCYWi1S2oUXMlwZfsCshyPgBJHa1R36XVf2QOmknDl2\r\nnYWGkcb4esHLIr6CwhO1pj/Z9lU3yy5K5Vb2LySe3p13cuWjbAHtjNPOitMI\r\nH80bVCM3Xt7lriz38Kd+zvrkmb6Vl3dnTBaK+EKgL9GkXCfg7FibAky4R5TT\r\nYGyhX9smHLrv7vRM5FU2NqWofYdLMqH0HjU=\r\n=Ej7T\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.52f9d6c.0_1676686990354_0.09287947205102598"},"_hasShrinkwrap":false},"3.4.8":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"3.4.8","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-flow-strip-types":"^7.19.0","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"2.11.0","fusion-plugin-react-redux":"2.6.6","fusion-plugin-universal-events":"2.6.8","fusion-test-utils":"2.6.2","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"2.11.0","fusion-plugin-universal-events":"2.6.8"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-3.4.8.tgz","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@3.4.8","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-GmjepEikFMEVLIqXUQYw2jtDnHvqWoqO+mI1O5w0274WhY1GMJ67p4DTOLF4OicJIOqr7Jkavt84xy3xWM3UUw==","shasum":"93e11d1c2c5ed90e618bb6829a3522e093dafced","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-3.4.8.tgz","fileCount":24,"unpackedSize":138805,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH77iX1ukkpaDtAfFXLV3NYnnXOJmNtXW4Jb5CsPdnORAiEAy/11MepXoYt1bzQmEFOEs47aOmOJzPy+pXJRkJmQdlc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj89tzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo49g//cI20fTs5rdz4axfDHvMsqTLirzW07KawuYc8i0StFVInA99O\r\nJBGBHdJUuqrHdapT9q5DEu5SW3/HJAjHz73YiDs8RzdRKd8Ts5TRa7Dw/oCR\r\n7iMmcCxLiaI6tdD1YExoVe/auRgI816CbhNmp9/syUP/dtwIA7WjdczBulgT\r\niYaOStroC5H1dzcmX7pf2MdF0yGD+6Neo4tFWpH2ZyKkxC3C4xEPExGgSKiV\r\nMjq2NT7I00lANuzaUKSpqcYwc+3YLuj1Ri9CO9JRc8vTExA7T7bWviddFO3/\r\npadIQ0jCb6uuYOtLrJ/7spinkx7fptNCyZwpcGqdwTvm1CWMtxpP0WOkn5hu\r\ne1Mj9J0I7q2pQ8g0ldX52RRmGiWvhKagp3q9xHQumP4ULYZl/Eiclbu7BOw8\r\n0N+wIwvPkTsOkq1b/Nwyr1NjZzuSkAKg7ZsncGkDBYDj6vNRLtePdQc2Y4P5\r\n8wyOuJEkIxB/FxuuJdbr4qew4zE/wFK+PBdr7zJEsZ0raSNSPEF8pjYRdba3\r\nlsYwuFpnrOlQYjd5XOvJc7hpud24cuCqBASOL7DhaAW2sR7MryW6glcKCGNN\r\nsocI+zZGHOhBkxweP+k7/vxRjtI6Y88sNYFvPuNnxXbZ8bSDLGdF/zYiDe3c\r\nS95c9l2B9dfRd/16Z55zgm0+GBeEtyp/rkQ=\r\n=pZ4O\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_3.4.8_1676925811447_0.6329034545416814"},"_hasShrinkwrap":false},"0.0.0-canary.ca778ef.0":{"name":"fusion-plugin-redux-action-emitter-enhancer","description":"Redux store enhancer that emits actions via an injected event emitter","version":"0.0.0-canary.ca778ef.0","browser":{"./dist-node-cjs/index.js":"./dist-browser-cjs/index.js","./dist-node-esm/index.js":"./dist-browser-esm/index.js"},"devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-flow-strip-types":"^7.19.0","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@types/create-universal-package-env":"workspace:*","@types/jest":"^28.1.3","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","babel-jest":"^28.1.3","create-universal-package":"^4.3.0","flow-bin":"0.131.0","fusion-core":"0.0.0-canary.ca778ef.0","fusion-plugin-react-redux":"0.0.0-canary.ca778ef.0","fusion-plugin-universal-events":"0.0.0-canary.ca778ef.0","fusion-test-utils":"0.0.0-canary.ca778ef.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","react":"^18.2.0","react-dom":"^18.2.0","react-redux":"^8.0.2","redux":"4.0.5","typescript":"^4.9.3"},"engines":{"node":">=8.9.4","npm":">=5.0.0","yarn":">=1.0.0"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","license":"MIT","main":"./dist-node-cjs/index.js","types":"./lib/index.d.ts","module":"./dist-node-esm/index.js","peerDependencies":{"fusion-core":"0.0.0-canary.ca778ef.0","fusion-plugin-universal-events":"0.0.0-canary.ca778ef.0"},"repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"scripts":{"clean":"cup-clean","lint":"yarn g:lint","prepack":"yarn tsc -b && cup-build","test":"jest"},"sideEffects":false,"_resolved":"","_integrity":"","_from":"file:fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ca778ef.0.tgz","readme":"# fusion-plugin-redux-action-emitter-enhancer\n\n[![Build status](https://badge.buildkite.com/7a82192275779f6a8ba81f7d4a1b0d294256838faa1dfdf080.svg?branch=master)](https://buildkite.com/uberopensource/fusionjs)\n\nRedux store enhancer that emits actions via an injected event emitter.\n\nThe `fusion-plugin-redux-action-emitter-enhancer` provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).  This plugin composes a new, enhanced store creator, which captures and emits all dispatched actions.\n\nThis is useful for when you want to collect data about redux actions, potentially to recreate user journeys or statefulness.\n\n---\n\n### Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Capturing action emits](#capturing-action-emits)\n  - [Transforming action payloads on emission](#transforming-action-payloads-on-emission)\n- [Setup](#setup)\n- [API](#api)\n  - [Registration API](#registration-api)\n    - [`ReduxActionEmitterEnhancer`](#reduxactionemitterenhancer)\n    - [`EnhancerToken`](#enhancertoken)\n    - [`ActionEmitterTransformerToken`](#actionemittertransformertoken)\n  - [Dependencies](#dependencies)\n  - [Service API](#service-api)\n  - [Emit API](#emit-api)\n\n---\n\n### Installation\n\n```js\nyarn add fusion-plugin-redux-action-emitter-enhancer\n```\n\n---\n\n### Usage\n\n#### Capturing action emits\n\nWe can register a simple callback to listen for the events emitted by this enhancer - in this case, `redux-action-emitter:action`.  Normally we might want to log these to a backend service, but for simplicity, we'll log them to console.\n\n```js\n// src/plugins/some-emit-consumer.js\nexport default createPlugin({\n  deps: {events: UniversalEventsToken},\n  middleware: ({events}) => {\n    events.on('redux-action-emitter:action', payload => {\n      console.log(\"Action emitted: \", payload);\n    });\n  }\n});\n```\n\n#### Transforming action payloads on emission\n\nThis plugin depends on [fusion-plugin-universal-events](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events) to emit the action payloads, which means the payloads are sent over-the-wire to the server-side, which **can consume much of the network bandwidth**, or even cause 413 Payload Too Large HTTP errors. The dependence is the reason why by default the plugin will only emit [certain properties](#default-transformer) from the raw action payload.\n\nBy default, `_trackingMeta` is an opinionated property to be picked and emitted from the raw payload for tracking(analytics) purposes. **For customizations, you should provide a transformer function to mainly filter/pick properties for emission.**\n\n```js\n// src/app.js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n\napp.register(ActionEmitterTransformerToken, action => {\n  const base = {type: action.type};\n  switch (action.type) {\n    case 'ADD_TO_SHOPPING_CART':\n    case 'REMOVE_FROM_SHOPPING_CART':\n      return {\n        ...base,\n        items: action.payload.items,\n      };\n    case 'ADD_COUPON': {\n      return {\n        ...base,\n        couponId: action.payload.couponId,\n      };\n    }\n    case 'SUPER_BIG_PAYLOAD':\n      return null; // !!Omit the action type from emission entirely!!\n    default:\n      return base;\n  }\n});\n```\n\nOr, if you are certain about emitting everything from the raw payload, maybe when bandwidth is actually not a concern for your application:\n\n```js\napp.register(ActionEmitterTransformerToken, action => action);\n```\n\n---\n\n### Setup\n\n```js\n// src/main.js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\nimport {FetchToken} from 'fusion-tokens';\nimport Redux, {ReduxToken, ReducerToken, EnhancerToken} from 'fusion-plugin-react-redux';\nimport fetch from 'unfetch';\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\nimport reducer from './reducers/root.js'\n\nexport default function start() {\n  const app = new App(root);\n\n  app.register(UniversalEventsToken, UniversalEvents, {fetch});\n  __BROWSER__ && app.register(FetchToken, fetch);\n\n  app.register(ReduxToken, Redux);\n  app.register(ReducerToken, reducer);\n  app.register(EnhancerToken, ReduxActionEmitterEnhancer);\n\n  return app;\n}\n\n// src/reducers/root.js\nexport default (state, action) => {\n  // reducer goes here\n}\n```\n\n---\n\n### API\n\n#### Registration API\n\n##### `ReduxActionEmitterEnhancer`\n\n```js\nimport ReduxActionEmitterEnhancer from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n\nThis plugin.  It can be registered as a dependency to any plugin that expects a Redux Store Enhancer.  Typically, it should be registered with [`EnhancerToken`](#enhancertoken).\n\n##### `EnhancerToken`\n\n```js\nimport {EnhancerToken} from 'fusion-plugin-react-redux';\n```\n\nIf you are using [`fusion-plugin-react-redux`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-react-redux), we recommend registering this plugin to the `EnhancerToken`.\n\n##### `ActionEmitterTransformerToken`\n\n```js\nimport {ActionEmitterTransformerToken} from 'fusion-plugin-redux-action-emitter-enhancer';\n```\n###### Default transformer\n`action => ({type: action.type, _trackingMeta: action._trackingMeta})`\n\nProviding a transform function for the raw action payloads. See [\"Transforming action payloads on emission\"](#transforming-action-payloads-on-emission) for more information.\n\n\n#### Dependencies\n\n```js\nimport UniversalEvents, {UniversalEventsToken} from 'fusion-plugin-universal-events';\n\napp.register(UniversalEventsToken, UniversalEvents);\n```\n\nAn event emitter plugin which emits the actions.  Typically, it is registered with [`fusion-plugin-universal-events`](https://github.com/fusionjs/fusionjs/tree/master/fusion-plugin-universal-events).\n\n#### Service API\n\n```js\ntype StoreEnhancer = (next: StoreCreator) => StoreCreator\n```\n\nThis plugin provides a Redux compatible [store enhancer](https://github.com/reactjs/redux/blob/master/docs/Glossary.md#store-enhancer).\n\n#### Emit API\n\nTo consume action events, add an event listener for the following emitted events:\n\n- `redux-action-emitter:action`\n\nThe payload is the Redux action itself.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"_id":"fusion-plugin-redux-action-emitter-enhancer@0.0.0-canary.ca778ef.0","_nodeVersion":"16.15.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-+rDyOBrHfhqBbBFmBj9G8DjSNXUXywavO7Yq0Z65fyWSvlBQnHKs+aJHzWAZksaizTbJ9qPPDZNhdRXAxZcjCQ==","shasum":"04ada702a20decc4eb1a203fb74c3eef356dc630","tarball":"https://registry.npmjs.org/fusion-plugin-redux-action-emitter-enhancer/-/fusion-plugin-redux-action-emitter-enhancer-0.0.0-canary.ca778ef.0.tgz","fileCount":24,"unpackedSize":138922,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqvfX4s7c6ThEDNKw+waUxZMQ3Uswt3cBNqkpKehGhSAiEAkWd5SP7zvdZ9JKlPntzuEBLhU00OSGA0dltkMgHxJqU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/9SAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo2tw/+K5dG7BWAEn5JbeZEDARejHgZnz9e4cip0AO8RXFwwMHaKCWe\r\nhF/NvoB71s9cC+3/VPPIBMPqG1zEcBanxDLtF4GcEs80FTp/jC9qrz1l9XLF\r\n5+WItqrWT9eDE09pkcQA6TWU+ZzBt7a4nLmYvT61eYTLVrqrxq5c8tw9ofZN\r\nl6kbN5AjnAd93XlQcGyUWysGmY9vHSHm2Q1/TpeRibh11JGGdWMdat9WANGl\r\neJMSB6wcWHV+ckwRbUsaF4ecBp32ul04/gjW3qe3vApJ/tkvV4NVNsXNsEYL\r\nOP3pFzXS53a0l/dnBKsZxEfm/qnO5MC+tj75om8w1MEmJ6jM61T1TDODtiXr\r\nsJkjO6j4p83Z4C4k8zj79DSLZI9udEQsV5AJf67jytrWJldd58X6GlXag/wL\r\nXktQed86sM4ZdJz69KJ7ST6o6sqQaE9lOsw6A1NoE7btObglaqVfgV1eDJRN\r\nhUrW9DjLmdQvwA2Y2BqQSjijOTcSQgHKgzvFzoE+We+2R4HlGaKYNNReWuNW\r\njbNRexZjXHOaVEwXVEo3c/GXh6o6fEdqxFUtfDbFMJ4Qp5njqMXyj9WCt1EN\r\nOyGAhc6lxLWNpobs9ylAhCv1PoNBJYzPfmtOvCmcMtvC7TinenqDczYcHNo0\r\nxAgJIZ15CewyiyriFgykq3gbo8NxGK7+g7E=\r\n=ipnt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"fusion-ci","email":"fusionjs+ci@uber.com"},"directories":{},"maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fusion-plugin-redux-action-emitter-enhancer_0.0.0-canary.ca778ef.0_1677710464195_0.4761712228391646"},"_hasShrinkwrap":false}},"readme":"","maintainers":[{"name":"fusion-ci","email":"fusionjs+ci@uber.com"}],"time":{"modified":"2023-03-01T22:41:04.444Z","created":"2018-01-24T00:01:09.107Z","0.2.0":"2018-01-24T00:01:09.107Z","0.2.1":"2018-01-24T00:51:00.949Z","0.2.2":"2018-01-29T21:25:05.112Z","1.0.0":"2018-02-09T23:43:36.018Z","1.0.1":"2018-02-12T20:45:08.747Z","1.0.2":"2018-02-12T22:43:09.666Z","1.0.3":"2018-05-08T23:32:32.268Z","1.0.4":"2018-05-31T00:31:14.337Z","2.0.0":"2018-09-18T00:20:39.635Z","2.0.1":"2018-11-13T01:36:52.338Z","0.0.0-canary.309a1d1.0":"2019-05-23T00:51:55.537Z","0.0.0-canary.309a1d1.1":"2019-05-23T01:31:50.264Z","0.0.0-canary.9941505.0":"2019-05-23T01:53:21.500Z","0.0.0-canary.3811188.0":"2019-05-23T22:46:40.002Z","3.0.0":"2019-05-23T23:04:12.472Z","0.0.0-canary.872b547.0":"2019-05-24T17:13:14.178Z","0.0.0-canary.125012c.0":"2019-06-04T00:40:48.815Z","0.0.0-canary.b26bd4d.0":"2019-06-04T01:43:26.396Z","0.0.0-canary.69ca4d0.0":"2019-06-04T18:10:35.595Z","3.0.1":"2019-06-04T20:20:23.597Z","3.0.2":"2019-06-04T22:14:40.922Z","0.0.0-canary.fd5a750.0":"2019-06-06T18:35:01.033Z","0.0.0-canary.4e310bc.0":"2019-06-06T20:07:08.960Z","0.0.0-canary.5bf099f.0":"2019-06-06T23:35:01.892Z","0.0.0-canary.2fb1140.0":"2019-06-07T18:01:42.683Z","0.0.0-canary.d9a277c.0":"2019-06-07T18:24:24.214Z","0.0.0-canary.9b5e4cf.0":"2019-06-08T00:42:13.621Z","0.0.0-canary.43352f4.0":"2019-06-10T18:55:03.272Z","0.0.0-canary.43352f4.1":"2019-06-10T18:56:53.728Z","0.0.0-canary.4fb3fa6.0":"2019-06-10T19:03:26.811Z","0.0.0-canary.4fb3fa6.1":"2019-06-10T23:30:27.741Z","0.0.0-canary.72a6835.0":"2019-06-11T00:25:49.154Z","0.0.0-canary.af0fe55.0":"2019-06-11T16:57:25.298Z","0.0.0-canary.af0fe55.1":"2019-06-11T18:20:21.545Z","0.0.0-canary.1131efb.0":"2019-06-11T18:38:54.059Z","0.0.0-canary.2fcf0b5.0":"2019-06-11T20:17:29.004Z","0.0.0-canary.2fcf0b5.1":"2019-06-11T20:22:25.329Z","0.0.0-canary.c237758.0":"2019-06-12T00:18:14.359Z","0.0.0-canary.8c0849b.0":"2019-06-12T03:23:35.155Z","0.0.0-canary.0b1303b.0":"2019-06-12T16:49:05.785Z","0.0.0-canary.7cfc88b.0":"2019-06-12T17:01:44.640Z","0.0.0-canary.b7caf15.0":"2019-06-12T21:05:16.508Z","0.0.0-canary.b7caf15.1":"2019-06-12T21:25:02.464Z","0.0.0-canary.8ae44a5.0":"2019-06-12T22:19:04.520Z","0.0.0-canary.8ae44a5.1":"2019-06-12T22:25:09.426Z","0.0.0-canary.51752cd.0":"2019-06-13T00:11:40.718Z","0.0.0-canary.27245f3.0":"2019-06-13T17:40:36.082Z","0.0.0-canary.3703af8.0":"2019-06-14T03:03:27.938Z","0.0.0-canary.3703af8.1":"2019-06-14T15:15:56.530Z","0.0.0-canary.d93b398.0":"2019-06-14T16:35:39.859Z","0.0.0-canary.d0b5703.0":"2019-06-14T21:47:12.017Z","0.0.0-canary.801e47f.0":"2019-06-17T16:25:19.550Z","0.0.0-canary.63145f9.0":"2019-06-18T00:16:18.482Z","3.0.3":"2019-06-18T00:37:47.790Z","0.0.0-canary.407b8e4.0":"2019-06-26T20:29:22.288Z","0.0.0-canary.ed79452.0":"2019-06-27T18:53:13.241Z","0.0.0-canary.3e2cc31.0":"2019-06-28T17:47:37.464Z","0.0.0-canary.5c3b351.0":"2019-07-01T21:38:25.630Z","0.0.0-canary.16ee004.0":"2019-07-01T23:15:08.774Z","0.0.0-canary.69d2497.0":"2019-07-03T18:11:49.514Z","0.0.0-canary.69d2497.1":"2019-07-03T18:15:55.873Z","3.0.4":"2019-07-03T22:19:25.293Z","0.0.0-canary.98adb08.0":"2019-07-08T22:03:15.899Z","0.0.0-canary.016f954.0":"2019-07-09T00:33:23.351Z","0.0.0-canary.1ddabc1.0":"2019-07-09T18:21:26.855Z","0.0.0-canary.1ddabc1.1":"2019-07-09T18:24:58.781Z","0.0.0-canary.40eb0a5.0":"2019-07-09T20:03:19.405Z","0.0.0-canary.40eb0a5.1":"2019-07-09T20:06:56.553Z","0.0.0-canary.fbfd207.0":"2019-07-10T18:25:41.872Z","0.0.0-canary.4c30d33.0":"2019-07-10T21:07:50.923Z","0.0.0-canary.e1e65f2.0":"2019-07-11T16:36:42.778Z","0.0.0-canary.4cb9c2b.0":"2019-07-11T17:12:30.453Z","0.0.0-canary.b0e5994.0":"2019-07-11T23:23:36.379Z","0.0.0-canary.50aa07c.0":"2019-07-12T16:17:30.122Z","0.0.0-canary.0a4669b.0":"2019-07-12T19:52:48.302Z","0.0.0-canary.0a4669b.1":"2019-07-12T20:14:29.778Z","0.0.0-canary.3b5ed2f.0":"2019-07-12T20:43:12.456Z","0.0.0-canary.db655de.1":"2019-07-16T01:06:16.739Z","0.0.0-canary.396f8bb.0":"2019-07-16T18:15:11.303Z","0.0.0-canary.66cfac0.0":"2019-07-16T19:06:02.384Z","0.0.0-canary.403f456.0":"2019-07-17T00:53:35.157Z","0.0.0-canary.ec8188c.0":"2019-07-17T15:52:17.508Z","0.0.0-canary.e9f07ef.0":"2019-07-22T16:55:46.627Z","0.0.0-canary.fc2bf62.0":"2019-07-22T20:08:51.258Z","0.0.0-canary.a8de467.0":"2019-07-22T22:11:21.739Z","0.0.0-canary.a8de467.1":"2019-07-22T22:17:19.946Z","0.0.0-canary.02195f4.0":"2019-07-23T03:16:34.041Z","0.0.0-canary.da2cfec.0":"2019-07-23T16:33:55.466Z","0.0.0-canary.14b4f0e.0":"2019-07-23T17:37:39.843Z","0.0.0-canary.0953f07.0":"2019-07-23T21:49:33.899Z","0.0.0-canary.471a10b.0":"2019-07-24T17:12:11.668Z","0.0.0-canary.9dc742c.0":"2019-07-24T17:12:26.053Z","0.0.0-canary.fbc7ca5.0":"2019-07-24T21:46:13.162Z","0.0.0-canary.08790d0.0":"2019-07-24T22:56:01.283Z","0.0.0-canary.17cfc1d.0":"2019-07-24T22:57:05.844Z","0.0.0-canary.d0e4cd8.0":"2019-07-24T22:57:23.646Z","0.0.0-canary.6499178.0":"2019-07-25T01:03:28.935Z","0.0.0-canary.47d3251.0":"2019-07-25T06:07:37.685Z","0.0.0-canary.1b63aac.0":"2019-07-25T20:32:38.446Z","0.0.0-canary.675492e.0":"2019-07-25T22:43:17.554Z","0.0.0-canary.a8af54e.0":"2019-07-26T03:07:54.977Z","0.0.0-canary.4a47f03.0":"2019-07-26T18:41:55.671Z","0.0.0-canary.88403d8.0":"2019-07-30T23:56:07.476Z","0.0.0-canary.96b08c1.0":"2019-07-31T20:37:24.849Z","0.0.0-canary.631e52a.0":"2019-08-01T16:11:11.516Z","3.0.5":"2019-08-01T18:04:30.434Z","0.0.0-canary.bdd94ac.0":"2019-08-01T18:34:53.573Z","0.0.0-canary.ca9c1e7.0":"2019-08-02T19:08:29.259Z","0.0.0-canary.36c6897.0":"2019-08-05T20:09:27.895Z","0.0.0-canary.87693bb.0":"2019-08-06T17:58:47.664Z","0.0.0-canary.87693bb.1":"2019-08-06T17:59:27.478Z","0.0.0-canary.73b3b7a.0":"2019-08-06T21:07:24.113Z","0.0.0-canary.3a6c203.0":"2019-08-06T22:21:01.033Z","0.0.0-canary.b30cfc9.0":"2019-08-06T23:11:20.132Z","0.0.0-canary.d1e11d1.0":"2019-08-06T23:34:11.606Z","0.0.0-canary.d1e11d1.1":"2019-08-06T23:39:21.003Z","0.0.0-canary.465e7e1.0":"2019-08-07T00:10:06.123Z","0.0.0-canary.465e7e1.1":"2019-08-07T00:14:12.083Z","0.0.0-canary.465e7e1.2":"2019-08-07T00:15:09.113Z","0.0.0-canary.bd48967.0":"2019-08-07T23:28:27.034Z","0.0.0-canary.aa5bec0.0":"2019-08-08T01:51:17.376Z","0.0.0-canary.4c8e718.0":"2019-08-09T19:30:55.510Z","0.0.0-canary.e3270dd.0":"2019-08-12T17:39:34.312Z","0.0.0-canary.73f956e.0":"2019-08-13T19:13:01.271Z","0.0.0-canary.1e7190d.0":"2019-08-14T23:19:33.316Z","0.0.0-canary.b102bb9.0":"2019-08-15T20:21:56.802Z","0.0.0-canary.ffb0ab3.0":"2019-08-19T16:27:10.250Z","3.0.6":"2019-08-19T21:24:09.548Z","0.0.0-canary.e2fcadb.0":"2019-08-22T21:23:54.649Z","0.0.0-canary.d767d28.0":"2019-08-23T18:17:53.947Z","0.0.0-canary.c189a42.0":"2019-08-23T20:28:26.031Z","0.0.0-canary.aa40d96.0":"2019-08-27T01:41:44.929Z","0.0.0-canary.a9d6e7c.0":"2019-08-27T17:00:49.530Z","0.0.0-canary.f608c58.0":"2019-08-27T20:36:07.362Z","0.0.0-canary.9d5ef83.0":"2019-08-29T17:30:07.939Z","0.0.0-canary.096185d.0":"2019-08-29T21:09:46.075Z","0.0.0-canary.d78b7bb.0":"2019-08-29T21:43:37.457Z","0.0.0-canary.2a2b83b.0":"2019-08-30T19:54:35.670Z","0.0.0-canary.a0f0132.0":"2019-09-04T22:52:48.883Z","0.0.0-canary.109b061.0":"2019-09-05T16:35:52.388Z","0.0.0-canary.66d82db.0":"2019-09-05T16:36:59.157Z","3.0.7":"2019-09-05T20:14:30.158Z","0.0.0-canary.413f404.0":"2019-09-16T18:36:29.365Z","0.0.0-canary.c0ad947.0":"2019-09-16T20:30:19.456Z","0.0.0-canary.ad6c873.0":"2019-09-16T20:45:32.636Z","0.0.0-canary.08011c5.0":"2019-09-16T20:54:18.813Z","0.0.0-canary.a27ac53.0":"2019-09-16T22:21:23.282Z","0.0.0-canary.ff793d9.0":"2019-09-17T00:05:48.521Z","0.0.0-canary.2925a25.0":"2019-09-18T04:41:43.436Z","0.0.0-canary.49d4d79.0":"2019-09-19T22:58:09.382Z","0.0.0-canary.d4b0b6c.0":"2019-09-19T23:45:25.256Z","0.0.0-canary.5be6a00.0":"2019-09-20T00:26:59.737Z","0.0.0-canary.dd07585.0":"2019-09-20T01:08:00.011Z","0.0.0-canary.22593cf.0":"2019-09-20T01:13:18.058Z","0.0.0-canary.a911dd9.0":"2019-09-20T17:19:08.008Z","0.0.0-canary.67e33d8.0":"2019-09-20T18:29:43.037Z","0.0.0-canary.d787a1d.0":"2019-09-23T19:31:47.834Z","0.0.0-canary.a399454.0":"2019-09-24T17:34:44.412Z","3.0.8":"2019-09-24T18:39:18.127Z","0.0.0-canary.acb5af0.0":"2019-09-25T21:13:15.584Z","0.0.0-canary.d7c5910.0":"2019-10-30T20:44:58.985Z","0.0.0-canary.f12f055.0":"2019-10-30T22:10:24.375Z","0.0.0-canary.0b935d0.0":"2019-10-30T22:10:43.083Z","0.0.0-canary.37af1b2.0":"2019-11-05T05:27:00.098Z","0.0.0-canary.e3078c3.0":"2019-11-05T21:27:13.604Z","0.0.0-canary.f8e4f0b.0":"2019-11-11T19:14:29.031Z","0.0.0-canary.0af264b.0":"2019-11-12T01:39:31.895Z","0.0.0-canary.78c977f.0":"2019-11-12T17:50:20.477Z","0.0.0-canary.0af264b.1":"2019-11-12T20:26:42.329Z","0.0.0-canary.cdf3e91.0":"2019-11-12T21:06:19.215Z","0.0.0-canary.55945c5.0":"2019-11-12T23:58:50.637Z","3.0.9":"2019-11-13T20:30:22.369Z","0.0.0-canary.08a30a3.0":"2019-11-19T20:07:00.154Z","0.0.0-canary.602f682.0":"2019-11-20T23:32:30.357Z","0.0.0-canary.b4d0561.0":"2019-11-21T01:29:47.400Z","0.0.0-canary.abe8bb4.0":"2019-11-22T01:22:22.175Z","0.0.0-canary.f16f299.1":"2019-11-22T20:00:39.362Z","0.0.0-canary.9dca7da.0":"2019-11-23T01:50:54.428Z","3.0.10":"2019-11-25T19:57:50.859Z","0.0.0-canary.2dbfb1d.0":"2019-11-25T22:50:20.711Z","0.0.0-canary.777f2cc.0":"2019-11-26T00:36:20.065Z","0.0.0-canary.6e4e073.0":"2019-12-05T18:17:41.415Z","0.0.0-canary.b7558a7.0":"2019-12-06T00:12:05.394Z","0.0.0-canary.f55f645.0":"2019-12-06T17:48:46.300Z","0.0.0-canary.a1f34dc.0":"2019-12-06T19:48:54.359Z","0.0.0-canary.17b7929.0":"2019-12-09T21:21:27.164Z","0.0.0-canary.e266b31.0":"2019-12-09T21:26:45.445Z","0.0.0-canary.2e98cc9.0":"2019-12-11T03:42:59.584Z","0.0.0-canary.c4b78ee.0":"2019-12-11T20:21:19.029Z","0.0.0-canary.87d361c.0":"2019-12-12T00:44:52.263Z","0.0.0-canary.32cd5ea.0":"2019-12-14T01:20:20.029Z","0.0.0-canary.8057c37.0":"2019-12-17T18:10:25.062Z","0.0.0-canary.4d95fad.1":"2019-12-19T23:14:43.326Z","0.0.0-canary.39fc7dc.0":"2019-12-26T21:34:52.161Z","0.0.0-canary.549dba2.0":"2020-01-07T01:00:58.301Z","0.0.0-canary.69f275d.0":"2020-01-07T23:47:33.554Z","0.0.0-canary.1d2aed6.0":"2020-01-09T00:10:08.884Z","0.0.0-canary.7ed789a.0":"2020-01-09T01:19:48.242Z","0.0.0-canary.cd789cd.0":"2020-01-10T21:11:54.203Z","0.0.0-canary.ee6892e.0":"2020-01-10T21:58:46.227Z","0.0.0-canary.abffccd.0":"2020-01-11T00:41:21.586Z","0.0.0-canary.b94debb.0":"2020-01-11T01:21:51.426Z","3.0.11":"2020-01-14T00:45:54.282Z","0.0.0-canary.659c743.0":"2020-01-22T19:46:46.009Z","0.0.0-canary.df13289.0":"2020-01-23T01:55:25.707Z","0.0.0-canary.79c5c12.0":"2020-01-23T19:23:51.592Z","0.0.0-canary.3a8e24a.0":"2020-01-23T22:50:37.235Z","0.0.0-canary.55e2075.0":"2020-01-24T00:51:07.429Z","0.0.0-canary.294feb4.0":"2020-01-24T22:29:25.513Z","0.0.0-canary.5c80f83.0":"2020-01-27T18:57:43.841Z","0.0.0-canary.cdb104d.0":"2020-01-28T00:25:28.219Z","0.0.0-canary.1db323f.0":"2020-01-28T00:43:55.890Z","0.0.0-canary.aaaf2fa.0":"2020-01-28T02:29:09.571Z","0.0.0-canary.fed6152.0":"2020-01-28T07:48:33.870Z","0.0.0-canary.971253d.0":"2020-01-28T08:05:57.731Z","0.0.0-canary.659c743.1":"2020-01-28T08:53:45.145Z","0.0.0-canary.dcf8c03.1":"2020-01-28T23:04:24.663Z","0.0.0-canary.4fc2099.0":"2020-01-29T06:23:39.457Z","0.0.0-canary.2917daa.0":"2020-01-29T17:56:33.383Z","3.1.0":"2020-01-29T19:52:51.120Z","0.0.0-canary.97698d3.0":"2020-01-29T22:24:22.716Z","0.0.0-canary.69bc71d.0":"2020-01-31T03:01:31.860Z","0.0.0-canary.fa2f39f.0":"2020-01-31T19:21:30.809Z","0.0.0-canary.1d3504b.0":"2020-01-31T21:59:49.568Z","0.0.0-canary.2effc34.0":"2020-01-31T22:43:36.781Z","0.0.0-canary.deed5b0.0":"2020-02-01T02:17:48.064Z","0.0.0-canary.3088ca8.0":"2020-02-03T21:12:44.461Z","0.0.0-canary.9a71266.0":"2020-02-03T21:20:17.491Z","0.0.0-canary.9a71266.1":"2020-02-03T21:41:45.445Z","0.0.0-canary.9a71266.2":"2020-02-03T22:06:21.939Z","0.0.0-canary.d07e1e4.0":"2020-02-04T18:47:09.558Z","0.0.0-canary.05b1cf5.0":"2020-02-04T18:56:04.743Z","0.0.0-canary.986cea9.0":"2020-02-04T21:38:49.164Z","0.0.0-canary.b8a6237.0":"2020-02-05T18:28:24.910Z","0.0.0-canary.2c705b4.0":"2020-02-05T20:58:47.604Z","0.0.0-canary.4b659af.0":"2020-02-05T21:16:06.304Z","0.0.0-canary.96e8674.0":"2020-02-05T21:25:44.640Z","0.0.0-canary.96e8674.1":"2020-02-05T21:35:48.858Z","0.0.0-canary.96e8674.2":"2020-02-05T21:47:19.403Z","0.0.0-canary.b640602.0":"2020-02-05T23:20:36.659Z","0.0.0-canary.b640602.1":"2020-02-05T23:33:40.339Z","0.0.0-canary.2ef1293.0":"2020-02-05T23:53:22.797Z","0.0.0-canary.2ef1293.1":"2020-02-06T01:14:52.341Z","0.0.0-canary.2467727.0":"2020-02-06T19:13:07.765Z","0.0.0-canary.ccad833.0":"2020-02-06T19:51:56.813Z","0.0.0-canary.e70cabc.0":"2020-02-07T22:34:23.917Z","0.0.0-canary.ed74fa2.0":"2020-02-08T00:09:40.657Z","0.0.0-canary.b127562.0":"2020-02-11T01:19:07.720Z","0.0.0-canary.fee0408.0":"2020-02-11T20:49:31.841Z","0.0.0-canary.9dededf.0":"2020-02-11T21:47:20.824Z","0.0.0-canary.9dededf.1":"2020-02-11T21:51:44.041Z","0.0.0-canary.9dededf.2":"2020-02-11T21:58:52.814Z","0.0.0-canary.9dededf.3":"2020-02-11T22:01:31.687Z","0.0.0-canary.a0a3534.0":"2020-02-13T00:23:30.338Z","0.0.0-canary.513dcf4.0":"2020-02-13T00:46:38.122Z","0.0.0-canary.b276aaf.0":"2020-02-13T18:58:01.731Z","0.0.0-canary.a8e624c.0":"2020-02-14T00:12:57.181Z","0.0.0-canary.2661049.0":"2020-02-14T01:39:10.632Z","0.0.0-canary.2661049.1":"2020-02-14T01:48:22.601Z","0.0.0-canary.7eb4e1e.0":"2020-02-14T20:16:05.534Z","0.0.0-canary.5e59509.0":"2020-02-19T00:13:20.428Z","0.0.0-canary.062c690.0":"2020-02-19T01:44:03.549Z","0.0.0-canary.c9627c1.0":"2020-02-19T02:16:22.079Z","0.0.0-canary.48ddc5e.0":"2020-02-19T23:32:41.542Z","0.0.0-canary.119a885.0":"2020-02-20T19:03:12.031Z","0.0.0-canary.9908539.0":"2020-02-20T22:59:09.091Z","0.0.0-canary.5386f4d.0":"2020-02-24T16:25:37.670Z","3.1.1":"2020-02-25T19:07:46.140Z","0.0.0-canary.77f8cc5.0":"2020-03-11T17:13:52.273Z","0.0.0-canary.356cf23.0":"2020-03-11T22:53:40.737Z","0.0.0-canary.a5f5c1e.0":"2020-03-12T19:50:01.079Z","0.0.0-canary.8d11e65.0":"2020-03-13T03:31:44.831Z","0.0.0-canary.c612639.0":"2020-03-13T22:06:51.607Z","0.0.0-canary.646af7a.0":"2020-03-16T16:36:10.336Z","0.0.0-canary.a921018.0":"2020-03-16T18:42:59.322Z","0.0.0-canary.ba95671.0":"2020-03-16T21:22:26.887Z","0.0.0-canary.a16c9b3.0":"2020-03-17T23:04:32.039Z","0.0.0-canary.5817c05.0":"2020-03-17T23:12:50.528Z","0.0.0-canary.5817c05.1":"2020-03-17T23:44:06.085Z","0.0.0-canary.091a12c.0":"2020-03-18T00:58:42.993Z","0.0.0-canary.5817c05.3":"2020-03-18T18:31:52.974Z","0.0.0-canary.5817c05.2":"2020-03-18T18:34:24.115Z","0.0.0-canary.db5498f.0":"2020-03-20T17:59:02.937Z","0.0.0-canary.db5498f.1":"2020-03-20T18:57:42.003Z","0.0.0-canary.b3d958e.0":"2020-03-23T22:53:04.140Z","0.0.0-canary.fa25698.0":"2020-03-24T18:22:17.006Z","0.0.0-canary.11d6f93.0":"2020-03-25T20:18:44.056Z","0.0.0-canary.adfde84.0":"2020-04-01T16:20:34.302Z","0.0.0-canary.adfde84.1":"2020-04-08T21:55:26.036Z","0.0.0-canary.26ab130.0":"2020-04-08T23:27:29.633Z","0.0.0-canary.f9fd82a.0":"2020-04-08T23:37:39.412Z","3.1.2":"2020-04-09T19:54:54.470Z","0.0.0-canary.74cf916.0":"2020-04-09T20:32:53.018Z","0.0.0-canary.5a76e33.0":"2020-04-14T01:20:15.162Z","0.0.0-canary.8de64d7.0":"2020-04-14T19:52:55.724Z","0.0.0-canary.d9ad58b.0":"2020-04-15T06:36:35.619Z","0.0.0-canary.9049f58.0":"2020-04-16T04:18:34.531Z","0.0.0-canary.1f389e4.0":"2020-04-16T17:39:35.828Z","0.0.0-canary.952803d.0":"2020-04-16T19:08:37.353Z","0.0.0-canary.0813b9b.0":"2020-04-18T00:12:40.419Z","0.0.0-canary.0cd5338.0":"2020-04-20T21:49:11.365Z","0.0.0-canary.e8742f5.0":"2020-04-20T22:52:51.963Z","0.0.0-canary.e794932.0":"2020-04-20T22:55:15.289Z","0.0.0-canary.e8742f5.1":"2020-04-20T22:58:39.247Z","0.0.0-canary.7debfaa.0":"2020-04-20T23:52:43.322Z","0.0.0-canary.840675c.0":"2020-04-21T02:07:06.308Z","0.0.0-canary.a3a7eac.0":"2020-04-21T17:12:48.731Z","0.0.0-canary.f69e6b0.0":"2020-04-22T18:43:13.859Z","0.0.0-canary.1850336.0":"2020-04-22T22:12:26.091Z","0.0.0-canary.2dbdc73.0":"2020-04-23T00:26:47.894Z","0.0.0-canary.7379dad.0":"2020-04-23T00:47:29.742Z","0.0.0-canary.22b9ab8.0":"2020-04-24T19:24:04.869Z","0.0.0-canary.69f59b4.0":"2020-04-24T20:58:53.926Z","0.0.0-canary.3d209a6.0":"2020-04-24T21:53:12.403Z","0.0.0-canary.70b95a2.0":"2020-04-24T23:47:35.569Z","0.0.0-canary.99a4452.0":"2020-04-25T18:29:50.664Z","0.0.0-canary.649174e.0":"2020-04-27T20:26:08.403Z","0.0.0-canary.99a4452.2":"2020-04-28T18:49:03.004Z","0.0.0-canary.649174e.1":"2020-04-28T18:50:39.830Z","0.0.0-canary.2450eb8.0":"2020-04-28T19:01:54.628Z","0.0.0-canary.2450eb8.1":"2020-04-28T19:03:24.459Z","0.0.0-canary.3b3b756.0":"2020-04-29T00:28:33.292Z","0.0.0-canary.3b3b756.3":"2020-04-29T01:53:15.011Z","0.0.0-canary.45a5f32.0":"2020-04-30T22:09:28.275Z","0.0.0-canary.45a5f32.1":"2020-05-04T17:54:00.922Z","3.1.3":"2020-05-04T22:51:18.420Z","0.0.0-canary.d57096d.0":"2020-06-16T20:36:50.736Z","0.0.0-canary.7291033.0":"2020-06-17T01:04:15.673Z","0.0.0-canary.ed3b1cb.0":"2020-06-23T17:26:56.766Z","0.0.0-canary.024e4d0.0":"2020-06-24T16:03:18.351Z","0.0.0-canary.7b62fb4.0":"2020-06-24T21:25:51.530Z","0.0.0-canary.f151937.0":"2020-06-25T22:55:25.414Z","0.0.0-canary.203abae.0":"2020-06-30T21:03:46.511Z","0.0.0-canary.b9c56cd.0":"2020-07-01T17:02:43.101Z","0.0.0-canary.152e4d2.0":"2020-07-07T00:11:50.696Z","0.0.0-canary.3bad172.0":"2020-07-07T16:18:13.299Z","0.0.0-canary.de7fb27.0":"2020-07-07T18:28:34.374Z","0.0.0-canary.fe1674a.0":"2020-07-07T23:16:49.620Z","0.0.0-canary.9d3d9dc.0":"2020-07-08T16:32:52.296Z","3.1.4":"2020-07-13T23:25:04.999Z","0.0.0-canary.4e80a7c.0":"2020-08-27T22:22:38.264Z","0.0.0-canary.4d0772e.0":"2020-08-29T00:05:28.387Z","0.0.0-canary.8a530ea.0":"2020-08-29T01:15:19.976Z","0.0.0-canary.4404d9c.0":"2020-09-03T21:08:38.725Z","0.0.0-canary.b53def8.0":"2020-09-03T21:16:54.050Z","0.0.0-canary.e133fff.0":"2020-09-04T00:14:42.162Z","0.0.0-canary.3915f48.0":"2020-09-04T21:09:15.760Z","0.0.0-canary.b3c0cf8.0":"2020-09-09T17:38:22.108Z","0.0.0-canary.42048ff.0":"2020-09-11T07:29:55.452Z","3.1.6":"2020-09-16T23:17:38.526Z","0.0.0-canary.4c67dce.0":"2020-09-23T20:57:05.872Z","0.0.0-canary.4123cce.0":"2020-10-22T20:56:33.881Z","0.0.0-canary.17e330d.0":"2020-10-27T00:15:48.158Z","0.0.0-canary.318c08c.0":"2020-10-30T17:12:42.348Z","0.0.0-canary.e74b783.0":"2020-11-04T19:04:20.994Z","0.0.0-canary.a33a9c8.0":"2020-11-06T19:58:46.287Z","0.0.0-canary.5a2a7a7.0":"2020-11-07T00:05:28.046Z","0.0.0-canary.77061d0.0":"2020-11-09T19:05:13.852Z","0.0.0-canary.89ca12c.0":"2020-11-10T19:44:19.714Z","3.1.7":"2020-11-13T19:13:20.404Z","0.0.0-canary.770d485.0":"2020-11-13T21:23:43.196Z","0.0.0-canary.6d664ad.0":"2020-12-16T22:49:32.042Z","0.0.0-canary.579111b.0":"2020-12-17T03:10:11.886Z","0.0.0-canary.2eb76df.0":"2020-12-17T03:49:35.423Z","3.1.8":"2021-01-05T03:06:55.421Z","0.0.0-canary.4cee1e1.0":"2021-01-05T21:45:52.652Z","0.0.0-canary.b936566.0":"2021-01-20T20:16:23.105Z","0.0.0-canary.7d3770e.0":"2021-01-20T20:57:51.245Z","0.0.0-canary.c848126.0":"2021-01-28T21:27:13.845Z","0.0.0-canary.7eef88a.0":"2021-03-10T17:40:16.868Z","3.1.9":"2021-03-12T00:55:15.580Z","0.0.0-canary.5086770.0":"2021-03-12T03:26:20.188Z","0.0.0-canary.243e09c.0":"2021-03-18T23:30:09.837Z","0.0.0-canary.156446a.0":"2021-04-02T22:37:44.319Z","0.0.0-canary.bda3eb5.0":"2021-04-07T20:52:38.554Z","0.0.0-canary.7852906.0":"2021-04-08T22:15:22.630Z","0.0.0-canary.36c1f93.0":"2021-04-12T14:52:06.335Z","0.0.0-canary.147decc.0":"2021-04-13T17:10:05.916Z","0.0.0-canary.481456c.0":"2021-04-13T21:58:30.308Z","0.0.0-canary.4d2f7e5.0":"2021-04-13T23:15:55.916Z","0.0.0-canary.9158df6.0":"2021-04-14T14:25:54.977Z","0.0.0-canary.c68f2d4.0":"2021-04-14T19:03:00.079Z","0.0.0-canary.fa4dd7d.0":"2021-04-14T22:00:49.862Z","3.1.10":"2021-04-16T22:17:03.068Z","0.0.0-canary.60586e2.0":"2021-05-17T15:03:13.806Z","0.0.0-canary.b3081dd.0":"2021-05-21T21:59:51.007Z","3.1.11":"2021-05-25T00:36:54.790Z","0.0.0-canary.dc6dd20.0":"2021-06-14T19:45:12.268Z","0.0.0-canary.66de151.0":"2021-06-15T02:24:11.616Z","3.1.12":"2021-06-16T21:38:48.850Z","0.0.0-canary.cc30c9b.0":"2021-07-27T01:41:01.284Z","0.0.0-canary.e5a3019.0":"2021-07-27T23:37:59.304Z","0.0.0-canary.74b8151.0":"2021-07-28T01:35:20.731Z","0.0.0-canary.53b58e6.0":"2021-07-28T18:26:01.165Z","0.0.0-canary.53b58e6.1":"2021-07-29T05:00:45.855Z","0.0.0-canary.d9ecd19.0":"2021-07-30T18:59:22.351Z","0.0.0-canary.f0b60b1.0":"2021-08-12T22:22:34.182Z","3.1.13":"2021-08-17T17:39:51.865Z","0.0.0-canary.0833d86.0":"2021-08-31T17:56:41.258Z","0.0.0-canary.009cb5f.0":"2021-09-01T01:21:38.187Z","0.0.0-canary.34f1f86.0":"2021-09-01T21:06:51.126Z","0.0.0-canary.0f75d56.0":"2021-09-01T22:17:16.784Z","0.0.0-canary.addd6fb.0":"2021-09-02T00:54:43.185Z","0.0.0-canary.e938140.0":"2021-09-08T17:22:45.829Z","0.0.0-canary.04ebbff.0":"2021-09-10T17:12:21.315Z","0.0.0-canary.77d64ce.0":"2021-09-16T22:01:18.097Z","3.2.0":"2021-09-17T16:58:46.435Z","0.0.0-canary.a5335ef.0":"2021-11-08T21:55:33.308Z","0.0.0-canary.99bcfaa.0":"2021-11-15T22:37:11.703Z","0.0.0-canary.858e9e0.0":"2021-11-16T00:44:15.239Z","0.0.0-canary.940ae04.0":"2021-11-17T00:16:04.574Z","0.0.0-canary.61befa0.0":"2021-11-17T21:49:10.616Z","0.0.0-canary.358ea34.0":"2021-11-23T14:24:45.349Z","0.0.0-canary.0585b99.0":"2021-11-23T19:49:25.963Z","0.0.0-canary.4d4635d.0":"2021-11-23T21:00:42.744Z","0.0.0-canary.4457a44.0":"2021-11-23T21:23:51.327Z","3.2.1":"2021-11-24T22:35:37.735Z","0.0.0-canary.69a107c.0":"2021-12-06T23:42:53.903Z","0.0.0-canary.c638cb0.0":"2021-12-07T21:49:56.430Z","3.2.2":"2021-12-09T20:47:06.806Z","0.0.0-canary.6c63a07.0":"2022-01-03T21:51:31.825Z","0.0.0-canary.2fa3949.0":"2022-01-04T22:07:31.444Z","0.0.0-canary.4b5b637.0":"2022-01-19T23:26:55.752Z","3.2.3":"2022-01-20T01:33:45.312Z","3.2.4":"2022-01-28T19:32:43.687Z","0.0.0-canary.b663bd4.0":"2022-03-08T23:32:41.059Z","0.0.0-canary.fc310f5.0":"2022-03-09T00:59:37.578Z","3.2.5":"2022-03-14T18:26:34.256Z","0.0.0-canary.2961969.0":"2022-03-22T18:06:27.724Z","0.0.0-canary.5dafecb.0":"2022-03-23T22:57:52.326Z","0.0.0-canary.f10290c.0":"2022-03-24T03:06:52.493Z","0.0.0-canary.4b95c4d.0":"2022-03-27T08:17:50.808Z","0.0.0-canary.ba7901a.0":"2022-03-28T04:43:24.302Z","0.0.0-canary.53e71c9.0":"2022-03-28T05:37:29.294Z","3.2.6":"2022-03-31T00:12:01.734Z","0.0.0-canary.04f01d4.0":"2022-03-31T16:23:44.959Z","0.0.0-canary.0115aaa.0":"2022-03-31T21:52:27.375Z","0.0.0-canary.3fd760c.0":"2022-04-01T16:55:06.962Z","0.0.0-canary.d90d4e6.0":"2022-04-01T18:30:41.498Z","0.0.0-canary.fb16ff3.0":"2022-04-02T00:32:28.907Z","0.0.0-canary.b6e28d0.0":"2022-04-03T02:24:04.878Z","0.0.0-canary.0c6b102.0":"2022-04-05T01:58:25.551Z","0.0.0-canary.a48714f.0":"2022-04-05T20:12:38.449Z","0.0.0-canary.48261a2.0":"2022-04-05T21:50:29.347Z","0.0.0-canary.e4a0af5.0":"2022-04-05T22:47:57.088Z","0.0.0-canary.a5387d7.0":"2022-04-06T16:12:52.121Z","0.0.0-canary.4f43ddb.0":"2022-04-11T04:08:23.220Z","0.0.0-canary.f865478.0":"2022-04-12T06:01:54.716Z","0.0.0-canary.901e6a9.0":"2022-04-12T06:29:24.468Z","0.0.0-canary.5f75a67.0":"2022-04-12T06:46:34.810Z","0.0.0-canary.66acb26.0":"2022-04-18T05:59:21.769Z","0.0.0-canary.0abc031.0":"2022-04-18T22:57:36.212Z","0.0.0-canary.4fa95ac.0":"2022-04-19T21:59:42.979Z","0.0.0-canary.483ee52.0":"2022-04-20T20:16:08.214Z","0.0.0-canary.c2e995a.0":"2022-04-21T00:23:50.950Z","0.0.0-canary.03b7f8c.0":"2022-04-21T17:58:27.345Z","3.2.7":"2022-04-25T22:02:31.171Z","0.0.0-canary.d9125fa.0":"2022-04-26T00:27:04.413Z","0.0.0-canary.9081ecc.0":"2022-05-01T03:48:01.850Z","0.0.0-canary.82afe51.0":"2022-05-04T01:11:40.570Z","0.0.0-canary.3afacb1.0":"2022-05-04T07:38:38.057Z","0.0.0-canary.dc38594.0":"2022-05-06T01:33:26.140Z","0.0.0-canary.9bf73bd.0":"2022-05-09T00:09:59.821Z","0.0.0-canary.0d8f1cb.0":"2022-05-10T01:45:51.410Z","3.2.8":"2022-05-16T22:25:15.421Z","0.0.0-canary.441c97e.0":"2022-05-17T01:05:58.281Z","0.0.0-canary.94de910.0":"2022-05-17T07:56:42.944Z","0.0.0-canary.a8535bf.0":"2022-05-17T21:24:02.342Z","0.0.0-canary.7805140.0":"2022-05-18T02:47:51.763Z","0.0.0-canary.c454879.0":"2022-05-19T19:35:58.269Z","3.2.9":"2022-05-20T01:39:29.469Z","0.0.0-canary.234cdec.1":"2022-05-26T04:01:22.689Z","0.0.0-canary.ce07ef1.0":"2022-05-29T07:38:38.403Z","0.0.0-canary.6d29913.0":"2022-06-03T06:07:03.219Z","0.0.0-canary.eac89e2.0":"2022-06-03T07:24:50.044Z","0.0.0-canary.c36b35a.0":"2022-06-03T22:12:48.947Z","0.0.0-canary.7c27df5.0":"2022-06-14T20:18:45.217Z","0.0.0-canary.8894dd7.0":"2022-06-15T22:59:40.184Z","0.0.0-canary.5378c1f.0":"2022-06-24T23:06:59.108Z","0.0.0-canary.e08ad19.0":"2022-07-06T01:04:22.198Z","0.0.0-canary.57962c1.0":"2022-07-06T22:15:05.292Z","3.2.10":"2022-07-21T18:42:28.030Z","0.0.0-canary.a682711.0":"2022-08-16T20:38:43.611Z","0.0.0-canary.47148f0.0":"2022-08-17T20:32:21.433Z","0.0.0-canary.2645e7a.0":"2022-08-24T18:43:14.884Z","0.0.0-canary.d248f7c.0":"2022-09-08T00:32:13.497Z","0.0.0-canary.c77e60d.0":"2022-09-20T22:01:56.780Z","0.0.0-canary.5f297f6.0":"2022-09-20T22:40:19.716Z","3.3.0":"2022-10-04T18:36:26.004Z","0.0.0-canary.df69099.0":"2022-10-12T19:52:27.678Z","3.3.1":"2022-10-14T19:26:30.304Z","0.0.0-canary.7982e16.0":"2022-11-03T00:10:55.145Z","3.3.2":"2022-11-04T23:12:51.759Z","0.0.0-canary.af83905.0":"2022-12-01T01:11:01.445Z","3.4.0":"2022-12-05T20:35:15.076Z","0.0.0-canary.cc2fb77.0":"2022-12-06T02:13:27.719Z","0.0.0-canary.d18411f.0":"2022-12-06T04:37:14.839Z","0.0.0-canary.7f1cb1f.0":"2022-12-06T06:06:41.205Z","3.4.1":"2022-12-07T01:56:42.026Z","0.0.0-canary.1ea3b4c.0":"2022-12-07T20:31:40.205Z","3.4.2":"2022-12-08T00:48:04.362Z","3.4.3":"2022-12-10T01:43:28.925Z","0.0.0-canary.1d6a860.0":"2022-12-12T18:25:14.110Z","0.0.0-canary.f1ab874.0":"2022-12-12T20:07:59.376Z","3.4.4":"2022-12-16T22:39:17.236Z","3.4.5":"2023-01-25T00:53:45.355Z","3.4.6":"2023-02-01T21:03:49.202Z","3.4.7":"2023-02-09T01:41:42.484Z","0.0.0-canary.1cbe20f.0":"2023-02-18T00:01:51.494Z","0.0.0-canary.52f9d6c.0":"2023-02-18T02:23:10.514Z","3.4.8":"2023-02-20T20:43:31.618Z","0.0.0-canary.ca778ef.0":"2023-03-01T22:41:04.345Z"},"homepage":"https://fusionjs.com/api/fusion-plugin-redux-action-emitter-enhancer","repository":{"directory":"fusion-plugin-redux-action-emitter-enhancer","type":"git","url":"git+https://github.com/fusionjs/fusionjs.git"},"bugs":{"url":"https://github.com/fusionjs/fusionjs/issues"},"license":"MIT","readmeFilename":""}