Closed flex-junhyuk closed 4 months ago
When there is array with objects with 3000+ items,
fxts flatMap causes 'Maximum call stack size exceeded'.
Array with objects are looks like this..
export const people1 = [ { idHash: "B1bpoJ9WOa", userIdHash: "EDjELJvboY", a: "HC00000", b: "lee", c: "880818-2020201", d: "level", e: "something", f: "abc", g: "aaaaa", h: "", i: "nominal", remarks: ["remark1", "remark2"], j: "cdcc", k: "2020-01-01", l: "common" }, ...3000
And I want to process this array into something..
const res: BB[] = pipe( people1, // fxts flatMap causes Maximum call stack size exceeded flatMap((item) => item.remarks ?? []), toArray );
These one causes error, but
const people = people1.flatMap((item) => item.remarks ?? []); const res2: BB[] = pipe(people, toArray);
These one is ok.
https://codesandbox.io/p/sandbox/fxts-flatmap-forked-zmpp79
Take a look my code snippet.
fxts flatMap should working good as native flatMap.
@fxts/core 0.25.0
@flex-junhyuk Thank you for reporting the error. Issue resolved in 0.26.0 :)
Bug Report
When there is array with objects with 3000+ items,
fxts flatMap causes 'Maximum call stack size exceeded'.
💻 Code
Array with objects are looks like this..
And I want to process this array into something..
These one causes error, but
These one is ok.
https://codesandbox.io/p/sandbox/fxts-flatmap-forked-zmpp79
Take a look my code snippet.
🙁 Actual behavior
fxts flatMap causes 'Maximum call stack size exceeded'.
🙂 Expected behavior
fxts flatMap should working good as native flatMap.
Version Information
@fxts/core 0.25.0