{"action":"created","issue":{"url":"https://api.github.com/repos/datorama/akita/issues/48","repository_url":"https://api.github.com/repos/datorama/akita","labels_url":"https://api.github.com/repos/datorama/akita/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/datorama/akita/issues/48/comments","events_url":"https://api.github.com/repos/datorama/akita/issues/48/events","html_url":"https://github.com/datorama/akita/issues/48","id":348791578,"node_id":"MDU6SXNzdWUzNDg3OTE1Nzg=","number":48,"title":"[Feature Request] IOC Container for Stores and @EntityStore Annotation","user":{"login":"oleersoy","id":1163873,"node_id":"MDQ6VXNlcjExNjM4NzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1163873?v=4","gravatar_id":"","url":"https://api.github.com/users/oleersoy","html_url":"https://github.com/oleersoy","followers_url":"https://api.github.com/users/oleersoy/followers","following_url":"https://api.github.com/users/oleersoy/following{/other_user}","gists_url":"https://api.github.com/users/oleersoy/gists{/gist_id}","starred_url":"https://api.github.com/users/oleersoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleersoy/subscriptions","organizations_url":"https://api.github.com/users/oleersoy/orgs","repos_url":"https://api.github.com/users/oleersoy/repos","events_url":"https://api.github.com/users/oleersoy/events{/privacy}","received_events_url":"https://api.github.com/users/oleersoy/received_events","type":"User","site_admin":false},"labels":[{"id":1011064374,"node_id":"MDU6TGFiZWwxMDExMDY0Mzc0","url":"https://api.github.com/repos/datorama/akita/labels/Nice%20to%20have","name":"Nice to have","color":"f9e189","default":false},{"id":961069651,"node_id":"MDU6TGFiZWw5NjEwNjk2NTE=","url":"https://api.github.com/repos/datorama/akita/labels/question","name":"question","color":"d876e3","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2018-08-08T16:03:53Z","updated_at":"2018-08-13T04:26:36Z","closed_at":null,"author_association":"NONE","body":"[X ] Feature request\r\n\r\n## Current\r\n\r\n```\r\nimport { Todo } from './todo.model';\r\nimport { EntityState, EntityStore } from '@datorama/akita';\r\n\r\nexport interface State extends EntityState<Todo> {}\r\n\r\n@Injectable({\r\n  providedIn: 'root'\r\n})\r\nexport class TodosStore extends EntityStore<State, Todo> {\r\n  constructor() {\r\n    super(initialState);\r\n  }\r\n}\r\n```\r\n## Future\r\n\r\n### Create Store\r\n```\r\nimport { Todo } from './todo.model';\r\nimport { EntityStore } from '@datorama/akita';\r\n\r\n@EntityStore(Todo)\r\nexport class TodosStore {\r\n    //Custom store methods\r\n    //The store could wrap the service instead of a service wrapping the store\r\n}\r\n```\r\n\r\n### Retrieve Store\r\n```\r\n//Akita IOC Container provides the stores\r\nlet todosStore:TodosStore = AkitaContainer.get(TodosStore); \r\n//If needed initialize state\r\ntodosStore.initializeState(intialState);\r\n```\r\n\r\n### Initialize State\r\n```\r\n//If needed initialize state\r\nAkitaContainer.get(TodosStore).initializeState(intialState);\r\n```\r\n\r\n### Query\r\n```\r\n;\r\nlet todos$: Observable<Todo[]> = AkitaContainer.get(TodosStore).selectAll();\r\nlet todos$: Observable<Todo[]> = AkitaContainer.get(TodosStore).select(filter:Function);\r\nlet todo: Observable<Todo> = AkitaContainer.get(TodosStore).select(id:ID);\r\n```\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/datorama/akita/issues/comments/412405454","html_url":"https://github.com/datorama/akita/issues/48#issuecomment-412405454","issue_url":"https://api.github.com/repos/datorama/akita/issues/48","id":412405454,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjQwNTQ1NA==","user":{"login":"NetanelBasal","id":6745730,"node_id":"MDQ6VXNlcjY3NDU3MzA=","avatar_url":"https://avatars1.githubusercontent.com/u/6745730?v=4","gravatar_id":"","url":"https://api.github.com/users/NetanelBasal","html_url":"https://github.com/NetanelBasal","followers_url":"https://api.github.com/users/NetanelBasal/followers","following_url":"https://api.github.com/users/NetanelBasal/following{/other_user}","gists_url":"https://api.github.com/users/NetanelBasal/gists{/gist_id}","starred_url":"https://api.github.com/users/NetanelBasal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NetanelBasal/subscriptions","organizations_url":"https://api.github.com/users/NetanelBasal/orgs","repos_url":"https://api.github.com/users/NetanelBasal/repos","events_url":"https://api.github.com/users/NetanelBasal/events{/privacy}","received_events_url":"https://api.github.com/users/NetanelBasal/received_events","type":"User","site_admin":false},"created_at":"2018-08-13T04:26:36Z","updated_at":"2018-08-13T04:26:36Z","author_association":"CONTRIBUTOR","body":"Yes, you will lose intellisense.\r\n\r\nIt's just a dummy example. I will change it to `todoId`, thanks!"}}
{"actor":{"display_login":"NetanelBasal"}}