Closed jupiter closed 13 years ago
yeah we could pass the request and make the sig (req, id, callback)
or something
Yes, we could, but I wouldn't want to break existing implementations. The only way to not to do that would be to make the sig (id, callback, req)
. What do you think?
yeah im fine with that, passing the id is slightly useful "sugar" for simple cases I suppose, so I guess we dont have to remove it or move it for now
Actually, I just pulled and found that you've already implemented it in backward-compatible way. (I didn't even realise you could do fn.length
to get the function's number of arguments.) Good job! Now it just needs to go into the documentation and into a release. Hope there's one soon. Thanks.
haha yeah just saw that too, forgot we had it
In the example
/forums/5/threads/12
the 'forum' can be loaded in the auto-loading load method. In the load method for a 'thread' there's no way to access the already loaded 'forum' - which could contain either neccesary information to load the 'thread', or could in fact contain the 'thread'.At the moment, the load method should look like
function (id, callback) {}
I don't see the need for passing theid
value, rather than the request. It only hides the key to the param containing the id. I realise that changing the arguments for this would break existing implementations and add a line of code to these implementations, e.g.var id = req.params.forum;
, but I can't see another way.