<commit_before>import { createSelector } from 'reselect';

const getTactics = state => state.entities.tactics;

export const tacticsSelector = createSelector(
  [getTactics], tactics => tactics.items.map(id => tactics.byId[id]),
);<commit_msg>Add tacticDetailsSelector that returns denormalized data<commit_after>import { denormalize } from 'normalizr';
import { createSelector } from 'reselect';
import { tacticSchema } from '../constants/Schemas';

const getTactics = state => state.entities.tactics;
const getTeams = state => state.entities.teams;

export const tacticsSelector = createSelector(
  [getTactics], tactics => tactics.items.map(id => tactics.byId[id]),
);

export const tacticsDetailsSelector = createSelector(
  [getTactics, getTeams],
  (tactics, teams) => denormalize(
    tactics.items, [tacticSchema],
    { tactics: tactics.byId, teams: teams.byId },
  ),
);
{'fraction_non_alphanumeric': 0.13068181818181818, 'fraction_numerical': 0.0, 'mean_word_length': 5.62406015037594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2939890', 'n_tokens_mistral': 269, 'n_tokens_neox': 272, 'n_words': 64}