Grainular-Nord / nord

A lightweight (8kb), dependency-free JavaScript Frontend Framework
https://nordjs.dev
MIT License
7 stars 0 forks source link

[FEATURE ENHANCEMENT]: Mapped Grain should use `combined` to improve performance #68

Closed IamSebastianDev closed 9 months ago

IamSebastianDev commented 9 months ago

Feature Enhancement Description

Feature Overview: Combining the mapped and combined function

Current Functionality: Right now, the mapped grain function is working similar to the combined function, with a predefined run function.

Suggested Enhancement: Change the implementation of mapped to use combined internally

Benefits of Enhancement: Better inner subscription handling

Additional Information

Possible Implementation 💡

export const mapped: MappedFn = <Dependencies extends ReadonlyGrain<any>[]>(
    grains: Dependencies
): ReadonlyGrain<GrainValue<Dependencies>> => {
    return combined(grains, (values) => [...values])
}

github-actions[bot] commented 9 months ago

:tada: This issue has been resolved in version 1.11.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: