Skip to content

Commit

Permalink
Renamed Promise to Bluebird to avoid confusion and possible conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Apr 24, 2015
1 parent a029c1e commit cab9a81
Show file tree
Hide file tree
Showing 26 changed files with 191 additions and 191 deletions.
8 changes: 4 additions & 4 deletions lib/Cache.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/// <reference path="../_references.d.ts" />
import Promise = require('bluebird');
import Bluebird = require('bluebird');

export = ICache;

interface ICache {
set<T>(key: string, value: T): Promise<T>;
get<T>(key: string): Promise<T>;
clear(key: string): Promise<boolean>
set<T>(key: string, value: T): Bluebird<T>;
get<T>(key: string): Bluebird<T>;
clear(key: string): Bluebird<boolean>
}
8 changes: 4 additions & 4 deletions lib/Core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Core.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions lib/Core.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference path="../_references.d.ts" />
import Promise = require('bluebird');
import Bluebird = require('bluebird');
import MongoDB = require('mongodb');
import _ = require('lodash');
import http = require('http');
Expand All @@ -17,7 +17,7 @@ import cache = require('./Cache');
import noOpCache = require('./caches/NoOpCache');
import memoryCache = require('./caches/MemoryCache');

var MongoConnectAsyc = Promise.promisify(MongoDB.MongoClient.connect);
var MongoConnectAsyc = Bluebird.promisify(MongoDB.MongoClient.connect);

export = Core;

Expand Down Expand Up @@ -135,9 +135,9 @@ class Core {
* @param {function(Error, Iridium.Core)} [callback] A callback to be triggered once the connection is established.
* @returns {Promise}
*/
connect(callback?: (err: Error, core: Core) => any): Promise<Core> {
connect(callback?: (err: Error, core: Core) => any): Bluebird<Core> {
var self = this;
return Promise.bind(this).then(function() {
return Bluebird.bind(this).then(function() {
if (self._connection) return self._connection;
return MongoConnectAsyc(self.url);
}).then(function (db: MongoDB.Db) {
Expand All @@ -150,9 +150,9 @@ class Core {
* Closes the active database connection
* @type {Promise}
*/
close(): Promise<Core> {
close(): Bluebird<Core> {
var self = this;
return Promise.bind(this).then(function() {
return Bluebird.bind(this).then(function() {
if (!self._connection) return this;
var conn: MongoDB.Db = self._connection;
self._connection = null;
Expand Down
14 changes: 7 additions & 7 deletions lib/Cursor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cab9a81

Please sign in to comment.