I鈥檝e noticed that the new fn helper does partially apply the arguments of combined fn calls. I鈥檝e set up a sandbox to demonstrate (be sure to open your browser console): https://codesandbox.io/s/wnkp6m7mww (It鈥檚 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(鈥rguments);, which wouldn鈥檛 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鈥檝e intentionally left the Stars component very generic. That is, I鈥檓 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.
Thanks for reporting! Definitely a bug, I'll also PR an update to the RFC prose to clarify the intent as well.
Thanks for the fix! Works after testing! 馃檶
Most helpful comment
Thanks for reporting! Definitely a bug, I'll also PR an update to the RFC prose to clarify the intent as well.