Ompa
Ompa3d ago

Using custom components in an app

Anyone have any experience with making custom components? I am wondering what is common practice when making exchanging info between the component and a script? Currently i am setting the output of the component to my "question" then a background script sees a change in the output and runs with that new output from the component. In the script that branches out to all those actions thats needed. Is there some easier way? I will give an example so its easier to undestand. Lets say i want a component to look up adresses. By default the component is in its search state, then by writing into a searchfield it will set an output and a background script will run with those perameters, eg {"action": "search_query", "query": "abc"}. the script will then do some things and will return something like {"action": "search_suggestion", "suggestions": [x, y, z]}, this will then trigger a recalculation of the component and it will see those perameters and rerender itself. This will go on in a "loop", back and forth where everything is stateless. I am wondering if there is an easier approach? Do people use APIs? In that case how, and can you use background scripts in an app for that? Any help is appreciated.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?