question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

update function for settings

See original GitHub issue

It is only possible to update the complete object like: this.settings = {....}

It is not possible to update an single parameter like:

this.settings.noDataMessage = "No User found for ..."

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
Newancommented, Jan 25, 2019

Hello,

I have the same problem again. Normal it works, but updating it into an arrow function like API call or timeout does not work:

Example:

ngOnInit() {
    setTimeout(() => {
      console.log("Not work!!");
      this.changeSettings("not work!");
    }, 2000);
    
      console.log("Work!!");
      this.changeSettings();
  }

  changeSettings(name: string) {
    this.mySettings.noDataMessage =  name;
    this.settings = Object.assign({}, this.mySettings)
  }
2reactions
Ezeoncommented, May 6, 2017

You are right. You can only change the whole object. You can of course get around this by having a separate object for your settings which you can change and then assigning a copy of this object to this.settings. That’s at least what I do in my application.

Lets say you create a object mySettings: mySettings = {} // remember to add all the properties you need You can then do some changes to it: e.g. mySettings.data.actions.add = false; You then need to assign a copy of it to this.settings: this.settings = Object.assign({}, mySettings)

Read more comments on GitHub >

github_iconTop Results From Across the Web

update-function-configuration — AWS CLI 1.27.37 Command ...
Description¶. Modify the version-specific settings of a Lambda function. When you update a function, Lambda provisions an instance of the function and its ......
Read more >
Manage additional Windows Update settings - Microsoft Learn
In this article, learn about additional settings to control the behavior of Windows Update.
Read more >
azure - Updating remote Function App Application Settings in C#
I am currently writing a scheduled Function App that in part will need to update an Application Setting of a different Function App...
Read more >
How to update application settings of an Azure Functions App ...
How to update application settings of Azure Functions using AzDO ... Add your desired app settings as variables. Remember the name of your ......
Read more >
Unable to update the Functions Extensions Version in Azure ...
Unable to update the Functions Extensions Version in Azure Application Settings because you may not be signed into Visual Studio with the appropriate....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found