-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Computenextstep learner #984
Conversation
Codecov Report
@@ Coverage Diff @@
## learner #984 +/- ##
===========================================
+ Coverage 92.79% 92.87% +0.08%
===========================================
Files 236 235 -1
Lines 3149 3185 +36
===========================================
+ Hits 2922 2958 +36
Misses 227 227
Continue to review full report at Codecov.
|
@@ -7,8 +7,7 @@ export type ViewedResource = { | |||
}; | |||
|
|||
export type Step = { | |||
current: number, | |||
total: number | |||
current: number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on se fait un currentStep:int
non ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non, car ça demanderait de repasser sur toutes les progressions actuelles (vu que c'est dans le state initial) :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
y aura du menage pour les engine version 2 : )
f45d4d7
to
e2fb2c9
Compare
import head from 'lodash/fp/head'; | ||
import pipe from 'lodash/fp/pipe'; | ||
import unset from 'lodash/fp/unset'; | ||
import {pipe, head, get, unset} from 'lodash/fp'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour le tree-shaking, utilise require('lodash/fp/pipe')
& co
|
||
const getSlidePool = ( | ||
config: Config, | ||
slidePools: Array<{chapterId: string, slides: Array<Slide>}>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ça pourrait être une Map et non un Array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En fait non. On préfère s'assurer de l'ordre plutôt qu'avoir une contrainte d'unicité sur le chapterId.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jai eu la meme remarque, @jfmengels m'a fait la meme reponse ;)
40fc803
to
64089ba
Compare
@@ -50,6 +50,8 @@ export const getCurrentContent = state => { | |||
return getContent(type, ref)(state); | |||
}; | |||
|
|||
export const getContentInfo = pipe(getCurrentContent, get('info')); | |||
export const getNbSlides = pipe(getContentInfo, get('nbSlides')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const getNbSlides = pipe(getContentInfo, get('nbSlides'));
->
export const getNbSlides = pipe(getCurrentContent, get('info.'nbSlides'));
Tu peux virer getContentInfo vu que tu l'utilises pas. Si on rajoute de nouvelles informations plus tard, on pourra voir ça à ce moment.
import chaptersData from './chapters.data'; | ||
import levelsData from './levels.data'; | ||
import {findById} from './slides'; | ||
|
||
const toMap = reduce((map, object) => map.set(object._id, object), new Map()); | ||
const toMap = reduce((map, object) => map.set(object._id, object)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu aurais aussi pu faire
const toMap = data => reduce((map, object) => map.set(object._id, object), new Map(), data);
Ce permet d'éviter de changer chapters et levels
No description provided.