-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reactivity concept #41
Comments
Comparing to existing Lamport clocks model in GlimmerVM we eliminate tag re-validation phase, and literally executing only values needs to be updated. Benefits comparing to Lamport clock - is:
Benefits to have update-only VM:
Lookup stage looks like // DEDUPLICATED SET OF MERGED_CELLS
const MERGED_CELLS_TO_INVALIDATE = new Set();
// ACTUALLY CHANGED CELLS
TAGS_TO_INVALIDATE.forEach((CELL) => {
OPCODES_FOR_CELL(CELL).forEach((opcode) => {
execute(opcode);
});
RELATED_MERGED_CELLS(CELL).forEach((RELATED_CELL) => {
MERGED_CELLS_TO_INVALIDATE.add(RELATED_CELL);
});
});
// DERIVED CELLS
MERGED_CELLS_TO_INVALIDATE.forEach((CELL) => {
OPCODES_FOR_CELL(CELL).forEach((opcode) => {
execute(opcode);
});
}); |
Reactivity in GXT: A Simplified ApproachGXT introduces a streamlined reactivity system inspired by Glimmer's Core Concepts
Key Features
Exampleimport { cell, formula } from '@lifeart/gxt';
const count = cell(0); // Define a Cell to hold the count
const doubled = formula(() => count.value * 2); // Derive the doubled value
// ... in your template ...
<span>{{count}}</span>
<span>{{doubled}}</span>
// ...
count.value++; // Updating the count will automatically update the DOM In this example, updating the Benefits
This reactivity system is a core part of GXT's philosophy of providing a lightweight and performant framework for building modern web applications. |
The text was updated successfully, but these errors were encountered: