Skip to content

Commit

Permalink
wrapped in UMD pattern to work with both a server export and in a def…
Browse files Browse the repository at this point in the history
…ine AMD syntax
  • Loading branch information
Robert Martone authored and Robert Martone committed Nov 29, 2012
1 parent 5c864b9 commit 4fa02d2
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/fiber.js
@@ -1,11 +1,24 @@
// Fiber.js 1.0.4
// @Author: Kirollos Risk
// @author: Kirollos Risk
//
// Copyright (c) 2012 LinkedIn.
// All Rights Reserved. Apache Software License 2.0
// http://www.apache.org/licenses/LICENSE-2.0

( function( global ) {
(function (root, factory) {
if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else {
// Browser globals (root is window)
root.Fiber = factory();
}
}(this, function () {

// Baseline setup
// --------------
Expand All @@ -32,7 +45,7 @@
}

// The base `Fiber` implementation.
function Fiber(){};
function Fiber(){}

// ###Extend
//
Expand Down Expand Up @@ -230,19 +243,5 @@
return Fiber;
};

// Common JS
// --------------

// Export `Fiber` to Common JS Loader
if( module && typeof module.exports !== 'undefined' ) {
if( typeof module.setExports === 'function' ) {
module.setExports( Fiber );
} else if( module.exports ) {
module.exports = Fiber;
}
} else {
global.Fiber = Fiber;
}

// Establish the root object: `window` in the browser, or global on the server.
})( this );
return Fiber;
}));

0 comments on commit 4fa02d2

Please sign in to comment.