Is it possible to get data from one package to another? #327
Replies: 1 comment 6 replies
-
|
Services are what you want. With a service, Package 2 doesn't need to be aware of Package 1 specifically; it just needs to be aware of the service that Package 1 exposes. (Any alternative to services would still involve Package 1 establishing some sort of convention and Package 2 following it, so they'd be coupled no matter what. At least with a service, you're establishing an abstract contract that any other package could theoretically provide in the future in Package 1’s place.) Package 1 would be the provider. Whatever method name you define should exist alongside your If you want to consult examples, look at how |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This involves two packages I’m writing.
Is it possible for one package to request and receie static data from another package? My thinking goes something like this?
I tried a simple
returnfrom the first package, but that was hoping for too much.I read something about services (https://flight-manual.atom-editor.cc/behind-atom/sections/interacting-with-other-packages-via-services/), but I couldn’t see how the example suited my needs. I also get the impression that the
package.jsonin Package 2 file needs to be aware of Package 1, which I’m trying to avoid.Is there a solution?
Beta Was this translation helpful? Give feedback.
All reactions