sushibar | TouchBar example - NSTouchbar sample app
kandi X-RAY | sushibar Summary
kandi X-RAY | sushibar Summary
NSTouchbar sample app. see
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sushibar
sushibar Key Features
sushibar Examples and Code Snippets
Community Discussions
Trending Discussions on sushibar
QUESTION
I have a Meteor subscription with some settings, so that I do not publish my whole collection server side. The subscription will be fetched within a createContainer()
from meteor/react-meteor-data
and displayed in a simple
- list, where I also added the document.id to the
element as a key.
Unfortunately as soon as I increase the settings.limit in the subscription 2nd subscription argument (
Meteor.subscripte('Collections', settings.limit
) the whole- list rerenders? What can I do to increase the publication limit, while only adding the new list elements?
P.S. When I publish the total Collection and change the limit in my client via
Collection.find({}, {limit: newLimit}).fetch()
, react is working as expected: leaving the old elements as they are and just adding the new ones!Client Side
...
ANSWER
Answered 2017-Apr-26 at 12:16Ok I finally found the Problem:
The every time the limit changes the createContainer()
subscribes again to the published collection! Meaning that it sends new props to my Content component, which triggers a rerender! For the short moment it takes to resubscribe the location array, which is saved as a prop, will be overridden by an empty array, which one only notes as a flash in the screen. So for a short second there will be no content displayed and then the new props with the correct locations array is transmitted.
The solutions now to concat()
the new location array into the state of the Content component via componentWillReceiveProps(nextProps)
whenever there are new locations to add. Then one can compare the old and new state, within the shouldComponentUpdate(nextProps, nextState)
and only update when the state is changing!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sushibar
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page