-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow context to be initialised with Any #281
base: master
Are you sure you want to change the base?
Allow context to be initialised with Any #281
Conversation
Initialise Context with Any by converting to dictionary Allow Any to be pushed onto a Context in a similar way Change Environment functions to use these new functions
This will fix #223 (comment) |
Co-Authored-By: Ilya Puchka <[email protected]>
Co-Authored-By: Ilya Puchka <[email protected]>
Make init(object:environment) public Co-Authored-By: Ilya Puchka <[email protected]>
@ilyapuchka Is this getting merged in or do I need another approval? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we possibly avoid the Mirror(...).asDictionary()
bit? Stencil already has quite extensive reflection capabilities for multiple types (when rendering a template).
Co-authored-by: David Jennes <[email protected]>
I'll have to have a good look at the code again. It was a wee while ago when I wrote this |
@djbe I had a look through the code again. None of the reflection code seems accessible at this point. Is there function that takes an object and converts it to a |
Given Mirror is being used to serialize objects that are members of the Context dictionary, it only seems logical we shouldn't be limited to initializing a Context with a dictionary. This PR adds the ability to initialize a context with Any
Initialize Context with Any by converting to dictionary
Allow Any to be pushed onto a Context in a similar way
Change Environment functions to use these new functions