Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Support update loading #2

Open
kunyan opened this issue Mar 29, 2017 · 6 comments
Open

Support update loading #2

kunyan opened this issue Mar 29, 2017 · 6 comments
Assignees

Comments

@kunyan
Copy link
Owner

kunyan commented Mar 29, 2017

No description provided.

@kunyan kunyan self-assigned this Mar 29, 2017
@aberonni
Copy link

What is this? Do you need help with it?

@kunyan
Copy link
Owner Author

kunyan commented May 23, 2017

@aberonni I'm thinking about using typescript rewrite this project, but before it, PR welcome to resolve this issue.

Busy with daily work :(

@aberonni
Copy link

aberonni commented May 23, 2017 via email

@hellofantastic
Copy link

hellofantastic commented Jun 30, 2017

I think what was meant by this is adding componentWillReceiveProps?
For my use case I needed to add that as my options come dynamically in from another object

componentWillReceiveProps(props) {
    if (this.state.options !== props.options) {
      this.state.options = this.convertOptions(props.options);
    }
  }

@engineersamuel
Copy link
Collaborator

@hellofantastic since objects are never strictly equal that componentWillReceiveProps will always result in the call to this.convertOptions. So yes, that will accomplish what you want, but it will also result in that convertOptions being called every time. Might as well not even do the equality check, or do a lodash isEqual which may not be worth it for performance, but there probably is very little perf impact anyway on such a small call.

@hellofantastic
Copy link

hellofantastic commented Jul 2, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants