<commit_before><template lang="pug">
  div
    auth-guard
      div(slot="auth")
        add-resource
        resource-filter
        resource-list
</template>

<script>
  import firebase from 'config/firebase';
  import store from 'config/store';
  import AddResource from 'components/pool/add-resource';
  import ResourceFilter from 'components/pool/resource-filter';
  import ResourceList from 'components/pool/resource-list';
  import AuthGuard from 'components/auth/auth-guard';

  let resourceRef;

  export default {
    created() {
      resourceRef = firebase
        .database()
        .ref('/resources');

      resourceRef.on('child_added', snapshot => {
        store.dispatch('ADD_RESOURCE', { resource: snapshot.val() });
      });

      resourceRef.on('child_removed', snapshot => {
        store.dispatch('REMOVE_RESOURCE', { resource: snapshot.val() });
      });
    },
    beforeDestroy() {
      resourceRef.off();
    },
    components: {
      AddResource,
      ResourceList,
      ResourceFilter,
      AuthGuard,
    },
  };
</script><commit_msg>Name component<commit_after><template lang="pug">
  div
    auth-guard
      div(slot="auth")
        add-resource
        resource-filter
        resource-list
</template>

<script>
  import firebase from 'config/firebase';
  import store from 'config/store';
  import AddResource from 'components/pool/add-resource';
  import ResourceFilter from 'components/pool/resource-filter';
  import ResourceList from 'components/pool/resource-list';
  import AuthGuard from 'components/auth/auth-guard';

  let resourceRef;

  export default {
    name: 'resource-pool',
    created() {
      resourceRef = firebase
        .database()
        .ref('/resources');

      resourceRef.on('child_added', snapshot => {
        store.dispatch('ADD_RESOURCE', { resource: snapshot.val() });
      });

      resourceRef.on('child_removed', snapshot => {
        store.dispatch('REMOVE_RESOURCE', { resource: snapshot.val() });
      });
    },
    beforeDestroy() {
      resourceRef.off();
    },
    components: {
      AddResource,
      ResourceList,
      ResourceFilter,
      AuthGuard,
    },
  };
</script>
{'fraction_non_alphanumeric': 0.1328125, 'fraction_numerical': 0.0, 'mean_word_length': 2.7729636048526864, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '4713393', 'n_tokens_mistral': 614, 'n_tokens_neox': 607, 'n_words': 124}