Combo
  • Combo.js
  • Guide
    • Concepts
      • Lifecycle Methods
  • APIs
    • Component
      • canMount
      • canUnmount
      • canUpdate
      • created
      • el
      • isMounted
      • mount
      • mounting
      • mounted
      • on
      • props
      • receiving
      • received
      • refresh
      • render
      • rendered
      • state
      • unmount
      • unmounting
      • unmounted
      • update
      • updated
      • updating
  • FAQs
    • Props
    • State
    • Events
    • Ajax
Powered by GitBook
On this page
  • Parameters
  • Returns
  • Example
  1. APIs
  2. Component

canUpdate

Invoked before the update process.

Parameters

  • prev: object The previous component state.

Returns

boolean True if the component should update its state.

Example

const Example = new class extends Component {
    created() {
        this.update({});
    }
    canUpdate() {
        return false;
    }
    updating() {
        console.log("This life cycle method will never fire.");
    }
}();

Example.mound(document.getElementById("root");
<div id="root"></div>
PreviouscanUnmountNextcreated

Last updated 6 years ago