question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Explain: Using subviews

See original GitHub issue

@leeoniya

If this is in the docs already I can’t find it. Could you please briefly explain the difference between using a subview with the following two forms:

["#ui",                                                     // same as "div#ui"
    [SomeViewFn],                                           // sub-view w/closured data
    preInitVm,                                              // pre-initialized ViewModel
]

Also, I noticed now that the docs only have up to 3 arguments for a subview: function,model,key. Is this current? I thought there was a fourth, options.

Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
leeoniyacommented, Jun 18, 2016

gonna close this, but feel free to inquire further if still needed.

1reaction
leeoniyacommented, Jun 17, 2016

@lawrence-dol it looks like in recent versions, the sub-view overhead has been reduced. in addition, if you have immutable data that you can cheaply diff between redraws, you can use sub-views to greatly increase perf as well.

the situation is somewhat nuanced and depends a lot on your data. i just pushed f0768ee41d0a17fcdec948636409c9152b777509 which implements a sub-view based dbmonster with optional immutability optimizations. Notice that the keys in all the subviews are false, which speeds up the diff by avoiding any subview reordering lookups and treating them as slots (it works in this dbmonster case because we have knowledge of how the data mutates, same for the immutability optims).

Play around with it in all 3 variations across the full range of mutations 0%-100% and look at how the FPS behaves as well as the cost of the “view update” (ms).

Read more comments on GitHub >

github_iconTop Results From Across the Web

subviews | Apple Developer Documentation
For complex views declared in UIKit and other system frameworks, any subviews of the view are generally considered private and subject to change...
Read more >
( iOS ) What is superview and what is subviews - Stack Overflow
A superview is a view that holds other views over it and subviews are the views being held/added over a View.
Read more >
iOS Programming Video Tutorials - Introduction of Subviews - 1
Hello Everyone,This video will introduce how to mange and use the subviews in iOS Application.To learn more languages please visit this ...
Read more >
What is 'subview' in iOS? - Quora
It's a View object that belongs to another View object. Usually, though by no means always, this means that it's a part of...
Read more >
SQL Developer Data Modeler Quick Tip: Use SubViews
SubViews allow the user to take a group of entities or objects from the main model area and place them in a separate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found