{"action":"created","issue":{"url":"https://api.github.com/repos/mobxjs/mobx/issues/84","repository_url":"https://api.github.com/repos/mobxjs/mobx","labels_url":"https://api.github.com/repos/mobxjs/mobx/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/mobxjs/mobx/issues/84/comments","events_url":"https://api.github.com/repos/mobxjs/mobx/issues/84/events","html_url":"https://github.com/mobxjs/mobx/issues/84","id":124497383,"number":84,"title":"How integrate with Meteor Tracker example?","user":{"login":"bySabi","id":6242574,"avatar_url":"https://avatars.githubusercontent.com/u/6242574?v=3","gravatar_id":"","url":"https://api.github.com/users/bySabi","html_url":"https://github.com/bySabi","followers_url":"https://api.github.com/users/bySabi/followers","following_url":"https://api.github.com/users/bySabi/following{/other_user}","gists_url":"https://api.github.com/users/bySabi/gists{/gist_id}","starred_url":"https://api.github.com/users/bySabi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bySabi/subscriptions","organizations_url":"https://api.github.com/users/bySabi/orgs","repos_url":"https://api.github.com/users/bySabi/repos","events_url":"https://api.github.com/users/bySabi/events{/privacy}","received_events_url":"https://api.github.com/users/bySabi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mobxjs/mobx/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":71,"created_at":"2015-12-31T19:26:26Z","updated_at":"2016-08-01T13:11:07Z","closed_at":"2016-04-22T20:32:40Z","body":"Hello @mweststrate.\r\n\r\nI'm  trying to use/integrate mobservable with Meteor.\r\n\r\nCommented code is tested and working.\r\nThis a sample of current proof of concept code:\r\n\r\n```\r\nvar afiliado = mobservable.observable(function() {\r\n    var afiliado;\r\n    Tracker.autorun(function() {\r\n      // HARDCODE MongoID for test only\r\n      afiliado = Orgz.collections.Afiliados.findOne({_id: 'EbPM2uWJhbd8rZP8P'});\r\n    });\r\n    return afiliado;\r\n});\r\n\r\nViewPersona = mobservableReact.observer(React.createClass({\r\n/*\r\n  mixins: [ReactMeteorData],\r\n  getMeteorData() {\r\n    Meteor.subscribe(\"afiliados\", this.props.id);\r\n    return {afiliado: Orgz.collections.Afiliados.findOne(this.props.id)};\r\n  },\r\n*/\r\n  render() {\r\n  //  return <ViewPersona_ afiliado={this.data.afiliado} />;\r\n    return <ViewPersona_ afiliado={afiliado} />;\r\n  }\r\n}));\r\n\r\nViewPersona_ = React.createClass({\r\n  render() {\r\n    return <AfiliadoTabs afiliado={this.props.afiliado} />;\r\n  }\r\n});\r\n```\r\n\r\n\"mobviously\" I don´t get a plain object on `afiliado` var, just: `ComputedObservable[[m#1] (current value:'undefined')]`\r\n\r\nis possible do this ? what is the way?\r\n\r\nThanks for your time and happy new year!!!\r\n"},"comment":{"url":"https://api.github.com/repos/mobxjs/mobx/issues/comments/236576067","html_url":"https://github.com/mobxjs/mobx/issues/84#issuecomment-236576067","issue_url":"https://api.github.com/repos/mobxjs/mobx/issues/84","id":236576067,"user":{"login":"markoshust","id":437029,"avatar_url":"https://avatars.githubusercontent.com/u/437029?v=3","gravatar_id":"","url":"https://api.github.com/users/markoshust","html_url":"https://github.com/markoshust","followers_url":"https://api.github.com/users/markoshust/followers","following_url":"https://api.github.com/users/markoshust/following{/other_user}","gists_url":"https://api.github.com/users/markoshust/gists{/gist_id}","starred_url":"https://api.github.com/users/markoshust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markoshust/subscriptions","organizations_url":"https://api.github.com/users/markoshust/orgs","repos_url":"https://api.github.com/users/markoshust/repos","events_url":"https://api.github.com/users/markoshust/events{/privacy}","received_events_url":"https://api.github.com/users/markoshust/received_events","type":"User","site_admin":false},"created_at":"2016-08-01T13:11:06Z","updated_at":"2016-08-01T13:11:06Z","body":"@jmaguirrei I think what you are experienced was a concern of mine, please see the last comment at https://github.com/meteor-space/tracker-mobx-autorun/issues/5#issuecomment-236375354\r\n\r\nI'm worried that over-subscribing to data will cause a lot of listeners that never get cleaned up. When a component mounts, the autorun should be started, and when it unmounts, the autorun should be stopped.\r\n\r\nI think there should be start/stop functionality on mounting/unmounting... no? The subscribe should be in the start function, not within the autorun. Technically, on any state change, it is creating a new subscriber (whether it's a performance issue or not is another question, perhaps not, but I think technically it should be outside of the autorun). I'm also using SubsManager but this should be setup in a manner which works with or without.\r\n\r\nI think you should really be destructuring your store object like so in your contianer:\r\n\r\n    const { a, b } = store;\r\n    <List a={a} />\r\n    <List2 b={b} />\r\n\r\ninstead of passing the entire store to your presentational components. You should be setting up your presentation components to not reference Store, so they just work off props and be used if store is used or not."}}
{"actor":{"display_login":"markoshust"}}