Comments (6)
Hey sorry! I somehow missed the email when this issue was opened so thanks for the bump. I'm on break now, so I'll take a look in the next few days.
from react-facade.
Up! @garbles would that be a possibility?
from react-facade.
Great! Many thanks! 😄
from react-facade.
Alright I just published v0.4.0
which should resolve this. LMK!
from react-facade.
Hi @garbles! Merry Christmas and many thanks!
I have a specific use case where it doesn't work and I understand if it isn't feasible as it's problematic. I use trpc, which usage I want is like the following: hooks.trpc.a.b.c.myEndpoint.useQuery()
. The apparent issue is that trpc
is already a proxy, so there is some kind of conflict with your implementation, which also uses a proxy. With the 0.4.0 change, the trpc
type now shows to be used as there are some functions/hooks on its root.
With hooks.trpc()...
I works since before but I don't like having to call it every time. As a possible solution, maybe we could have in this lib a function X (no idea how it could be called) that would just create a dummy class that you could check every root prop for instanceof
, and if it's the case, it would use the given implementation without having to call it. The implementation could be something like { trpc: X(trpc) }
, X being just something like
class classX {
constructor(x) {
return X
}
};
const X = (x) => new classX(x)
I am not really sure how your implementation works as I haven't taken a long time to analyze it, but maybe it could just use normal objects instead of proxies to access the root props. With the Provider, we would just define the root object where the props are. hooks
could be the result of react-hooks-global-state, and the provider argument would set the global state with the initial value of the provider property.
from react-facade.
@SrBrahma I'm happy to look into this, though I don't quite understand the problem. It would be super helpful if you made a demo repo (or a PR with a failing test).
from react-facade.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-facade.