Skip to content

Commit

Permalink
Restructure API based on feedback
Browse files Browse the repository at this point in the history
This restructures the API so that customAttributes is the default.
  • Loading branch information
matthewp committed Feb 1, 2017
1 parent d0879c5 commit 054dae2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Add as a script tag:
Or import as an ES module:

```js
import { customAttributes } from 'custom-attributes';
import customAttributes from 'custom-attributes';
```

Or you can just import the CustomAttributeRegistry and create your own instance:
Expand Down
2 changes: 2 additions & 0 deletions attr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
(function () {
'use strict';

var forEach = Array.prototype.forEach;

class CustomAttributeRegistry {
constructor(ownerDocument){
if(!ownerDocument) {
Expand Down
2 changes: 1 addition & 1 deletion global.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { customAttributes, CustomAttributeRegistry } from './index.js';
import customAttributes, { CustomAttributeRegistry } from './index.js';

window.customAttributes = customAttributes;
window.CustomAttributeRegistry = CustomAttributeRegistry;
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import CustomAttributeRegistry from './registry.js';

var customAttributes = new CustomAttributeRegistry(document);

export { customAttributes, CustomAttributeRegistry }
export { customAttributes as default, CustomAttributeRegistry }
2 changes: 2 additions & 0 deletions registry.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var forEach = Array.prototype.forEach;

class CustomAttributeRegistry {
constructor(ownerDocument){
if(!ownerDocument) {
Expand Down

0 comments on commit 054dae2

Please sign in to comment.