UNPKG

1.25 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/reducers/requested-clues.js"],"names":["requestedClues","config","array","action","type","requestedClueAction","slideRef","payload","content","ref"],"mappings":";;AAMA,eAAe,SAASA,cAAT,CAAwBC,MAAxB,EAAkF;AAC/F,SAAO,CAACC,KAAoB,GAAG,EAAxB,EAA4BC,MAA5B,KAA8D;AACnE,YAAQA,MAAM,CAACC,IAAf;AACE,WAAK,MAAL;AAAa;AACX,gBAAMC,mBAAmB,GAAIF,MAA7B;AACA,gBAAMG,QAAQ,GAAGD,mBAAmB,CAACE,OAApB,CAA4BC,OAA5B,CAAoCC,GAArD;AACA,iBAAO,UAASH,QAAT,EAAmBJ,KAAnB,IAA4BA,KAA5B,GAAoC,QAAOA,KAAP,EAAc,CAACI,QAAD,CAAd,CAA3C;AACD;;AACD;AACE,eAAOJ,KAAP;AAPJ;AASD,GAVD;AAWD","sourcesContent":["// @flow\n\nimport {concat, includes} from 'lodash/fp';\n\nimport type {Action, AskClueAction, Config} from '../types';\n\nexport default function requestedClues(config: Config): (Array<string>, Action) => Array<string> {\n return (array: Array<string> = [], action: Action): Array<string> => {\n switch (action.type) {\n case 'clue': {\n const requestedClueAction = (action: AskClueAction);\n const slideRef = requestedClueAction.payload.content.ref;\n return includes(slideRef, array) ? array : concat(array, [slideRef]);\n }\n default:\n return array;\n }\n };\n}\n"],"file":"requested-clues.js"}
\No newline at end of file