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

Isomorphic router #14

Closed
wants to merge 1 commit into from
Closed

Isomorphic router #14

wants to merge 1 commit into from

Conversation

jhollingworth
Copy link
Contributor

Goal is to have a router that can be run the client and server so we can start building isomorphic applications (#13). You need to be able to

  • Define routes (regex/string) and what element should be rendered
  • Call the dispatcher when the router starts, before the router is about to change and after the route has changed
  • Have an action creator for navigating to routes
var Router = Marty.createRouter({
   '/some/:example': {
      handler: Something,
      name: Constants.Something
   } 
});

var RoutesStore = Router.Store;

var route = RoutesStore.getCurrentRoute(); // { route: '/some/:example', handler: Something, name: 'something', instance: .. }

var NavigationActionCreators = Router.NavigationActionCreators;

NavigationActionCreators.navigateTo(Constants.Something);

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

Successfully merging this pull request may close these issues.

None yet

1 participant