Ankilan/src/actions/dictionary/create-dictionary.js
horhik 999b23f436 Create Filtered definitions and full version of It
Redux: parsedDictionary has 2 arrays. compounded and filtered.
	Filtered will use for first look at fields
2020-03-28 03:28:54 -03:00

14 lines
486 B
JavaScript

import {parseDictionary} from './parsing-dictionary';
import getAudio from '../api/word-sound';
import {compoundWithYDictionary} from './get-translate';
export const createDictionary = async apiRes => {
const word = apiRes.word;
const parsedDictionary = parseDictionary(apiRes);
const audio = await getAudio(word);
const compounded = await compoundWithYDictionary(parsedDictionary, word);
//TODO add shrinkToOneExample(compounded)
return {...compounded, sound: audio};
};