Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Permitir que SafeFn retorne o valor da função interna #30

Open
paulobrumatti opened this issue May 23, 2019 · 0 comments
Open

Permitir que SafeFn retorne o valor da função interna #30

paulobrumatti opened this issue May 23, 2019 · 0 comments

Comments

@paulobrumatti
Copy link
Collaborator

Eu gostaria de ser capaz de aproveitar a segurança do SafeFn para fazer operações perigosas, nas quais eu gostaria de retornar o valor para a função mãe.

Exemplo:

1 - Diretamente
var imgName = analyticsHelper.safeFn('Função', function(helper) {
return helper.wrap('img').nodes[0].src.split('/').pop();
});

2 - Indiretamente
var getImageName = analyticsHelper.safeFn('Função', function(helper) {
return helper.wrap('img').nodes[0].src.split('/').pop();
}, { immediate: false });
var imgName = getImageName();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant