christianalfoni / reactive-router

A reactive wrapper around Page JS
MIT License
46 stars 1 forks source link

Replaced the router internals with page.js #2

Closed garth closed 9 years ago

garth commented 9 years ago

Not sure what the silent option was doing, but this seems to work without it.

Options can be passed to the router which are forwarded to page.js.

To switch over to pushstate simply remove the hashbang: true option.

fragments and url have been maintained to support existing stuff, but perhaps should be removed?

christianalfoni commented 9 years ago

Hi there!

Great! The silent thing is for changing the url without triggering the the callback. This is helpful when traversing state using for example Cerebral.

Let me just look into that and make a new push to support it!

I agree on removing fragments and url, let me just check that too, thanks! :)

garth commented 9 years ago

set is now checking if the url changed before calling the router so perhaps the silent thing is not necessary any more. I've tested in my app with both <a href="/home">home</a> and signals.urlChanged('/home') and they both seem to work ok.

christianalfoni commented 9 years ago

Ah, yeah, normally it works, but with Cerebral you can go back and replay state changes. The problem is that you do not want to trigger the callbacks when remembering state because they have already been triggered, but you do want to display the url in the addressbar... if that makes sense :-)

christianalfoni commented 9 years ago

Creating a new push now, got it working. Removed the fragments and url. Will create a new release. Thanks for this!