<commit_before>import {getScheduler} from './scheduler-assignment'
import performElementUpdate from './perform-element-update'
import componentsWithPendingUpdates from './components-with-pending-updates'

export default function updateElement (component) {
  let scheduler = getScheduler()

  if (!componentsWithPendingUpdates.has(component)) {
    componentsWithPendingUpdates.add(component)
    scheduler.updateDocument(function () {
      componentsWithPendingUpdates.delete(component)<commit_msg>Document updateElement<commit_after>import {getScheduler} from './scheduler-assignment'
import performElementUpdate from './perform-element-update'
import componentsWithPendingUpdates from './components-with-pending-updates'

// This function receives a component that has already been associated with an
// element via a previous call to `createElement` and updates this element by
// calling `render` on the component.
//
// It uses the scheduler to defer this update until the next animation frame,
// and will only perform one update of a given component in a given frame. This
// means you can call `updateElement` repeatedly in a given tick without causing
// redundant updates.
//
// Returns a promise that will resolve when the requested update has been
// completed.
export default function updateElement (component) {
  let scheduler = getScheduler()

  if (!componentsWithPendingUpdates.has(component)) {
    componentsWithPendingUpdates.add(component)
    scheduler.updateDocument(function () {
      componentsWithPendingUpdates.delete(component)
{'fraction_non_alphanumeric': 0.0814624759461193, 'fraction_numerical': 0.0, 'mean_word_length': 5.16600790513834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3268470', 'n_tokens_mistral': 375, 'n_tokens_neox': 376, 'n_words': 134}