You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, is it strictly required to call charRegex() within every invocation?
wouldn't it make sense to call charRegex() once and save it in the module scope?
The text was updated successfully, but these errors were encountered:
@missinglink the functions are not chain-able or part of a class.. so there's no scope. it's important for FP purposes that each function is completely isolated of others
I see what you mean, from a FP point of view its not ideal to have a function depend on state external to the scope of the function itself.
However I'm not sure what you mean by 'there's no scope', there is always a scope and in this case it would be a 'module scope' rather than a 'function scope' or 'global scope'?
My understanding is that bundlers will all recognise this dependency and handle it appropriately.
It seems to me that the performance advantage of not instantiating this very large regexp on every invocation outweights the dependency.
hi, is it strictly required to call
charRegex()
within every invocation?wouldn't it make sense to call
charRegex()
once and save it in the module scope?The text was updated successfully, but these errors were encountered: