arboleya / ways

Fluid router specially designed for complex page transitions and granular UI animations
MIT License
30 stars 2 forks source link

feature request: "referer" property on the request object #2

Open hems opened 10 years ago

hems commented 10 years ago

Could we have a "referer" property on the request object so we could take decisions based on the previously rendered page?

Maybe this is somehow available somehow ?

arboleya commented 10 years ago

You can access the history object though the middleware, it's not exactly what you need but I think you can achieve what you want.

https://github.com/serpentem/ways-browser/blob/master/src/history.coffee#L4

Just pay attention, there are two scenarios for that, this last one (#hashurls) is simply an array: https://github.com/serpentem/ways-browser/blob/master/src/hash.coffee#L12

arboleya commented 10 years ago
var ways = require('ways'),
    browser = require('ways-browser');

ways.use(browser);
ways('*', function(){
    console.log(browser.history);
});
hems commented 10 years ago

cool! tks for pointing the hash thing out