toddmotto / echo

Lazy-loading images with data-* attributes

Home Page:http://toddmotto.com/labs/echo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Commonjs way

lichunqiang opened this issue · comments

Hi, I have one question.

In this line: https://github.com/toddmotto/echo/blob/master/dist/echo.js#L8

why not do module.exports = factory(root) ?

By default , I will get a function , I should do call it to get the object.

this is by design?

Thanks!

+1 - To get around this one needs to invoke with var echo = require('echo')(window); and that does not seem to be be intended by the look of the documentation.