Giter VIP home page Giter VIP logo

dom-view-js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

earaya

dom-view-js's Issues

JavaScript property iteration is non-deterministic

Because JavaScript's property iteration is non-deterministic, any code that relies on context parameters is not guaranteed to work. For example, selector properties with function values and jQuery event property function values can both receive context, which is the current state of the underlying object. However, the current state is non-deterministic because of the JavaScript specification. Some browsers may retain the order as specified in code, but that behavior cannot be relied upon.

http://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order

Functions In A View Get Executed On Init

On the following sample:

var view = DomView({
    selector: ".container",
    button: {
        selector: "input[type='button']",
        disable: function (view) {
            this.prop("disabled", true);
            this.attr("value", view.message()); // Calls the wrapper function, not the real function defined below
        }
    },
    message: function () { // Only called once with its return value cached for subsequent wrapper function evaluations
        return "Disabled!";
    }
});

I'm seeing disable and message get executed when the button is "inited". Is this intended behavior?

This is problematic on cases where you're trying to attache a "disable" function to your button while a form is being submitted.

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.