From 99cecfb5818e03c4b6876d6ecfd23da4291daebb Mon Sep 17 00:00:00 2001 From: Sem Bauke <46919888+Sembauke@users.noreply.github.com> Date: Fri, 23 Apr 2021 18:01:54 +0200 Subject: [PATCH] fix(curriculum): check if count gets incremented by function (#41856) * fix(curriculum): check if count gets incremented by function * update text * Update regex to look for whitespace * look for function globally * Apply suggestions from gikf Co-authored-by: gikf <60067306+gikf@users.noreply.github.com> Co-authored-by: gikf <60067306+gikf@users.noreply.github.com> --- .../redux/register-a-store-listener.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/03-front-end-libraries/redux/register-a-store-listener.md b/curriculum/challenges/english/03-front-end-libraries/redux/register-a-store-listener.md index 56d06178d0..d3d43ced41 100644 --- a/curriculum/challenges/english/03-front-end-libraries/redux/register-a-store-listener.md +++ b/curriculum/challenges/english/03-front-end-libraries/redux/register-a-store-listener.md @@ -32,7 +32,13 @@ assert( There should be a listener function subscribed to the store using `store.subscribe`. ```js -(getUserInput) => assert(getUserInput('index').includes('store.subscribe(')); +(getUserInput) => assert(getUserInput('index').match(/store\s*\.\s*subscribe\(/gm)); +``` + +The `store.subscribe` should receive a function. + +```js +(getUserInput) => assert(getUserInput('index').match(/(\s*function\s*)|(\s*\(\s*\)\s*=>)/gm)) ``` The callback to `store.subscribe` should also increment the global `count` variable as the store is updated.