Skip to content

Commit

Permalink
♻️ Refactored separate context to resemble reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
Sawtaytoes committed Sep 23, 2021
1 parent 359de2c commit 60c7efd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/kevinTransducers/reduce.js
Expand Up @@ -33,7 +33,10 @@ const reduce = (
return (
(
(
typeof isComplete
typeof (
context
.isComplete
)
=== 'undefined'
)
|| (
Expand Down
17 changes: 12 additions & 5 deletions src/kevinTransducers/separate.js
Expand Up @@ -4,10 +4,7 @@ const separate = () => (
addCount((
nextReducer,
) => (
{
isComplete = true,
...context
},
context,
array,
count,
) => (
Expand All @@ -22,7 +19,17 @@ const separate = () => (
{
...context,
isComplete: (
isComplete
(
typeof (
context
.isComplete
)
=== 'undefined'
)
|| (
context
.isComplete
)
&& (
index
=== (
Expand Down

0 comments on commit 60c7efd

Please sign in to comment.