{"action":"created","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/848","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/848/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/848/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/848/events","html_url":"https://github.com/lhorie/mithril.js/issues/848","id":116806263,"number":848,"title":"Mithril and Immutable Data (Rendering other things besides DOM)","user":{"login":"veggiemonk","id":5487021,"avatar_url":"https://avatars.githubusercontent.com/u/5487021?v=3","gravatar_id":"","url":"https://api.github.com/users/veggiemonk","html_url":"https://github.com/veggiemonk","followers_url":"https://api.github.com/users/veggiemonk/followers","following_url":"https://api.github.com/users/veggiemonk/following{/other_user}","gists_url":"https://api.github.com/users/veggiemonk/gists{/gist_id}","starred_url":"https://api.github.com/users/veggiemonk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/veggiemonk/subscriptions","organizations_url":"https://api.github.com/users/veggiemonk/orgs","repos_url":"https://api.github.com/users/veggiemonk/repos","events_url":"https://api.github.com/users/veggiemonk/events{/privacy}","received_events_url":"https://api.github.com/users/veggiemonk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-13T16:52:21Z","updated_at":"2015-11-13T20:09:35Z","closed_at":null,"body":"I was wondering exactly the same thing as #830 (Rendering other things besides DOM).\r\n\r\nHow about persistent data structures library? If you use `immutable.js` or `mori.js`, you end up doing a lot of `.toJS()` if it's a Map or `.toArray()` if it is a List. Is there a way to let mithril know how to destructure immutable object? Most people had the same problem in `React`  ( both `React` and `Immutable.js` are from facebook, now `React` 0.14 can destructure immutable object ). \r\n\r\nImmutable objects also allow for **super fast diffing** because a reference to an immutable object, no matter how deep the data tree, can be compared by just `===`. If the reference to the immutable object is not changed, the whole object is exactly the same. Which is a powerful things to know when diffing. That allows for some optimizations with the method `shouldComponentUpdate` (in React). \r\n\r\nThis talk is by the author of `Immutable.js` is very interesting: [React.js Conf 2015 - Immutable Data and React](https://www.youtube.com/watch?v=I7IdS-PbEgI)\r\n\r\nThere are libraries like `Om` (made by David Nolen (@swannodette on github) who take advantages of immutable object and and a rendering library (in this case, again, React).\r\n\r\nCould we do the same with mithril? \r\n\r\nFor those who want to play with immutable data and mithril, this environment is ready: http://codepen.io/veggiemonk/pen/bVOKMY"},"comment":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments/156544141","html_url":"https://github.com/lhorie/mithril.js/issues/848#issuecomment-156544141","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/848","id":156544141,"user":{"login":"tivac","id":49545,"avatar_url":"https://avatars.githubusercontent.com/u/49545?v=3","gravatar_id":"","url":"https://api.github.com/users/tivac","html_url":"https://github.com/tivac","followers_url":"https://api.github.com/users/tivac/followers","following_url":"https://api.github.com/users/tivac/following{/other_user}","gists_url":"https://api.github.com/users/tivac/gists{/gist_id}","starred_url":"https://api.github.com/users/tivac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tivac/subscriptions","organizations_url":"https://api.github.com/users/tivac/orgs","repos_url":"https://api.github.com/users/tivac/repos","events_url":"https://api.github.com/users/tivac/events{/privacy}","received_events_url":"https://api.github.com/users/tivac/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T20:09:34Z","updated_at":"2015-11-13T20:09:34Z","body":"@tinchoz49 that's a pretty interesting idea! We've been experimenting w/ mithril & redux and found that the auto-redraw doesn't make much sense when you've got a redux store managing all application state. \r\n\r\nSomething like what you've proposed could make that way more straightforward."}}