In the first line, we create a $Container to using Elexis API on document.body element. Then we see a content method after the container object, this method mean the following elements will be the content of container.
We can pass an array into content method. In this array, we put a new <h1> element which have a class name "title" and text content "Hello, world!".
Run the code, we will get this body structure in DOM:
So far, we just simply do a hello world project that you can type less in HTML way, and these is not the point of ElexisJS. Let's figure out what ElexisJS will boost development speed in the following examples.
Using $State to sync view and data changes
This line will create a $State value, usually we will put $ sign behind variable name to mean this is a $State variable.
const number$ = $.state(42);
This $State value has been set a number 42, which will become a number type $State. We can simply put this state value into any display content!
You will see the <input> element is fill with number 42, and also <p> element will display 'User input value: 42'. Now try to change input value in browser, the value text in <p> element will be synced by your input!
Using set method to set value of $State, all displayed content of value$ will be synced.
We found that elexis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 0 open source maintainers collaborating on the project.
Package last updated on 12 Feb 2025
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
TC39 met in Seattle and advanced 9 JavaScript proposals, including three to Stage 4, introducing new features and enhancements for a future ECMAScript release.
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.