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

and support for mapping function #1

Open
Guria opened this issue Feb 17, 2016 · 0 comments
Open

and support for mapping function #1

Guria opened this issue Feb 17, 2016 · 0 comments

Comments

@Guria
Copy link
Contributor

Guria commented Feb 17, 2016

Original problem

import compute from 'cerebral-module-entities/compute'

export function groupProjects(path) {
  return function (get) {
    return (get(compute('entities.groupProjects', path)) || []).map((project) => { 
      ...project,
      key: 'val'
    })
  }
}

Suggestions

support 3 signatures:
compute(entityType, pathToIdsList, relations)
compute(entityType, pathToIdsList, mapFunction)
compute(entityType, pathToIdsList, relations, mapFunction)

Or we have to use an object instead

compute({
  type,
  path,
  relations,
  map
})
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