On the env-updated event, do callbacks
774663
def call_env_updated(cls, kb_app,
                         sphinx_app: Sphinx,
                         sphinx_env: BuildEnvironment):

        
        for callback in EventAction.get_callbacks(kb_app, SphinxEvent.EU):
            callback(kb_app, sphinx_app, sphinx_env)
273239
def _set_env(self, env):
        
        for callback in self.callbacks:
            if callable(getattr(callback, '_set_env', None)):
                callback._set_env(env)
404078
function onActivateEvent() {
         var _updateLayerFn = this.updateLayer.bind(this); // register to the viewport change notification


         this.vpChangeHdlr = me.event.subscribe(me.event.VIEWPORT_ONCHANGE, _updateLayerFn);
         this.vpResizeHdlr = me.event.subscribe(me.event.VIEWPORT_ONRESIZE, this.resize.bind(this));
         this.vpLoadedHdlr = me.event.subscribe(me.event.LEVEL_LOADED, function () {
           // force a first refresh when the level is loaded
           _updateLayerFn(me.game.viewport.pos);
         }); // in case the level is not added to the root container,
         // the onActivateEvent call happens after the LEVEL_LOADED event
         // so we need to force a first update

         if (this.ancestor.root !== true) {
           this.updateLayer(me.game.viewport.pos);
         }
       }
70776
function updateCheck() {
    // CASE: The check will not happen if your NODE_ENV is not in the allowed defined environments.
    if (_.indexOf(allowedCheckEnvironments, process.env.NODE_ENV) === -1) {
        return Promise.resolve();
    }

    return api.settings.read(_.extend({key: 'next_update_check'}, internal))
        .then(function then(result) {
            const nextUpdateCheck = result.settings[0];

            // CASE: Next update check should happen now?
            // @NOTE: You can skip this check by adding a config value. This is helpful for developing.
            if (!config.get('updateCheck:forceUpdate') && nextUpdateCheck && nextUpdateCheck.value && nextUpdateCheck.value > moment().unix()) {
                return Promise.resolve();
            }

            return updateCheckRequest()
                .then(updateCheckResponse)
                .catch(updateCheckError);
        })
        .catch(updateCheckError);
}
225286
def handle_callback(hook, event, *data)
      to = machine.events_map.move_to(event.event_name, event.from, *data)
      trans_event = TransitionEvent.new(event.event_name, event.from, to)
      callable    = create_callable(hook)

      if hook.is_a?(Async)
        defer(callable, trans_event, *data)
      else
        callable.(trans_event, *data)
      end
    end
51770
def __callbacks(self, msg):
            ''''''
            if self.callback:
                self.callback(msg, *self.callback_args, **self.callback_kwargs)
996144
public function getCallback($env = null)
    {
        $env = $env ?: $this->running_env;
        return isset($this->callbacks[$env]) ? $this->callbacks[$env] : null;
    }
576121
function _runEventCallback($canvas, layer, eventType, callbacks, arg) {
	// Prevent callback from firing recursively
	if (callbacks[eventType] && layer._running && !layer._running[eventType]) {
		// Signify the start of callback execution for this event
		layer._running[eventType] = true;
		// Run event callback with the given arguments
		callbacks[eventType].call($canvas[0], layer, arg);
		// Signify the end of callback execution for this event
		layer._running[eventType] = false;
	}
}
623341
def add_done_callback(self, fn):  # pylint: disable=invalid-name
        
        if self._operation.done:
            _try_callback(self, fn)
        else:
            self._queue.put(dill.dumps(fn))
            if self._process is None:
                self._process = mp.Process(target=self._execute_tasks)
                self._process.start()
215219
function(params) {
    var success = function(result) {
      if (!EventHandlers.hasOwnProperty(result.eventName)) {
        return;
      }

      for (var index in EventHandlers[result.eventName]) {
        EventHandlers[result.eventName][index].apply(undefined, [result.value]);
      }
    };

    exec(success, null, PLUGIN_NAME, "init", [params]);
  }
1067533
def update_callback
      @update_proc.call

      # Accept and eval commands if in console mode
      if @console
        if STDIN.ready?
          cmd = STDIN.gets
          begin
            res = eval(cmd, TOPLEVEL_BINDING)
            STDOUT.puts "=> #{res.inspect}"
            STDOUT.flush
          rescue SyntaxError => se
            STDOUT.puts se
            STDOUT.flush
          rescue Exception => e
            STDOUT.puts e
            STDOUT.flush
          end
        end
      end

    end
476376
def OnUpdate(self, event):
        """"""

        if wx.ID_UNDO in self.id2menuitem:
            undo_item = self.id2menuitem[wx.ID_UNDO]
            undo_item.Enable(undo.stack().canundo())

        if wx.ID_REDO in self.id2menuitem:
            redo_item = self.id2menuitem[wx.ID_REDO]
            redo_item.Enable(undo.stack().canredo())

        event.Skip()
1260591
function changeHandler(eventOptions = {}) {
    const { key, silent } = eventOptions;
    const def = defs.get(this);

    if (key && key in def.keys && !silent) {
        triggerOne(this, 'set', eventOptions);
        triggerOne(this, 'modify', eventOptions);
    }
}
369144
def on_modified(self, event):
        
        if os.path.isdir(event.src_path):
            return

        logger.debug("file modified: %s", event.src_path)

        name = self.file_name(event)

        try:
            config = yaml.load(open(event.src_path))
            self.target_class.from_config(name, config)
        except Exception:
            logger.exception(
                "Error when loading updated config file %s", event.src_path,
            )
            return

        self.on_update(self.target_class, name, config)
1335141
function updateDOMListeners (oldVnode, vnode) {
	  if (!oldVnode.data.on && !vnode.data.on) {
	    return
	  }
	  var on = vnode.data.on || {};
	  var oldOn = oldVnode.data.on || {};
	  var add = vnode.elm._v_add || (vnode.elm._v_add = function (event, handler, capture) {
	    vnode.elm.addEventListener(event, handler, capture);
	  });
	  var remove = vnode.elm._v_remove || (vnode.elm._v_remove = function (event, handler) {
	    vnode.elm.removeEventListener(event, handler);
	  });
	  updateListeners(on, oldOn, add, remove, vnode.context);
	}
912042
def OnUndo(self, event):
        """"""

        statustext = undo.stack().undotext()
        undo.stack().undo()

        # Update content changed state
        try:
            post_command_event(self.grid.main_window,
                               self.grid.ContentChangedMsg)
        except TypeError:
            # The main window does not exist any more
            pass

        self.grid.code_array.result_cache.clear()

        post_command_event(self.grid.main_window, self.grid.TableChangedMsg,
                           updated_cell=True)

        # Reset row heights and column widths by zooming
        self.grid.actions.zoom()

        # Change grid table dimensions
        self.grid.GetTable().ResetView()

        # Update TableChoiceIntCtrl
        shape = self.grid.code_array.shape
        post_command_event(self.main_window, self.grid.ResizeGridMsg,
                           shape=shape)

        # Update toolbars
        self.grid.update_entry_line()
        self.grid.update_attribute_toolbar()

        post_command_event(self.grid.main_window, self.grid.StatusBarMsg,
                           text=statustext)
46661
function bindEvent ( namespacedEvent, callback ) {
            scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || [];
            scope_Events[namespacedEvent].push(callback);

            // If the event bound is 'update,' fire it immediately for all handles.
            if ( namespacedEvent.split('.')[0] === 'update' ) {
                scope_Handles.forEach(function(a, index){
                    fireEvent('update', index);
                });
            }
        }