Forum

Notifications
Clear all

LemonadeJS Wrapper

1 Posts
1 Users
2 Reactions
582 Views
(@rtolivier)
Posts: 6
Active Member
Topic starter
 

Hello Qtxers,

Here is my wrapper of the tiny reactive Library LemonadeJS ( https://lemonadejs.net/v1/ ). 

QTX is good and it's better to have reactive components.

LemonadeJS is easy to use and implementation in QTX is even easier:

- Drop the component to the Designer. 

- Set the JSONData proprety to set initial data for the component. It should be a valid JSON string.

{"checked": "true"}

- Set the Template property of the component

<div>
Value of the Checkbox: <span><b>{{self.checked}}</b></span>. 
Try to modify state of the checkbox: 
<input type='checkbox' @bind='self.checked' onclick='self.clickit()' />
</div>

- In the code, you can set add Data or Functions

Widget1.Data.clickit := procedure()
  begin
    var data := Lemonade.Get("My:Profile");  //See line 87 to see how to set data from another component
    data.username := "Changed from ClickIt Procedure";
    asm console.log("Trying to change data.username in the Widget 2"); end;
  end;

NB: Use Lemonade.Get("[AliasName]") and Lemonade.Set("[AliasName]", data) to communicate with other LemonadeJSComponent.

Link to download the package and demo: https://drive.google.com/drive/folders/1YoIPaw4moqdHxk4DHuVjbxyoaXaX1Obc?usp=share_link

If you like what I do and want to motivate me to wrap another libs, you can donate with paypal (every donation will be shared with Jon Aasenden): https://paypal.me/rtolivier . Thank you so much, no amount is too small 😉

Cheers,

Toky Olivier RAZANAKOTONARIVO

 
Posted : 18/02/2023 11:44 pm
dryphon and jet2050 reacted
Share: