You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for creating this repository.
In the project I'm working on I'd like to switch from passing an Auth Token as URL parameter to header. Currently we keep the client's initialisation in custom React Hook that returns both client and setter function, so that we can set the token from outside.
This works due to nature of createConsumer - it accepts both a value or a function (here, websocketUrl) that is being lazily evaluated, when the token is already granted. Changing to header-based authentication won't work currently, as headers require immediate object value.
I'm not that familiar with React philosophy and it might sound like specific use case, but would it be valuable (especially for React Hooks) to also have a possibility to lazily evaluate headers same way URL argument does?
The text was updated successfully, but these errors were encountered:
First of all, thanks for creating this repository.
In the project I'm working on I'd like to switch from passing an Auth Token as URL parameter to header. Currently we keep the client's initialisation in custom React Hook that returns both client and setter function, so that we can set the token from outside.
This works due to nature of createConsumer - it accepts both a value or a function (here,
websocketUrl
) that is being lazily evaluated, when the token is already granted. Changing to header-based authentication won't work currently, as headers require immediate object value.I'm not that familiar with React philosophy and it might sound like specific use case, but would it be valuable (especially for React Hooks) to also have a possibility to lazily evaluate headers same way URL argument does?
The text was updated successfully, but these errors were encountered: