Code Monkey home page Code Monkey logo

alogs's Issues

关于一段代码的疑问?

先说声不好意思,在issue里提这样的问题
源码

var name = 'img_' + (+new Date());
        entry[name] = image;
        image.onload = image.onerror = function () {
            entry[name] =
                image =
                image.onload =
                image.onerror = null;
            delete entry[name];
        };

为什么要将 image 挂在entry对象上?然后是这个函数执行完后image不就销毁了吗?为什么还要通过监听onload和onerror来销毁?

start方法在哪儿定义的?

文档中有描述:
moduleTracker.start(fields) 同步方法(Sync)
alog('module.start', fields) 异步方法(Async)

这里面的start 是Tracker的方法吗?alogs.js的代码里没有发现?

请教个apply使用问题

    entry.p = entry.q = { // 接管之前的定义
        push: function (args) {
            entry.apply(entry, args);
        }
    };
    // 开始处理缓存命令
    for (var i = 0; i < items.length; i++) {
        entry.apply(entry, items[i]);
    }

上面的代码中entry.apply(entry, args);不是等同于entry(args);吗?为什么要通过apply方法调用呢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.