Declarativas API
Declarativas exposes two simple methods to get you going.
Methods
Creating virtual canvas nodes
The c
method is what allows you to tell declarativas what to do when it interprets a given node.
You can also get fancy, and use JSX with the following configuration:
To use JSX, you'll need to use acorn or babel to transpile JSX to regular javascript.
Single render
Calling the render
method will draw whatever virtual canvas nodes you have created onto the canvas you specified. If you want to update the canvas, just call render again. There is no extra state/updating mechanism built in, but there is nothing stopping any developer from integrating declarativas into a state management library.
Last updated