I have only some experience with CoffeeScript and this is my first approach to Atom packages, so I hope this question is not too basic. Any advice about good practices and patterns would be great also :).
I’m trying to achieve something basic. I’m running an async task, and when it finishes, I want to notify my view. event-kit seemed a good choice, as I’ve seen it has been used in several plugins. It’d be something similar to:
myClass.onSomethingHasBeenPerformed (data) -> @performSomethingOnTheView(data)
An easy solution has been:
myClass = new MyClass(this, ...) myClass.onDataReceived (data) -> data.view.performSomethingOnTheView(data.data)
In this case data is a more complex object that returns the view, that was previously supplied to the object. That does the job.
I guess that there is an easier way of doing this. I feel like I’m missing something.
Thanks a lot for your time!