999b23f436
Redux: parsedDictionary has 2 arrays. compounded and filtered. Filtered will use for first look at fields
14 lines
486 B
JavaScript
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};
|
|
};
|