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
I’ve noticed that the new fn helper does partially apply the arguments of combined fn calls. I’ve set up a sandbox to demonstrate (be sure to open your browser console): https://codesandbox.io/s/wnkp6m7mww (It’s worth noting that the ember-on-modifier modifier addon is not working with this sandbox (unsure why), so I'm falling back to an onclick handler). I expected the handler to recieve arguments of both fn calls, similar to how the action handle applys arguments. Instead the second argument is undefined.
The RFC was not updated to explicitly cover this use case and states that fn is essentially just essentially calling this.passedMethod.call(…arguments);, which wouldn’t necessarily result in the argument application behavior that the action helper provides. It's possible that this is the intended functionality, however, after some Discord discussion, it seems that this may be a bug that warrants some investigation.
Here's a sandbox with a more realistic example (again, be sure to open your console): https://codesandbox.io/s/2x9wyyqjxj I’ve intentionally left the Stars component very generic. That is, I’m not passing a movie ID in as a component argument; this component could be used for rating something other than movies. Using the action helper, the consumer can pass down an action with additional arguments (the movie id) and the Stars component can utilize that action and pass along its own arguments. The fn helper does not function in the same way, and the second argument in the handleRatingUpdate action handler results in undefined.
The text was updated successfully, but these errors were encountered:
I’ve noticed that the new
fn
helper does partially apply the arguments of combinedfn
calls. I’ve set up a sandbox to demonstrate (be sure to open your browser console): https://codesandbox.io/s/wnkp6m7mww (It’s worth noting that theember-on-modifier
modifier addon is not working with this sandbox (unsure why), so I'm falling back to an onclick handler). I expected the handler to recieve arguments of bothfn
calls, similar to how theaction
handle applys arguments. Instead the second argument is undefined.The RFC was not updated to explicitly cover this use case and states that
fn
is essentially just essentially callingthis.passedMethod.call(…arguments);
, which wouldn’t necessarily result in the argument application behavior that theaction
helper provides. It's possible that this is the intended functionality, however, after some Discord discussion, it seems that this may be a bug that warrants some investigation.Here's a sandbox with a more realistic example (again, be sure to open your console): https://codesandbox.io/s/2x9wyyqjxj I’ve intentionally left the
Stars
component very generic. That is, I’m not passing a movie ID in as a component argument; this component could be used for rating something other than movies. Using theaction
helper, the consumer can pass down an action with additional arguments (the movie id) and theStars
component can utilize that action and pass along its own arguments. Thefn
helper does not function in the same way, and the second argument in thehandleRatingUpdate
action handler results inundefined
.The text was updated successfully, but these errors were encountered: