Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<sup>**Social Media Photo by [chuttersnap](https://unsplash.com/@chuttersnap) on [Unsplash](https://unsplash.com/)**</sup>


This module integrates [augmentor](https://github.com/WebReflection/augmentor#readme) in [wickedElements](https://github.com/WebReflection/wicked-elements#readme) for a ~2.1K all-inclusive package and zero polyfills needed whatsoever.
This module integrates [augmentor](https://github.com/WebReflection/augmentor#readme) in [wickedElements](https://github.com/WebReflection/wicked-elements#readme) for a ~2.4K all-inclusive package and zero polyfills needed whatsoever.

The compatibility is the same as _wickedElements_, meaning IE11+ and other Desktop/Mobile browsers.

Expand Down
14 changes: 8 additions & 6 deletions cjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ const {define: $define, defineAsync: $async} = require('wicked-elements');
// default init with auto-augmented and invoked render
function init() { render(this); }

const define = (selector, definition) => $define(
selector,
typeof definition === 'function' ?
{init, render: definition} :
((definition.init || (definition.init = init)), definition)
);
const define = (selector, definition) => {
$define(
selector,
typeof definition === 'function' ?
{init, render: definition} :
((definition.init || (definition.init = init)), definition)
);
};
exports.define = define;

const defineAsync = (selector, callback) => {
Expand Down
14 changes: 8 additions & 6 deletions esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import {define as $define, defineAsync as $async} from 'wicked-elements';
// default init with auto-augmented and invoked render
function init() { render(this); }

export const define = (selector, definition) => $define(
selector,
typeof definition === 'function' ?
{init, render: definition} :
((definition.init || (definition.init = init)), definition)
);
export const define = (selector, definition) => {
$define(
selector,
typeof definition === 'function' ?
{init, render: definition} :
((definition.init || (definition.init = init)), definition)
);
};

export const defineAsync = (selector, callback) => {
$async(selector, callback, define);
Expand Down
Loading