Hi everyone!
I’m struggling in understanding Frontity libraries. In my case, I want to fetch data about posts from my WP REST API. The default value of per_page is 10 and I want to increase it to 100. So, I use “libraries.source.api.get()” with {endpoint: posts, params: {per_page: 100}}
I read API reference about wp-source libraries and watch videos about wp-source but I don’t understand some points:
- Where should I put “libraries.source.api.get()” . In useEffect, or in index.js file?
- The doc says: “it doesn’t return data but a promise that is resolved when the action is finished (and state is updated)”. How can I see that update, and how to access to the updated state?
I am trying to imagine how Frontity works, so I’m sorry if these questions is too basic.
Thank you guys so much!