Skip to content

createLocalScope: accessing other computed properties #4

Open
@Tinoooo

Description

@Tinoooo

It would be nice if there is some way to access other computed properties in the first argument of createLocalScope. Right now, they are only accessible by this.computedName + '_'.

Here is a working example:

const myScope = createLocalScope({
  posts: ({ data }) => data.results || [],
  filteredPosts: ({ posts_ }) => posts_.filter(post => post.unread),
  data: false
});

Maybe something like this would be nicer:

const myScope = createLocalScope({
  posts: ({ data }) => data.results || [],
  filteredPosts: (, { posts }) => posts.filter(post => post.unread),
  data: false
});

Thank you :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions