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
{{ message }}
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
Now that leaves us with how to log the bare (inter)action functions.
If you imagine defining an action like SignUp that then uses some browser interactions, it might look like this at the moment:
constSignUp=(as: name=>({ actor })=>actor.attemptsTo(Follow.link("Sign up"),FillIn.fieldLabelled("Username").with(name))}
We won't be able to log any of these, because (as far as I understand it) we can't ask the action function what the names of the wrapping functions / constants were that it was created by.
But we also want to keep the mechanism of defining these actions super lightweight, because the whole essence of this pattern, as I see it, is having lots and lots of these small compose-able actions, so we want to have minimal overhead on making new ones.
So could we make it possible to do this?
const{ SignUp }=actions({SignUp: ({as: name=>({ actor })=>actor.attemptsTo(Follow.link("Sign up"),FillIn.fieldLabelled("Username").with(name))})})
The actions method would return a proxy that decorated the action function with a description built from the calls that had been made through the proxy to access the builder functions. That way we'd then be able to log it nicely, and we'd minimise the barrier to building new actions.
WDYT? Am I making sense?
The text was updated successfully, but these errors were encountered:
@jbpros I wanted to start a conversation about logging.
I've been thinking we could configure a logger like this:
Then we should be able to see task descriptions coming out:
Now that leaves us with how to log the bare (inter)action functions.
If you imagine defining an action like
SignUp
that then uses some browser interactions, it might look like this at the moment:We won't be able to log any of these, because (as far as I understand it) we can't ask the action function what the names of the wrapping functions / constants were that it was created by.
But we also want to keep the mechanism of defining these actions super lightweight, because the whole essence of this pattern, as I see it, is having lots and lots of these small compose-able actions, so we want to have minimal overhead on making new ones.
So could we make it possible to do this?
The
actions
method would return a proxy that decorated the action function with adescription
built from the calls that had been made through the proxy to access the builder functions. That way we'd then be able to log it nicely, and we'd minimise the barrier to building new actions.WDYT? Am I making sense?
The text was updated successfully, but these errors were encountered: