This repository has been archived by the owner on Sep 24, 2021. It is now read-only.
@onGet and @onSet custom hooks #16
Labels
client-side-reactivity
Reflection of updates to state on the view
enhancement
New feature or request
server-hydration
The backwards interpretation of server markup
Currently there several types of bindings:
prism/src/templating/template.ts
Lines 50 to 59 in 9f76e8b
Currently set hook is not implemented. It would consist of adding a
@onSet
decorator to methods in the component class definition that would fire when the value parsed in as a argument is updated (the same way it works with updating the view via the DOM)Example usage:
Where value is the new updated value.
There could also be an opportunity for a
@onGet
decorator which would decorate a method that would return a value for manual server hydration. This could be used in places where Prism analysis for hydration fails. This would not be the same as a computed property. Once the hydration is needed and the@onGet
method is fired and returns a value to the state then further gets to the property would return that in state rather than call the@onGet
method againThe text was updated successfully, but these errors were encountered: