have question regarding coconut framework, maybe @back2dos or @kevinresol have some idea on this. I am trying to write coconut backend for framework where all views need access to root object in the constructor, sort of main object. What would be best way to solve such dependency ? In react there is context api where you can provide from the root some global dependencies.
Yup, as Kevin said @:implicit would do the trick, although if it’s for backend framework specific stuff, it’s probably not the best way to go.
If this is based on coconut.diffing, then your implementation of cursor/applicator can probably take care of this in a simpler and more lightweight way.
@back2dos finally got back to this, are there any example how to pass global dependency to cursor so it can be used as attribute, this framework what I use have global dependency for each visual element that need to be passed in constructor, idea was to remove it from attribute list and then manually add it inside backend
@back2dos sure will clean up a bit as just copied other backend as example, but in short
I have global object (WebglRenderingContext), thats is necessary for any view,
example new Node(context, props), would like to hide this context from user as it can / need to be created at init and then passed down for each view, ideally would like to have something like this
<Node position={[0, 0, 0]} /> and then that constructor context attribute could be populated from backend side. Not sure if its even possible but would like to find some solution.