Reactive UI - Any real examples out there

Reactive UI - Any real examples out there

by Howard Miller -
Number of replies: 4
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I was skimming over https://moodledev.io/docs/guides/javascript/reactive.  I haven't read it all in detail - I need to allocate some time and get a cup of coffee first smile

However, this looks like it might be ideal for a new development that I'm starting work on that will have some complex UI. 

My question is - is there anybody out there ahead of me on this? Are there any working plugins or proof of concepts that I can look at? 

Average of ratings: Useful (1)
In reply to Howard Miller

Re: Reactive UI - Any real examples out there

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Howard,

I've been reading that document too! In an attempt to understand the complexities of the course index functionality and have my own JS to react to it. Seems like the pattern is that of an event driven system with a global repository of variables that can be changed in a specific way, then the registered listeners told of that change.

I don't have an example yet, but its on my TODO list for the last month or so. I suspect you may need a whole plantations worth of coffee smile.

G
Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: Reactive UI - Any real examples out there

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I did manage to bolt Vue.js into a Moodle plugin reasonably successfully - and I have enough of an understanding of Vue to get stuff to work (I won't go further than that).

Then I saw this documentation (and the course index code). A quick read through didn't get me much beyond your understanding but I'm now wondering if this is going to be the officially supported way of doing reactive UI. Hmmmm... I suppose I'll have to allocate some time to having a go and see how badly it goes wrong.
In reply to Howard Miller

Re: Reactive UI - Any real examples out there

by Daniel Villareal -

Hi Howard,

Do you have any example(github snippet) on how you use Vue.js on a moodle plugin?
Would you mind sharing it?

Thank you

In reply to Howard Miller

Re: Reactive UI - Any real examples out there

by Stefan Hanauska -
Picture of Core developers Picture of Plugin developers
Hi Howard,

I've just used it for a new plugin (and Gareth is right - a lot of coffee was involved) : https://github.com/mebis-lp/mod_kanban

I'm sure, I didn't get everything right while reading the documentation and the examples provided by the core code. But maybe it can still be useful for you.

Best
Stefan

Average of ratings: Useful (1)