<commit_before>import store from './STORE.jsx';
// ACTIONS for APP component

// sync
export const SET_FILTER = 'SET_FILTER';
export const UPDATE_MAP_BOUNDS = 'UPDATE_MAP_BOUNDS';
// async
export const CREATE_PLURB = 'CREATE_PLURB';
export const GET_PLURBS = 'GET_PLURBS';
export const LOAD_PLURBS = 'LOAD_PLURBS';
export const FETCHING = 'FETCHING';

// CREATORS--------------------
// sync
export function setFilter(filter) {
  return { type: SET_FILTER, filter }
}

// async
export function updateMapBounds(mapBounds) {
  return { type: UPDATE_MAP_BOUNDS, mapBounds }
}

export function createPlurb(plurb, mapBounds) {
  fetch('/api/plurb', {
    method: 'POST',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json',
    },
    credentials: 'same-origin',
    body: JSON.stringify(plurb),
  }).then((body) => {
    store.dispatch(getPlurbs({topicId:plurb.topicId, mapBounds}));
  }).catch((error) => {
    console.error(error);<commit_msg>(feat) Implement synchronous authenticate action<commit_after>import store from './STORE.jsx';
// ACTIONS for APP component

// sync
export const SET_FILTER = 'SET_FILTER';
export const UPDATE_MAP_BOUNDS = 'UPDATE_MAP_BOUNDS';
export const AUTHENTICATE = 'AUTHENTICATE';
// async
export const CREATE_PLURB = 'CREATE_PLURB';
export const GET_PLURBS = 'GET_PLURBS';
export const LOAD_PLURBS = 'LOAD_PLURBS';
export const FETCHING = 'FETCHING';

// CREATORS--------------------
// sync
export function setFilter(filter) {
  return { type: SET_FILTER, filter }
}

export function authenticate(verified) {
  return { type: AUTHENTICATE, verified}
}
// async
export function updateMapBounds(mapBounds) {
  return { type: UPDATE_MAP_BOUNDS, mapBounds }
}

export function createPlurb(plurb, mapBounds) {
  fetch('/api/plurb', {
    method: 'POST',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json',
    },
    credentials: 'same-origin',
    body: JSON.stringify(plurb),
  }).then((body) => {
    store.dispatch(getPlurbs({topicId:plurb.topicId, mapBounds}));
  }).catch((error) => {
    console.error(error);
{'fraction_non_alphanumeric': 0.15529411764705883, 'fraction_numerical': 0.0, 'mean_word_length': 4.037914691943128, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3181242', 'n_tokens_mistral': 717, 'n_tokens_neox': 698, 'n_words': 158}