{"_id":"pico-signals","_rev":"1-a83eebfe66046f15d899d995980e56e1","name":"pico-signals","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"pico-signals","version":"1.0.0","description":"A very simple signal library inspired by the 'signals' package","keywords":["pico","signals","listeners","set","events","emitters","callbacks","observer"],"author":{"name":"Paulo Marcos","email":"paulo.marcos@moxy.studio"},"homepage":"https://github.com/moxystudio/js-pico-signals","repository":{"type":"git","url":"git+https://github.com/moxystudio/js-pico-signals.git"},"license":"MIT","main":"lib/index.js","module":"es/index.js","scripts":{"build:commonjs":"BABEL_ENV=commonjs babel index.js -d lib","build:es":"BABEL_ENV=es babel index.js -d es","build":"npm run build:commonjs && npm run build:es","lint":"eslint --ignore-path .gitignore .","test":"jest --coverage","prerelease":"npm t && npm run lint && npm run build","release":"standard-version"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"standard-version":{"scripts":{"posttag":"git push --follow-tags origin master"}},"lint-staged":{"*.js":["eslint --fix --ignore-pattern test/fixtures","git add"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.3.4","@commitlint/cli":"^7.0.0","@commitlint/config-conventional":"^7.0.0","babel-preset-moxy":"^3.0.4","eslint":"^5.13.0","eslint-config-moxy":"^7.0.1","husky":"^1.3.1","jest":"^24.1.0","lint-staged":"^8.1.4","standard-version":"^5.0.0"},"gitHead":"17f174575635a823fbd851dd209ee28466a158ea","bugs":{"url":"https://github.com/moxystudio/js-pico-signals/issues"},"_id":"pico-signals@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.9.1","_npmUser":{"name":"paulobmarcos","email":"paulobmarcos@outlook.com"},"dist":{"integrity":"sha512-Av5eg3cMtXbQVxVoIpP+dzHMBisRZuZy3htFWyaGGScT94AdfeT0On/QVhFNQhIMiY7aLi21W4pD+5KdWbEBUw==","shasum":"3df41f192c76d5baf9232bb3845fec73a7e50d9b","tarball":"https://registry.npmjs.org/pico-signals/-/pico-signals-1.0.0.tgz","fileCount":6,"unpackedSize":7462,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcdsrECRA9TVsSAnZWagAAMboP/i1UKvG7uZF7gOlV430G\n7zhQNAhartITF+ViNDyHTmy3WV1DDJRr3qExkush3zUo6NcM75j5CZslokN2\nOA6MESJRV1M1dAsOhW9PJAc4euL52u0ngrmEqNqKlFJymacwt29JQfW6lwAt\nKz/wNzwHzXgXhHBw/sQ5Zbkz2UgMwEku9W2fkTVvBC2ntj/8kXATw261Cigk\ndVKDB0Oxf9Ekm7CKkUChNSr/v/GWfNaOergyw7zd4+yT2607yGQMmacmw3X0\nFmoPifOUXCl5oW1xfv1xHDpKwai70uTLk/vFsVPrSsCI4STJd3tjV9LK0muQ\nwkfW5lOhHVgtctMTPV55unta41ZVlc0alfyfpS4d+BqCh6Tn1BMl4Jnhrkwc\nFeKDVMuoc5XqtEu8P/1uhZfse+tDMv1qITmESnqrukpfUQ13iTLERN0JMl9+\nbLaRDgOBw8hhv1MsO+R2VsxHV8n14kLx3fC4mJ93sivdxaPn6fCZKREtWJqI\nUrRIQM/+kdjzN+dJ3XrzbsjWkTq2xrYSexEGwKPfjz/eK8F2XGr8CHVEesn4\n0BXznUFclrDguT3Ve5BdQoSYNT396MduUO//xRLhxoqZU4MtXbr8T/vvB/JH\n7ZAuKGw2ytLf/8VXCiHJCOQQOTWOqK+NyOrugitAQTjGmw98s74AGruaQ//b\nPOZY\r\n=4gjZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACEku4zhkTNYvRxYuLjTNW+3ZdhWpVOYHEPqUxZz9zYAiEAlC3/e0An7zcP4S37rvXBpv3aL6Bqxaa+s5lic8t8XYc="}]},"maintainers":[{"name":"paulobmarcos","email":"paulobmarcos@outlook.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pico-signals_1.0.0_1551289027839_0.18476400468728804"},"_hasShrinkwrap":false}},"time":{"created":"2019-02-27T17:37:07.838Z","1.0.0":"2019-02-27T17:37:07.953Z","modified":"2022-05-12T22:22:52.522Z"},"maintainers":[{"name":"paulobmarcos","email":"paulobmarcos@outlook.com"}],"description":"A very simple signal library inspired by the 'signals' package","homepage":"https://github.com/moxystudio/js-pico-signals","keywords":["pico","signals","listeners","set","events","emitters","callbacks","observer"],"repository":{"type":"git","url":"git+https://github.com/moxystudio/js-pico-signals.git"},"author":{"name":"Paulo Marcos","email":"paulo.marcos@moxy.studio"},"bugs":{"url":"https://github.com/moxystudio/js-pico-signals/issues"},"license":"MIT","readme":"# pico-signals\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]\n\n[npm-url]:https://npmjs.org/package/pico-signals\n[downloads-image]:https://img.shields.io/npm/dm/pico-signals.svg\n[npm-image]:https://img.shields.io/npm/v/pico-signals.svg\n[travis-url]:https://travis-ci.org/moxystudio/js-pico-signals\n[travis-image]:http://img.shields.io/travis/moxystudio/js-pico-signals/master.svg\n[codecov-url]:https://codecov.io/gh/moxystudio/js-pico-signals\n[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/js-pico-signals/master.svg\n[david-dm-url]:https://david-dm.org/moxystudio/js-pico-signals\n[david-dm-image]:https://img.shields.io/david/moxystudio/js-pico-signals.svg\n[david-dm-dev-url]:https://david-dm.org/moxystudio/js-pico-signals?type=dev\n[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/js-pico-signals.svg\n\nA very simple signal library inspired by the [signals](https://github.com/millermedeiros/js-signals) package.\n\n\n## Installation\n\n```sh\n$ npm install pico-signals\n```\n\nThis library is written in modern JavaScript and is published with both CommonJS and ES module transpiled variants.\n\nIf you target older browsers please make sure to transpile accordingly. \n\n\n## Usage\n\n```js\nimport picoSignals from 'pico-signals';\n\nconst listener1 = () => console.log('Listener 1');\nconst listener2 = () => console.log('Listener 2');\n\nconst ps = picoSignals();\n\nconst removeListener1 = ps.add(listener1);\nconst removeListener2 = ps.add(listener2);\n\nps.dispatch('foo', 'bar');\n//=> Both listeners will be called and both logs produced.\n//=> Every listener will receive the same arguments provided in the dispatch method.\n\nremoveListener2();\n//=> Deletes `listener2` from the listeners list;\n\nps.dispatch();\n//=> Only `listener1` will be called since its currently the only listener on the list.\n\nps.clear();\n//=> Clears all listeners.\n```\n\n## API\n\n### add(listener)\n\nAdds a new listener to the list.\n\nReturns a method to remove the listener.\n\n#### listener\nType: `Function`\n\nA listener to be called on dispatch.\n\n### delete(listener)\n\nDeletes a listener from the list.\n\n#### listener\nType: `Function`\n\nAn existing listener in the list.\n\n### clear()\n\nDeletes all listeners from the list.\n\n### dispatch(...args)\n\nCalls every listener with the specified arguments.\n\n\n## Tests\n\n```sh\n$ npm test\n$ npm test -- --watch # during development\n```\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n\n","readmeFilename":"README.md"}