{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/store/issues/63","repository_url":"https://api.github.com/repos/aurelia/store","labels_url":"https://api.github.com/repos/aurelia/store/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/store/issues/63/comments","events_url":"https://api.github.com/repos/aurelia/store/issues/63/events","html_url":"https://github.com/aurelia/store/issues/63","id":363597209,"node_id":"MDU6SXNzdWUzNjM1OTcyMDk=","number":63,"title":"How to pluck a nested property within a repeat for over components","user":{"login":"timbo333","id":12150482,"node_id":"MDQ6VXNlcjEyMTUwNDgy","avatar_url":"https://avatars1.githubusercontent.com/u/12150482?v=4","gravatar_id":"","url":"https://api.github.com/users/timbo333","html_url":"https://github.com/timbo333","followers_url":"https://api.github.com/users/timbo333/followers","following_url":"https://api.github.com/users/timbo333/following{/other_user}","gists_url":"https://api.github.com/users/timbo333/gists{/gist_id}","starred_url":"https://api.github.com/users/timbo333/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timbo333/subscriptions","organizations_url":"https://api.github.com/users/timbo333/orgs","repos_url":"https://api.github.com/users/timbo333/repos","events_url":"https://api.github.com/users/timbo333/events{/privacy}","received_events_url":"https://api.github.com/users/timbo333/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-25T14:06:58Z","updated_at":"2018-09-26T07:10:26Z","closed_at":null,"author_association":"NONE","body":"**I'm submitting a feature request**\r\n\r\n* **Library Version:**\r\n1.1.0\r\n\r\n**Please tell us about your environment:**\r\n* **Operating System:**\r\nWindows [10]\r\n\r\n* **Node Version:**\r\n9.0.0\r\n\r\n* **NPM Version:**\r\n6.4.1\r\n\r\n* **JSPM OR Webpack AND Version**\r\nwebpack 3.10.0\r\n\r\n* **Browser:**\r\nChrome 69\r\n\r\n* **Language:**\r\nTypeScript 3.0.1\r\n\r\n* **What is the expected behavior?**\r\nHi!\r\n\r\nCurrently I'm working on an implementation of the aurelia store using state slices.\r\nDuring the development I ran into a problem which I would like to get your opinion on.\r\n\r\nContext:\r\nI got a state, which has some properties. These properties are lists, which contain new lists.\r\nSomewhere in a nested list, I added a state slice.\r\n\r\nexample structure:\r\n```\r\nState {\r\n\tproducts: products[],\r\n}\r\n\r\nProduct {\r\n\tid: number,\r\n\teditions: edition[],\r\n}\r\n\r\nEdition {\r\n\tid: number,\r\n\tname: string,\r\n}\r\n```\r\n\r\n\r\nWhen I try to get the slice using the connectTo decorater, I have the problem that I need to know the index of the product and edition.\r\nexample: store.state.pipe(pluck(\"products\", \"IndexOfProducts\", \"editions\", \"IndexOfEditions\", \"name\"))\r\n\r\nWithin the frontend files, I have different components to show each object.\r\nI am repeating of the Products, and then over the Editions.\r\nMeaning within an Edition component, I do not know which product I am.\r\n\r\nNow I need to find a way to get the index of the product that I currently am looping through.\r\nThe current solutions I found are:\r\n`this.store.state.pipe(pluck(\"products\", overrideContext.parentOverrideContext.$index.toString(), \"editions\", overrideContext.$index.toString(), \"name\")).subscribe((state);`\r\nUsing the bindingContext to find out which index the parent object has, so I can determine which one I should get from the list.\r\n\r\nThe other one is:\r\n```\r\nstore.state.pipe(map((state: IState) => state.products.find((prod) => prod.id === [SavedIdOfDesiredProduct])))\r\n\t\t\t\t.pipe(map((prod) => prod.editions.find((edition) => edition.id === [SavedIdOfDesiredEdition])))\r\n\t\t\t\t.pipe(pluck(\"name\"))\r\n```\r\n\t\t\t\t\r\nThe third solution is:\r\nUsing bindings on my components, to bind the correct object to the components.\r\nI do not prefer to use the solution, because this has a big performance impact in my application.\r\n\t\t\t\t\r\n\t\t\t\t\r\nNow all of these solution do not seem like the right option.\r\nSo I was wondering how you would try to tackle this problem."},"comment":{"url":"https://api.github.com/repos/aurelia/store/issues/comments/424609508","html_url":"https://github.com/aurelia/store/issues/63#issuecomment-424609508","issue_url":"https://api.github.com/repos/aurelia/store/issues/63","id":424609508,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDYwOTUwOA==","user":{"login":"zewa666","id":2861414,"node_id":"MDQ6VXNlcjI4NjE0MTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/2861414?v=4","gravatar_id":"","url":"https://api.github.com/users/zewa666","html_url":"https://github.com/zewa666","followers_url":"https://api.github.com/users/zewa666/followers","following_url":"https://api.github.com/users/zewa666/following{/other_user}","gists_url":"https://api.github.com/users/zewa666/gists{/gist_id}","starred_url":"https://api.github.com/users/zewa666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zewa666/subscriptions","organizations_url":"https://api.github.com/users/zewa666/orgs","repos_url":"https://api.github.com/users/zewa666/repos","events_url":"https://api.github.com/users/zewa666/events{/privacy}","received_events_url":"https://api.github.com/users/zewa666/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T07:10:26Z","updated_at":"2018-09-26T07:10:26Z","author_association":"MEMBER","body":"Awesome. Im on vacation this week but will definitely take a look next week back at my PC"}}
{"actor":{"display_login":"zewa666"}}