Questions tagged [global-state]

66 questions
0
votes
1 answer

Alternative To Singleton Util Class

So I have a class like so: public class HBaseUtil { private final String fileName = "hbase.properties"; private Configuration config; private HBaseUtil() { try { config = new PropertiesConfiguration(fileName); }…
Nishant Kelkar
  • 412
  • 1
  • 4
  • 20
0
votes
1 answer

Changing and sending globally needed data

I would like to ask about best-practice how to hold and change a global state of application. I have a Parser (which now is a singleton) which among others have properties like private String mode private List loadedResources Then I have…
kuncajs
  • 1,096
  • 1
  • 9
  • 20
-1
votes
2 answers

How I put a global state array of objects inside local storage?

I am working on an ecommerce website. I create a global state using the library in the react-hooks-global-state (the link below). I want the array to save when I refresh or redirect the page. However, when I store it in local storage I get an…
-1
votes
1 answer

why when using hooks do i get this error "Hooks can only be called inside of the body of a function component."?

Every time I run yarn start with the following line of code const context = useContext(GlobalContext); I run into this "Error: Invalid hook call. Hooks can only be called inside of the body of a function component." How can I fix this it's driving…
lukeet
  • 461
  • 1
  • 4
  • 22
-2
votes
1 answer

What can i use instead of redux for next.js

Next-wrapper-redux is not good solution for global state management. I have tried use it 4 times in next.js and every time it doesn't work. What can i use instead for global state in next.js? I just need in sever-side-props function, dispatch data…
choco
  • 96
  • 7
-2
votes
1 answer

Cannot access child static property from parent static method in PHP

I am having some problem in my PHP code. I have three classes named as DatabaseObject File user_picture And their inheritance tree from parent to child class is DatabseObect->File->user_picture. Here in user_picture I have a static property…
kirito70
  • 65
  • 2
  • 14
1 2 3 4
5