handlebars_misc_helpers
handlebars_misc_helpers copied to clipboard
Allow assign helper to be called multiple times
The assign
helper clones the ctx
parameter, assigns the value, and sets the result to the render context. Calling assign multiple times leaves the render context only containing the last assignment call.
https://github.com/davidB/handlebars_misc_helpers/blob/0e60d86cc5ed905bb65987734bb72f360861365a/src/assign_helpers.rs#L38-L43
- Should the original context be changed before assigning to the render context? This would allow for multiple assignments.
- Is this actually desired behavior and the fix should be updated documentation? e.g. if calling assign multiple times is desired, a new complex object that maintains past values should be created.
Issue opened based on feedback in https://github.com/SuperCuber/dotter/issues/134.