bedrock
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018
07:42 PM
Referencing function in non-component module from another non-component module
Hi, I'm new to Roku development.
I have a non-component module called http.brs that performs standard http functions eg GET, POST etc.
I have another module called api.brs that communicates with our back-end REST API, and which utilises http.brs
I can't see any way to explicitly tell api.brs that http.brs is a dependency, so is the only option to include both scripts in components or scenes that use api.brs?
ie instead of just including api.brs in a component and it resolving it's own dependencies like so:
<script type = "text/brightscript" uri="pkg:/source/api.brs"/>
I would have to also include http.brs explictly like so?
<script type = "text/brightscript" uri="pkg:/source/http.brs"/>
<script type = "text/brightscript" uri="pkg:/source/api.brs"/>
That seems like a bit of an oversight on Roku's part, so am I missing something or is there another way?
I have a non-component module called http.brs that performs standard http functions eg GET, POST etc.
I have another module called api.brs that communicates with our back-end REST API, and which utilises http.brs
I can't see any way to explicitly tell api.brs that http.brs is a dependency, so is the only option to include both scripts in components or scenes that use api.brs?
ie instead of just including api.brs in a component and it resolving it's own dependencies like so:
<script type = "text/brightscript" uri="pkg:/source/api.brs"/>
I would have to also include http.brs explictly like so?
<script type = "text/brightscript" uri="pkg:/source/http.brs"/>
<script type = "text/brightscript" uri="pkg:/source/api.brs"/>
That seems like a bit of an oversight on Roku's part, so am I missing something or is there another way?
2 REPLIES 2
bedrock
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2018
01:26 AM
Re: Referencing function in non-component module from another non-component module
Hi
Can anyone recommend the correct way to do this?
Can anyone recommend the correct way to do this?
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2018
02:20 PM
Re: Referencing function in non-component module from another non-component module
"bedrock" wrote:
I would have to also include http.brs explictly like so?<script type = "text/brightscript" uri="pkg:/source/http.brs"/>
<script type = "text/brightscript" uri="pkg:/source/api.brs"/>
I believe that is the only way to do it.
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.