Comments (2)
! quite elegant mount-fx solution is mount(() => () => /* unmount */)
from spect.
? should selector aspects call destructor on unmount?
- sounds meaningful to free memory
− we [can] keep aspects as weak refs- still destructor is meaningful to clean up aspect
. there's no destructor. There's main render and mount/unmount hooks.
? should non-selector aspects keep element reference regardless of mount/unmount?
. possibly such "independent" elements should be handled in reference to context aspects, so if they disappear from the parent aspect's scope, their own aspect's destructor is called. But if they were initialized at the root, eg.$(document.body)
, then destructor is impossible to be reached.
. for some real elements aspects can create blocking refs. For example, user wants to remove this element - but if there was an aspect registered at the root level as$(el, aspect)
, this aspect will remain after the mount/unmount. Best we can - keep aspects as weak as possible and encourage removing refs on unmount.
. without mount/unmount hooks we'd re-register state every re-render, so they should be scoped.
- still destructor is meaningful to clean up aspect
from spect.
Related Issues (20)
- h: cache element by stack instead of creating anew HOT 1
- h: drop parser, use htm HOT 2
- v → f, v. Shaving off API, v as proxy HOT 6
- operators HOT 1
- 0b HOT 1
- v ~~as proxy~~ as observable HOT 1
- v: access multiarg values as [0], [1] etc. HOT 1
- $ → selector-collection HOT 2
- h: keyed. Why not morphing? HOT 3
- v(v0, v1, v2) - observables as args HOT 1
- $: pseudos? HOT 1
- h/$ - a nice way to convert data to template? HOT 2
- add Github Corner to spect.ly and fix typo HOT 2
- v23: animevents-only $ HOT 1
- 23.0: API reconsiderations, half-a-year later
- $: stop infinite recursion HOT 1
- $: first run flickers
- $(parent, ‘> child’)
- h: lists; diff algo is underused. Possible syntax HOT 1
- spect@24 breaks integration tests with subscribable-things HOT 5
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 spect.