Closed crazy4groovy closed 5 years ago
return
isn’t supported outside of functions, the solution would be to wrap every function in an if
, but that would make the code ugly so I won’t do it.
Another solution would be using const xy = function xy() {}
to define functions instead of function xy{}
, which prevents hoisting of functions.
Hi, cool lib! I think you can save a bit of js memory around
if (isSupported) {
https://github.com/instantpage/instant.page/blob/master/instantpage.js#L11You don't need to define any functions at all in this case, since they are never referenced. Maybe just an early exit from the module would be better? eg.
if (!isSupported) return