{"action":"created","issue":{"url":"https://api.github.com/repos/tweenjs/tween.js/issues/390","repository_url":"https://api.github.com/repos/tweenjs/tween.js","labels_url":"https://api.github.com/repos/tweenjs/tween.js/issues/390/labels{/name}","comments_url":"https://api.github.com/repos/tweenjs/tween.js/issues/390/comments","events_url":"https://api.github.com/repos/tweenjs/tween.js/issues/390/events","html_url":"https://github.com/tweenjs/tween.js/issues/390","id":268606334,"number":390,"title":"Don't mutate object","user":{"login":"lukechilds","id":2123375,"avatar_url":"https://avatars0.githubusercontent.com/u/2123375?v=4","gravatar_id":"","url":"https://api.github.com/users/lukechilds","html_url":"https://github.com/lukechilds","followers_url":"https://api.github.com/users/lukechilds/followers","following_url":"https://api.github.com/users/lukechilds/following{/other_user}","gists_url":"https://api.github.com/users/lukechilds/gists{/gist_id}","starred_url":"https://api.github.com/users/lukechilds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukechilds/subscriptions","organizations_url":"https://api.github.com/users/lukechilds/orgs","repos_url":"https://api.github.com/users/lukechilds/repos","events_url":"https://api.github.com/users/lukechilds/events{/privacy}","received_events_url":"https://api.github.com/users/lukechilds/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-26T02:07:36Z","updated_at":"2017-10-26T03:48:29Z","closed_at":null,"author_association":"NONE","body":"Hey, I'm using tween.js to animate a React project and it's great, good work!\r\n\r\nThe only issue is I'm tweening state values. By default tween.js mutates the original object which causes problems in React. Is it possible to use tween.js without mutating the original object.\r\n\r\ne.g something like:\r\n\r\n```js\r\nconst obj = { opacity: 0 };\r\nnew TWEEN.Tween(obj)\r\n  \t.to({ opacity: 1 }, 200)\r\n    .onUpdate(val => {\r\n      console.log(val);\r\n      // { opacity: 0.1234 }\r\n      console.log(obj);\r\n      // { opacity: 0 }\r\n    });\r\n```"},"comment":{"url":"https://api.github.com/repos/tweenjs/tween.js/issues/comments/339543099","html_url":"https://github.com/tweenjs/tween.js/issues/390#issuecomment-339543099","issue_url":"https://api.github.com/repos/tweenjs/tween.js/issues/390","id":339543099,"user":{"login":"mikebolt","id":2136767,"avatar_url":"https://avatars1.githubusercontent.com/u/2136767?v=4","gravatar_id":"","url":"https://api.github.com/users/mikebolt","html_url":"https://github.com/mikebolt","followers_url":"https://api.github.com/users/mikebolt/followers","following_url":"https://api.github.com/users/mikebolt/following{/other_user}","gists_url":"https://api.github.com/users/mikebolt/gists{/gist_id}","starred_url":"https://api.github.com/users/mikebolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikebolt/subscriptions","organizations_url":"https://api.github.com/users/mikebolt/orgs","repos_url":"https://api.github.com/users/mikebolt/repos","events_url":"https://api.github.com/users/mikebolt/events{/privacy}","received_events_url":"https://api.github.com/users/mikebolt/received_events","type":"User","site_admin":false},"created_at":"2017-10-26T03:48:29Z","updated_at":"2017-10-26T03:48:29Z","author_association":"CONTRIBUTOR","body":"I was just working on something like this. I think you can accomplish this\nby carefully extending the Tween class. I will try to share my code with\nyou soon.\n\nOn Wed, Oct 25, 2017 at 7:07 PM Luke Childs <notifications@github.com>\nwrote:\n\n> Hey, I'm using tween.js to animate a React project and it's great, good\n> work!\n>\n> The only issue is I'm tweening state values. By default tween.js mutates\n> the original object which causes problems in React. Is it possible to use\n> tween.js without mutating the original object.\n>\n> e.g something like:\n>\n> const obj = { opacity: 0 };new TWEEN.Tween(obj)\n>   \t.to({ opacity: 1 }, 200)\n>     .onUpdate(val => {\n>       console.log(val);\n>       // { opacity: 0.1234 }\n>       console.log(obj);\n>       // { opacity: 0 }\n>     });\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/tweenjs/tween.js/issues/390>, or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/ACCavxAAQimmoyZbl6MDB-Y8QKG6rS2zks5sv-lpgaJpZM4QG6KK>\n> .\n>\n"}}
{"actor":{"display_login":"mikebolt"}}