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

Generate paths by name #74

Closed
wants to merge 5 commits into from
Closed

Generate paths by name #74

wants to merge 5 commits into from

Conversation

sanches89
Copy link
Contributor

Implements a method that generate a path by name.
Works like this:

// ./routes/index.js
export default [
  { name: 'home', path: '/', action: ... },
  { name: 'product', path: '/products/:id': action: ... }
];

// ./somefile.js
import { href } from 'universal-route';
import routes from './routes';

console.log(href(routes, 'product', { id: 1 }));
// /products/1

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b651ca0 on sanches89:master into 071e624 on kriasoft:master.

Copy link
Collaborator

@langpavel langpavel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide some examples?
Can you provide example how to extract factory function?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 6b54ec4 on sanches89:master into 071e624 on kriasoft:master.

@frenzzy frenzzy mentioned this pull request Mar 23, 2017
@frenzzy frenzzy closed this in #83 Mar 25, 2017
@frenzzy frenzzy mentioned this pull request Mar 27, 2017
20 tasks
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.

3 participants