Is it possible to modify the already declared function in requirejs?

91 Views Asked by At

There was a task to write an extension that would complement some site functionality. And the function necessary to me looks like this:

define("lib/interface/leads/pipeline/unsorted/item", ["require", "jquery", "underscore", "twig", "cocktail", "lib/core/view", "lib/components/mail/api", "lib/components/base/confirm", "lib/components/base/player", "lib/interface/leads/pipeline/unsorted/mixins/unsorted_linking_up", "lib/utils/account/users"], function(e) {
"use strict";
// some code
//.....
return o.extend({
  // more some code
  //....
  acceptClick: function(e) {
          e.stopPropagation(),
          e.preventDefault(),
          this.$el.trigger("unsorted:accept:click"),
          this.model.accept({
              status_id: this.options.statuses[0]
          })
      }
 })
})

I have never worked with this framework, and I do not know whether it is possible to somehow rewrite or supplement the function from outside. If possible, I would like to know how. Thank you in advance!

UPD: Method requirejs.undef() - not work.

0

There are 0 best solutions below