Comments (4)
@d9k Greetings! Thank you for your feedback, much appreciated!
You ask a good question. This is addressed in Chapter 3 - Update Model:
Note: you might wonder about rebuilding the whole view and re-rendering it when something changes. Generally speaking, producing a vnode is not a performance concern. Further, re-rendering the view is what virtual-DOM libraries are good at: figuring out what minimal changes are needed to make the real DOM reflect the view.
That being said, nevertheless I will show how to prevent re-construction of sections of the virtual-DOM tree that have not changed.
I will add a link here when that section is ready. Stay tuned!
from meiosis.
@foxdonut, cool! 😎 👍
from meiosis.
@d9k I still need to do a writeup, but in the meantime I thought you might be interested in seeing the code example.
Essentially to prevent re-renders, this example:
- uses immutable objects, to easily determine a change with
!==
- uses Mithril components to have access to lifecycle methods
- uses Mithril's
onbeforeupdate
lifecycle method to determine whether to re-render
You can see the result in the console. For example, when you change the Air temperature, you only see render Temperature Air
, the other components are not re-rendered.
Hope that helps!
from meiosis.
@d9k reference material:
from meiosis.
Related Issues (20)
- How to integrate it into a redux app HOT 4
- All the documentation removed? HOT 1
- Tutorials for react deleted HOT 1
- Example Implementation HOT 1
- About React Hooks and meiosis state HOT 1
- SAM Pattern nap issue HOT 6
- Brilliant! HOT 5
- more food for thought HOT 3
- Error on auth redirect HOT 2
- params handling HOT 7
- subtle routing bug HOT 6
- Convert to Mergerino HOT 2
- Routing helper broken when used with mithril router without the prefix
- Feature request: bind actions to Actions object HOT 3
- examples with react-hook (or solidjs state) HOT 4
- meiosis-setup with snowpack? HOT 1
- How to turn off a "map" callback? HOT 5
- Alternative way of connecting stream to React function components HOT 2
- Question on initialRoute HOT 8
- meiosis-setup with typescript: some suggestions HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meiosis.