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

Add default option to not automatically generate cleaver route names #4

Open
jordanh opened this issue Mar 18, 2016 · 0 comments
Open

Comments

@jordanh
Copy link
Contributor

jordanh commented Mar 18, 2016

Take this call signature:

export function createGetByIdRoute(routeBasename, acceptedKeys, getByIdPromise,
  modelKeyGetter = defModelKeyGetter,
  modelIdKey = defModelIdKey) { /* ... */ }

And this invocation:

  createGetByIdRoute(
    'users',
    ['createdAt', 'updatedAt', 'userId', 'email',
     'emailVerified', 'picture', 'name', 'nickname',
     'identities', 'loginsCount', 'blockedFor'],
    async (id) => CachedUser.getUserByUserId(id),
    (model, id) => model[id],
    'userId'
  )

It will generate a route called usersById which will surprise users if they aren't expecting it. By default, I don't think we should do this. Instead, after implementing #3, we should provide a default option that disables this behavior and instead enable this behavior only when the individual route generators are called from createRoutes().

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

1 participant