resource-router-middleware icon indicating copy to clipboard operation
resource-router-middleware copied to clipboard

No ability to use private methods inside `route`

Open antonioMerkulov opened this issue 9 years ago • 2 comments

Could you please add possibility to use context inside route? Line 27.

     router[fn](url, route[key].bind(route));

antonioMerkulov avatar Sep 22 '16 12:09 antonioMerkulov

Seems reasonable. What's the purpose?

I'm curious if anyone was relying on the old context. Likely not..

developit avatar Sep 22 '16 12:09 developit

to make it able to branch request data handling. e.q.:


    list(req, res, next) {
        let {type} = req.query;
        return type === 'some-condition' ? this.doSome1(req, next, title) : this.doSome2(req, next, title);
    },

   doSome1() {},

   doSome2() {},

antonioMerkulov avatar Sep 26 '16 11:09 antonioMerkulov