Git Product home page Git Product logo

jlinq-beta's People

Contributors

hugoware avatar ryanflorence avatar

Stargazers

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

Watchers

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

jlinq-beta's Issues

Sort issues with multiple keys

There is an issue with the sort method when multiple keys are specified and one of them has a desc flag ('-column').

Here is an example: http://jsfiddle.net/tFrGu/

I found changing line 715 from:

sorted = sorted.concat(records);

to:

sorted = (desc) ? records.concat(sorted) : sorted.concat(records);

fixes the issue.

wrap code for CommonJS environments and AMD

avoid generating globals if not needed and help to easily share code between environments.

here is a sample of a wrapper that would run "everywhere":

(function(def){
    def('jlink', function(){

        //jlinq code should go here

        return jlinq;
    });
}(
    // wrapper to run code everywhere
    // based on http://bit.ly/c7U4h5
    typeof require === 'undefined'?
        //Browser (regular script tag)
        function(name, factory){
            this[name] = factory();
        } :
        ((typeof exports === 'undefined')?
            //AMD
            function(name, factory){
                define(name, [], factory);
            } :
            //CommonJS
            function(name, factory){
                module.exports = factory();
            }
        )
));

wrapping the code like this would make it work on node.js, and to be loaded properly by AMD loaders like RequireJS, Dojo (v1.6+), curl.js, etc..

avoid generating more globals than needed

I think the library shouldn't generate multiple alias (jl, jlinq, jLinq), If the user wants to use an abbreviation it's better that he creates an alias inside his scope:

//closure to avoid polluting global scope and also generates alias to jlinq object 
//since I'm going to call it a lot of times
(function(jl){
     var result = jl.from(myData).contains('awesome', true).select();
     var result2 = jl.from...
}(jlinq));

or:

function doManyQueries(){
  var jl = jlinq; //local alias
  var result = jl.from(myData).contains('awesome', true).select();
  var result2 = jl.from...
}

if you have some legacy code that uses the alias is very easy to fix it, just by adding the property to the global scope, if documented it should be hard to follow:

//create global alias for backward compatibility
window.jl = jlinq;

as stated is now null.

I was really stupid to do what I did, i just realized how simple it was to change my data-getter library to work with it.

move out of beta?

This project was last updated 2 years ago, is this out of beta yet? ... and if so, can the other repo be removed or have this merged into it?

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.