Skip to content

Commit

Permalink
Merge branch 'feat/async-hooks'
Browse files Browse the repository at this point in the history
Conflicts:
	lib/Hooks.ts
	lib/Instance.ts
	lib/InstanceInterface.ts
	lib/ModelHandlers.ts
	test/Hooks.ts
  • Loading branch information
notheotherben committed Nov 17, 2015
2 parents fcddc72 + 1fe25e2 commit f09fa1b
Show file tree
Hide file tree
Showing 14 changed files with 163 additions and 81 deletions.
18 changes: 10 additions & 8 deletions benchmarks/mongodb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../_references.d.ts" />
/// <reference path="../typings/DefinitelyTyped/tsd.d.ts" />
import Iridium = require('../index');
import Bluebird = require('bluebird');
import MongoDB = require('mongodb');
Expand All @@ -14,9 +14,16 @@ interface UserDocument {

class User {
_id: string;

static collection = "user";
static schema = {
_id: String
};
}

@Iridium.Collection("userWrapped")
class WrappedUser extends Iridium.Instance<UserDocument, WrappedUser> {
@Iridium.Property(String, true)
_id: string;
}

Expand All @@ -25,13 +32,8 @@ class IridiumDB extends Iridium.Core {
super({ database: 'test' });
}

User = new Iridium.Model<UserDocument, User>(this,(model, doc) => doc, 'iridium', {
_id: false
});

UserWrapped = new Iridium.Model<UserDocument, WrappedUser>(this, WrappedUser, 'iridiumWrapped', {
_id: false
});
User = new Iridium.Model<UserDocument, User>(this, User);
UserWrapped = new Iridium.Model<UserDocument, WrappedUser>(this, WrappedUser);
}

console.log("Running benchmark with intensity of %d, %d samples", intensity, samples);
Expand Down
10 changes: 10 additions & 0 deletions benchmarks/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"experimentalDecorators": true
},
"files": [
"mongodb.ts"
]
}
2 changes: 1 addition & 1 deletion dist/lib/Instance.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/ModelCache.js

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

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

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

27 changes: 14 additions & 13 deletions dist/lib/ModelHandlers.js

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

Loading

0 comments on commit f09fa1b

Please sign in to comment.