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

router history parameter? #31

Closed
joshski opened this issue Feb 23, 2015 · 6 comments
Closed

router history parameter? #31

joshski opened this issue Feb 23, 2015 · 6 comments

Comments

@joshski
Copy link
Member

joshski commented Feb 23, 2015

master mocha tests are failing because there is no window in the new history abstraction.

A router is currently defined like this:

h('div',
   router(
      router.page('/', function () {})
   )
)

So I was wondering, since both router and router.page need access to the history abstraction, do you see it as a global thing?

This might be better:

var router = plastiq.router({ history: myHistoryApi });

...

h('div',
   router(
      router.page('/', function () {})
   )
)

wdyt?

@refractalize
Copy link
Member

Yeah I think that's right. Though I want to have a simpler API for the common case (in browser) - not sure how we'd do both at the moment...

@joshski
Copy link
Member Author

joshski commented Feb 23, 2015

isn't that just a question of:

var router = plastiq.router;

vs...

var router = plastiq.router();

?

@joshski
Copy link
Member Author

joshski commented Feb 23, 2015

even the browser case probably wants to choose between hash or history, so perhaps:

var router = plastiq.router({ history: 'html5' });

@refractalize
Copy link
Member

yeah, perhaps having to create a router isn't so bad, even in the common case

@refractalize
Copy link
Member

I've done the behind the scenes work in ae58192, router is now an object. Havne't exposed it as plastiq.router yet, not can you create a new one yourself, but getting there.

@refractalize
Copy link
Member

API is var router = plastiq.router([options]), as of 1111247

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

No branches or pull requests

2 participants