bigBear713 / nb-common

Some common component, pipe, service based on angular.
https://bigbear713.github.io/nb-common/
MIT License
41 stars 6 forks source link

Provide a callFn pipe #36

Closed bigBear713 closed 1 year ago

bigBear713 commented 1 year ago

version: v16.1.0

We know using pipe in template can improve the performance。And pipe is essentially a function, will be called only when the params value has been changed. So I think it can provide a pipe to excute a function which be provided by developers, it will be more flexible because we don't need to defined a new pipe, we only should provide a function and using callFn pipe to excute it, then the function will be called only when the params value has been changed

bigBear713 commented 1 year ago

The first argument is the function will be called. The other arguments iare the function's params