Midwest Dev Chat

MidwestDevChat.com

  • The newest 15 messages in the super-cool #frontend channel.

  • 11/01 16:35:34 Albert: Anyone have any suggestions for a cloud-based licensing provider? Something like what you'd see from JetBrains products, etc. Management of keys that can only be used for a given amount of time, can't be used more than once, etc.
  • 11/15 19:06:15 Marge: Any Vue folks around? Trying to figure out if I'm not understanding something correctly. I have a component property called `currentHomeInitialState`, and when my component is mounted it sets that value equal to a computed property, `currentHome`. Essentially I want to store the original state of that object so I can compare against it later. There's a form dialog on the page that's bound to `currentHome`, and what I'm trying to do is watch for changes to any values in the form since it was originally loaded, and prompt to save if they have. What's happening is that as the form values change (aka `currentHome`), so does the value of `currentHomeInitialState`. So I guess my question is, if I have `this.currentHomeInitialState = this.currentHome` inside of my `mounted` function, will it bind those 2 values forever, rather than just once as I'm expecting? I cannot figure out why the initial state value would change, there's nothing else going on to set those 2 things to be equal
  • 11/15 19:07:23 Marge: (I'm really hoping my luck holds out that 5 minutes after posting a question here I figure it out stuck_out_tongue)
  • 11/15 19:31:44 Deanna: If it's an object, are you doing a deep copy or just setting `currentHomeInitialState` to point to the same object?
  • 11/15 19:39:30 Marge: I guess I'm not totally sure the answer to that
  • 11/15 19:39:45 Marge: It is an object
  • 11/15 19:48:29 Marge: But that gave me something to work with, I think I see what I'm doing wrong. Thanks!
  • 11/16 09:31:55 Marge: I used lodash deepClone to create a copy of the object, which works great and solves my first problem. An interesting issue now is that when lodash copies the object, it converts one of the properties, which is an empty array `[]`, to an empty string `""` so when I go to compare the objects using lodash isEqual it evaluates to false
  • *Usernames have been changed to protect the innocent.
We're currently 1111 members strong. Join us!
Request Invite

Check out all the cool channels!

Join the conversation!