From adf361862ddb0645852fda63115664c83b3356f4 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Tue, 17 Jan 2017 11:06:20 +0700 Subject: Fix typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f9f34c4..46ec287 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ - **Microscopic:** weighs less than 200 bytes gzipped - **Useful:** a wildcard `"*"` event type listens to all events -- **Famliar:** same names & ideas as [Node's EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) +- **Familiar:** same names & ideas as [Node's EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) - **Functional:** methods don't rely on `this` - **Great Name:** somehow [mitt](https://npm.im/mitt) wasn't taken -- cgit v1.2.3 From 7a0650207a7332987211e82e3c29b9a3948df197 Mon Sep 17 00:00:00 2001 From: Paul Mitchell-Gears Date: Tue, 17 Jan 2017 09:29:55 +0000 Subject: fix spelling --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f9f34c4..46ec287 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ - **Microscopic:** weighs less than 200 bytes gzipped - **Useful:** a wildcard `"*"` event type listens to all events -- **Famliar:** same names & ideas as [Node's EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) +- **Familiar:** same names & ideas as [Node's EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) - **Functional:** methods don't rely on `this` - **Great Name:** somehow [mitt](https://npm.im/mitt) wasn't taken -- cgit v1.2.3 From 84642ddfe2d54dac51d1432bbf69493dd4fce136 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Tue, 17 Jan 2017 11:44:33 -0500 Subject: Add demo, change support to IE9+ --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 46ec287..4f099a7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ npm travis

- ## Why Mitt? - **Microscopic:** weighs less than 200 bytes gzipped @@ -15,11 +14,14 @@ - **Functional:** methods don't rely on `this` - **Great Name:** somehow [mitt](https://npm.im/mitt) wasn't taken -> Mitt was made for the browser, but works in any JavaScript runtime. It has no dependencies and only uses basic language features. It probably works in Internet Explorer 5. +> Mitt was made for the browser, but works in any JavaScript runtime. It has no dependencies and supports IE9+. -* * * +## Examples & Demos +[Preact + Mitt Codepen Demo](http://codepen.io/developit/pen/rjMEwW?editors=0110) + +* * * ## Usage -- cgit v1.2.3 From 5f5367b7a573e4ecb3285c9b4512cffa5b54d544 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Tue, 17 Jan 2017 11:54:43 -0500 Subject: Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f099a7..9afe385 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,11 @@ ## Examples & Demos -[Preact + Mitt Codepen Demo](http://codepen.io/developit/pen/rjMEwW?editors=0110) + + Preact + Mitt Codepen Demo +
+ preact + mitt preview +
* * * -- cgit v1.2.3 From d93148ffbdc8c9a5253918cfe680581dd5bbcd70 Mon Sep 17 00:00:00 2001 From: Florian Goße Date: Wed, 18 Jan 2017 10:51:35 +0100 Subject: chore(editorconfig): add editorconfig --- .editorconfig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..81adf67 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = True + +[*] +end_of_line = lf + +[*.js] +indent_style = tab + +[*.md] +indent_style = space +indent_size = 2 + +[{package.json,.travis.yml}] +indent_style = space +indent_size = 2 -- cgit v1.2.3 From f6c582d8658a562dc84d4e5558ff8838491347de Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Wed, 18 Jan 2017 12:17:53 -0500 Subject: Suggested some changes --- .editorconfig | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.editorconfig b/.editorconfig index 81adf67..ac0adb7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,15 +1,17 @@ -root = True +root = true [*] -end_of_line = lf - -[*.js] indent_style = tab +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true -[*.md] +[{package.json,.*rc,*.yml}] indent_style = space indent_size = 2 -[{package.json,.travis.yml}] +[*.md] +trim_trailing_whitespace = false indent_style = space indent_size = 2 -- cgit v1.2.3 From 961e8c41e9d5310283c04034b11d64542208d614 Mon Sep 17 00:00:00 2001 From: Steve Kellock Date: Thu, 19 Jan 2017 10:51:30 -0500 Subject: Moves babel config out of package.json. --- .babelrc | 3 +++ .npmignore | 1 + package.json | 6 ------ 3 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 .babelrc create mode 100644 .npmignore diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..5a7bc07 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": [ "es2015", "stage-0" ] +} diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..99f9a95 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +.babelrc \ No newline at end of file diff --git a/package.json b/package.json index 16b5b83..04b6af4 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,6 @@ "src", "dist" ], - "babel": { - "presets": [ - "es2015", - "stage-0" - ] - }, "eslintConfig": { "parser": "babel-eslint", "extends": "eslint:recommended", -- cgit v1.2.3 From bb460b3b93ed93507686b428f6c27e8f0e24ef64 Mon Sep 17 00:00:00 2001 From: John Oksasoglu Date: Fri, 20 Jan 2017 10:32:24 -0800 Subject: Fix typo in package.json `homepage` field The `homepage` url started with `httsp` instead of `https`, but this fixes that. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 16b5b83..6f76b0b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "eventemitter", "pubsub" ], - "homepage": "httsp://github.com/developit/mitt", + "homepage": "https://github.com/developit/mitt", "authors": [ "Jason Miller " ], -- cgit v1.2.3 From e69cfe09f007ee2350106ca5688542b83a9170e6 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Sun, 22 Jan 2017 13:34:15 -0500 Subject: remove npmignore, should be covered by files in package.json --- .babelrc | 2 +- .npmignore | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 .npmignore diff --git a/.babelrc b/.babelrc index 5a7bc07..eaf3238 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,3 @@ { - "presets": [ "es2015", "stage-0" ] + "presets": ["es2015", "stage-0"] } diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 99f9a95..0000000 --- a/.npmignore +++ /dev/null @@ -1 +0,0 @@ -.babelrc \ No newline at end of file -- cgit v1.2.3 From afb0bff7762386bfae2d42f4310d51196dd5f61a Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Sun, 22 Jan 2017 13:34:36 -0500 Subject: 1.0.1 --- README.md | 11 +++++------ package.json | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9afe385..c99c2d0 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,14 @@ ## Why Mitt? -- **Microscopic:** weighs less than 200 bytes gzipped -- **Useful:** a wildcard `"*"` event type listens to all events -- **Familiar:** same names & ideas as [Node's EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) -- **Functional:** methods don't rely on `this` -- **Great Name:** somehow [mitt](https://npm.im/mitt) wasn't taken +- **Microscopic:** weighs less than 200 bytes gzipped +- **Useful:** a wildcard `"*"` event type listens to all events +- **Familiar:** same names & ideas as [Node's EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) +- **Functional:** methods don't rely on `this` +- **Great Name:** somehow [mitt](https://npm.im/mitt) wasn't taken > Mitt was made for the browser, but works in any JavaScript runtime. It has no dependencies and supports IE9+. - ## Examples & Demos diff --git a/package.json b/package.json index 0d39c8e..a387049 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mitt", "amdName": "mitt", - "version": "1.0.0", + "version": "1.0.1", "description": "Tiny ~200b functional event emitter / pubsub.", "jsnext:main": "src/index.js", "main": "dist/mitt.js", -- cgit v1.2.3 From 9ffbcdc0a470246ed5fca539e70e42ae2cb50e39 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 24 Jan 2017 21:13:51 -0200 Subject: Add dependency status badge (#33) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c99c2d0..07aa84e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@
Mitt: tiny 200b functional event emitter / pubsub.
-
npm travis + npm travis dependencies Status

