filter in axios code example
Example 1: axios.filter
axios.get("api/blogs/" + this.state.pageIndex + "/10").then(res => {
res.filter(function(author) {
return author.firstName === this.state.query;
});
});
Example 2: how to use axios filter
// Will return all the posts that belong to the first user
fetch('https://jsonplaceholder.typicode.com/posts?userId=1')
.then(response => response.json())
.then(json => console.log(json))