Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'nother … AMD/Node/CommonJS/Browser boilerplate pattern #7

Open
mhulse opened this issue Aug 30, 2017 · 0 comments
Open

'nother … AMD/Node/CommonJS/Browser boilerplate pattern #7

mhulse opened this issue Aug 30, 2017 · 0 comments

Comments

@mhulse
Copy link
Owner

mhulse commented Aug 30, 2017

(function( factory ){
    if ( typeof define === 'function' && define.amd ) {
        // AMD
        define( ['jquery', 'datatables', 'datatables-editor'], factory );
    }
    else if ( typeof exports === 'object' ) {
        // Node / CommonJS
        module.exports = function ($, dt) {
            if ( ! $ ) { $ = require('jquery'); }
            factory( $, dt || $.fn.dataTable || require('datatables') );
        };
    }
    else if ( jQuery ) {
        // Browser standard
        factory( jQuery, jQuery.fn.dataTable );
    }
}(function( $, DataTable ) {
'use strict';
 
 


var
 
    create: function ( conf ) {
    },
 
    get: function ( conf ) {
    
    },
 
    set: function ( conf, val ) {
    },
 
    enable: function ( conf ) {
    },
 
    disable: function ( conf ) {
    },
 
    inst: function ( conf ) {
    },
    update: function ( conf, data ) {
    },
 
    focus: function ( conf ) {
    }
};
 
 
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant