Helper with array observer

I am trying to create a helper that is observing an array. When the array changes, I want the helper to reevaluate. I am using the helper in a checkbox input that is created as part of an #each structure. The helper determines the value of checked.

I can’t figure out how to set up the array observer correctly. Here is an Ember Twiddle with a simplification of what I have done.

Thanks for taking a look.


UPDATE: The twiddle above should now contain a working pattern for multiple checkboxes inside an #each, and with a check-all option, that does not use a model attribute to track the “checked” state.

This is what I have in the helper…

export default Helper.extend({
compute(container, item) {
	arrayWillChange() {
  ,arrayDidChange() {
return container.includes(item);


And this is where I’m calling it in the template…

	{{#each model.musketeers as |musketeer|}}
	<input type="checkbox" checked={{includes checkedItems musketeer}} onChange={{action "toggleSelection" musketeer}}/>{{}}

Okay… My coworker straightened me out:

import Helper from '@ember/component/helper'

export default Helper.extend({
	compute(params) {
    return params[0].includes(params[1]);
  ,arrayDidChange() {
  ,arrayWillChange() {}