R
Reactiflux

BIOLOGY SCIENCE – 06-37 Aug 4

BIOLOGY SCIENCE – 06-37 Aug 4

RRelativPerspektiv8/4/2022
using data in different files [JS HTML] is it good to take advantage of globally scoped variables ? https://gist.github.com/biologyscience/e27a13cc1d528232de39200221a58262 or use events to transfer data within files https://gist.github.com/biologyscience/295be8fc18a36ed9c73bc67bcdfc36f8
SScriptyChris8/4/2022
Why not use modules?
RRelativPerspektiv8/4/2022
yea i could, but im using events because, i want the thing to execute only when something is ready (something like that), so ill fire the event when the thing is basically ready to use. the example which i have given in the code is basic, my main use case is bit too big, so yea
SScriptyChris8/4/2022
If you are able to dispatch an event when something is ready then why can't you call specific function, which would be important? I guess you use a subscriber pattern?
RRelativPerspektiv8/4/2022
yea i could do that, but lets say my situation is kinda like, i have the important functions in a seperate file and wanted to use when something is ready i could do export the function and import it when i need it, but basically i dont want to import and export things, thats why i choose events in the first place isnt that basically a type of event system ?
SScriptyChris8/4/2022
Kind of, yes
UUUnknown User8/4/2022
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

BIOLOGY SCIENCE – 06-37 Aug 4

Join Server