How can a React Native client to know the GetStream.io Feed is empty? - getstream-io

We have a React Native client that is using the Feed product from GetStream.io. What is the best way to detect the feed is empty so that I can display an empty state graphic.
I did not see the ability to add an empty state graphic to the getStream.io Feed component but if that already exists please let me know.

https://getstream.github.io/react-native-activity-feed/#flatfeed
You can use the setListRef and watch the field parentProps.data (you will have to looking for it I don't remember where it is).

Related

Can a user somehow change the state of a React component from console in the browser?

For example, a user can define a function and run it, select an element from document, alter it and do other similar stuff from the console. I am wondering if it is also possible for user to alter the state of certain component from the console that I don't want him/her to do so. I personally couldn't do it, but want to know if it is possible. And if yes, is there any ways of preventing it ?

How to show list of products in google assistant without selecting any of them?

Currently i am building a chatbot where i need to display list of products with its description. I tried Carousel, Browsable Carousel and List but they all allow to select any options from the list.
I want to display the products but do not allow to select any of them.
I am using dialogflow as NLP and sending fulfillment using action-on-google's dialogflow node.js library.
Can anyone help me implementing this ?
You can try sending a single Basic Card with an image, if that is suitable for the response. You can also look into using a Table Card, however it doesn't allow for images in the cells - just a single image for the table.
There is no way to prevent a List or Carousel item from being selected, but you can certainly handle the response by ignoring what they've selected and re-prompting them with whatever you've prompted them with after showing the carousel/list. (Or even just re-showing the list and re-prompting them.)
However, it really isn't clear why the items are for information only and that speaking them isn't intended to continue the conversation. Would it make sense that, if a user selected one, you might provide additional information that can be useful? What would a user expect?

Server-side rendering with Node/React. How do I fetch the data?

My goal is to server-side render my blog built with Node and React/Redux. I am following this tutorial, and using this project as an example.
I have loaded my components, created an empty store, successfully used this stuff to render and return html pages.
My remaining challenge is to figure out how to fetch the inital data so that I could put it into the store. I am assuming, I somehow need to tell the store(on the backend) to dispatch the actions that will fill it with data.
This example is using this function, that seems to be telling the store to dispatch actions, and returns the store filled with data(?). But it flies way over my head, I don't get how it works, and when I copy the code, the store still returns empty.
Can you help me to understand how this is supposed to work? What do I need to do to tell the store to execute actions, that will go to my API, fetch data, and put it into the store?
basically fetchComponentData will dispatch actions while server rendering, like the document says
fetchComponentData collects all the needs (need is an array of actions that are required to be dispatched before rendering the component) of components in the current route.
where need is an array of functions that return a redux action, which defined inside each smart components (connected with redux store and react-router)
for example, in mern-starter, when you visit index route, it'll render this component and there is the need method which will be executed by fetchComponentData when server rendering.

How to perform a simple search on Dojo DataGrid

For a project, I had to swictch from DataTable jquery plugin to Dojo.
Dojo is great and everything works fine !
But, I miss the dataTable's simple search form (http://datatables.net/).
I know that Dojo have the Filter plugin which could make that, but it's not simple, for the users, as the dataTable input field (at less two more click for a global search on a table :/).
I search all the web but i couldn't find an exemple with it :/
If someone has a clue ?
This depends on what kind of backend data store you are using to power your grid.
It's usually just a simple matter of calling grid.setQuery({name: "FooBar" , ignoreCase: true });
But lets say you are using an [AndOrReadStore][1], rather than a simple ItemFileReadStore, then you might specify the columsToQuery and the columnValue as well.
Remmber, you always query your grid not the store. The grid will pass the query on to the store.
So, to do what you want, just create a new input on your page. Capture key presses or onchange, and then query your grid accordingly. This will filter results that don't match.
The reason why you might use query, is because if your store is powered from the server, it will make sure to requery the backend.
However, if your grid is entirely loaded in memory, then you can do client side filtering by using filter().

autocomplete search field for blackberry

I want to implement the an auto complete feature in an app am currently developing. I would have used the Blackberry native auto-complete field but I want the auto complete list to be gotten from a web server. This feature is being implemented in the search screen of google maps for blackberry.
Please can u give ideas on how to go about this?
I didn't try but I don't see any issue to do that.
You need to add listener for the EditField - getEditField will help you.
After getting list of suggestions, you pack them to BasicFilteredList and set it to AutoCompleteField with setFilteredList.
You should think also about implementation of case when network is not reachable.
Great example from http://devblog.blackberry.com/2010/04/how-to-use-autocompletefield/
After getting your data back from the web server, store the searchable data as String[].
Then you just need the following code to make your AutoCompleteField work:
BasicFilteredList filterList = new BasicFilteredList();
//my query to sqlite database, yours could just be parsed from your webserver or whatever
String[] list = db.getSearchSuggestions(totalCount);
filterList.addDataSet(1, list, "list", BasicFilteredList.COMPARISON_IGNORE_CASE);
final AutoCompleteField autoComplete = new AutoCompleteField(filterList);

Resources