It would be easier for multiple reason and purpose to actually have the ability to be notified when an new item is created. This would happen synchronously once the future with the item is resolved. The event is on the factory, but contain the item that was just created.
The child index should be actually a property on the model which should have been set already on the item object. So if you do have the item object, you also do have the model and you do have the index. Now, do we want for convenience purpose all this still exposed in the event ? I am ok with all of that in the object personally, and see no reason why not to put it, but maybe someone see restriction.
Btw I am not sure yet, who should actually take responsibility on emitting this event. I might add an helper to do the emit , but should it be the view that emit it or the factory ?
I... also not sure cause create() is asyncronous and this event should be emitted when create() is ready but it looks quite weird that factory event including some model-based information. if it's view side, it make sense that item holding an model information so may be it need to be emitted by view.
So I created an helper that you have to call to trigger the event. It isn't the best as that means binding don't have it. But I don't really see how to do the chain properly otherwise. I could have two function, one that you should not inherit from and does setup the event generation and the create function, who would be internal, but the only one that needs to be implemented. Still that sounds quite confusing. Do you guys have any idea ?