You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The more I think about whenIn(cohort[, selector], callback) the more I think it's misleading. Reading whenIn suggests that we can call this function before the enrolment has occurred, e.g.
This looks like it should work because when implies that we'll check the cohort at some point in the future (whenever the user is enrolled). However, it will not work because whenIn looks at the cohort the user is currently enrolled into.
To make this more obvious I think we should rename whenIn to something like:
ifCohortIs, ifCohortMatches, ifEnrolledInto.
Open to suggestions- we just need to get across that this method will execute some callback when the cohort matches.
Or we could alter the code so that the order the methods are called in is not important. I like this idea the best.
The text was updated successfully, but these errors were encountered:
The more I think about
whenIn(cohort[, selector], callback)
the more I think it's misleading. ReadingwhenIn
suggests that we can call this function before the enrolment has occurred, e.g.This looks like it should work because
when
implies that we'll check the cohort at some point in the future (whenever the user is enrolled). However, it will not work becausewhenIn
looks at the cohort the user is currently enrolled into.To make this more obvious I think we should rename
whenIn
to something like:ifCohortIs
,ifCohortMatches
,ifEnrolledInto
.Open to suggestions- we just need to get across that this method will execute some callback when the cohort matches.
Or we could alter the code so that the order the methods are called in is not important. I like this idea the best.
The text was updated successfully, but these errors were encountered: