Ember Observer changes between Components

AI-generated summary

feabila is seeking help with Ember Observer changes between Components. He is trying to manipulate data between components by listening to changes triggered by an emoji picker. The desired workflow is:

  • Emoji Picker selects an emoji
  • My component listens to data change
  • Apply custom logic to the changed data

He has tried using appEvents and Ember services, but faces issues with scope loss and multiple component instances. He is also considering using observers and computed properties, but is yet to find a solution.

Yooo you all!

I have been fighting against some points which I’m not getting scalable solutions.

GOAL: I’m using Discourse Retort, so I’m modifying class with Plugin API, and my main target is when the user trigger the ´emojiSelected´

emojiPicker.onclick = (e) => { ....

And, what I’m trying to do is to manipulate data between component so, the idea would be:

  • Emoji Picker selects an emoji
  • My component listens to data change
  • And according to changes, I apply a custom logic over data changed above component

WAYS I HAVE TRIED:

  • I have tried with appEvents, I got the point of triggering inside another component, but my component in initial page is instanced around 20 times, and its scope loses in the way
  • And now I’m trying with a Ember.service
  • I know it’s around components states, like observers, computed properties, but I’m not getting solved.

Hope you guys can help me!

(Maybe, i will have to get sometime to give attention to Ember.js yoo)

Appreciate your help!
Best Regards,
Felipe