Check out example codes for "turn off suspend and sleep tagets system d". It will help you in understanding the concepts better.

Code Example 1

$ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Learn ReactJs, React Native from akashmittal.com