## Why Mitt? -- cgit v1.2.3 From 1fbe781649b09627935cd68f2446f3e1d572e3be Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Sun, 29 Jan 2017 14:11:06 -0200 Subject: improve readme and add license file (#35) --- LICENSE.md | 21 ++++++++++++++++ README.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 89 insertions(+), 16 deletions(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..3b90ec9 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Jason Miller + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 07aa84e..3141a88 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@

- mitt -
- Mitt: tiny 200b functional event emitter / pubsub. + mitt
npm travis dependencies Status

-## Why Mitt? +# Mitt + +> Tiny 200b functional event emitter / pubsub. - **Microscopic:** weighs less than 200 bytes gzipped - **Useful:** a wildcard `"*"` event type listens to all events @@ -14,21 +14,42 @@ - **Functional:** methods don't rely on `this` - **Great Name:** somehow [mitt](https://npm.im/mitt) wasn't taken -> Mitt was made for the browser, but works in any JavaScript runtime. It has no dependencies and supports IE9+. +Mitt was made for the browser, but works in any JavaScript runtime. It has no dependencies and supports IE9+. -## Examples & Demos +## Table of Contents +- [Install](#install) +- [Usage](#usage) +- [Examples & Demos](#examples--demos) +- [API](#api) +- [Contribute](#contribute) +- [License](#license) - - Preact + Mitt Codepen Demo -
- preact + mitt preview -
+## Install -* * * +This project uses [node](http://nodejs.org) and [npm](https://npmjs.com). Go check them out if you don't have them locally installed. -## Usage +```sh +$ npm install --save mitt +``` + +Then with a module bundler like [rollup](http://rollupjs.org/) or [webpack](https://webpack.js.org/), use as you would anything else: + +```javascript +// using ES6 modules +import mitt from 'mitt' + +// using CommonJS modules +var mitt = require('mitt') +``` + +The [UMD](https://github.com/umdjs/umd) build is also available on [unpkg](https://unpkg.com): -After installing via `npm install --save mitt`: +```html + +``` +You can find the library on `window.mitt`. + +## Usage ```js import mitt from 'mitt' @@ -50,7 +71,13 @@ emitter.on('foo', onFoo) // listen emitter.off('foo', onFoo) // unlisten ``` -* * * +## Examples & Demos + + + Preact + Mitt Codepen Demo +
+ preact + mitt preview +
## API @@ -58,7 +85,7 @@ emitter.off('foo', onFoo) // unlisten Mitt: Tiny (~200b) functional event emitter / pubsub. -Returns **Mitt** +Returns **Mitt** #### on @@ -87,3 +114,28 @@ If present, `"*"` handlers are invoked prior to type-matched handlers. - `type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The event type to invoke - `event` **\[Any]** An event object, passed to each handler + +## Contribute +First off, thanks for taking the time to contribute! +Now, take a moment to be sure your contributions make sense to everyone else. + +### Reporting Issues +Found a problem? Want a new feature? First of all see if your issue or idea has [already been reported](../../issues). +If don't, just open a [new clear and descriptive issue](../../issues/new). + +### Submitting pull requests +Pull requests are the greatest contributions, so be sure they are focused in scope, and do avoid unrelated commits. + +- Fork it! +- Clone your fork: `git clone https://github.com//mitt` +- Navigate to the newly cloned directory: `cd mitt` +- Create a new branch for the new feature: `git checkout -b my-new-feature` +- Install the tools necessary for development: `npm install` +- Make your changes. +- Commit your changes: `git commit -am 'Add some feature'` +- Push to the branch: `git push origin my-new-feature` +- Submit a pull request with full remarks documenting your changes. + +## License + +[MIT License](LICENSE.md) © [Jason Miller](https://jasonformat.com/) -- cgit v1.2.3