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

Instantiating engines by passing the Engine constructor into resourceful.use() #43

Closed
wants to merge 3 commits into from

Conversation

richmarr
Copy link
Contributor

It looks like resourceful.engines contains a map of engine constructors, so resourceful.use() should really take a constructor rather than an object.

So you can do this:

var Engine = require('my-engine').Engine;
resourceful.use( Engine, {
    my:'config',
    goes:'in here'
});

Otherwise you'd have to instantiate the Engine then pass it in, which wouldn't fit the method any more.

Assuming this is a just a bug, so changed the validation from 'object' to 'function' and added tests to that effect. I may be missing something though.

@indexzero
Copy link
Member

@richmarr Yes this is just a bug. I'll cherry-pick in the relevant commits.

indexzero added a commit that referenced this pull request Jun 20, 2012
@indexzero
Copy link
Member

Cherry-picked. Thanks!

@indexzero indexzero closed this Jun 20, 2012
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

Successfully merging this pull request may close these issues.

None yet

2 participants