Skip to main content

Posts

Vuex State Management Sample

Vuex is a state management pattern or state management library. Vuex makes data management easy and more maintainable in the application. Vuex main target of integration with Vue.js library. In simple words, Vuex is a data store that supplies or provide data to Vue components with much consistently, more efficiently by making code more simple. Transferring of data between the component can be done effectively using Vuex when comparing with the traditional way(Vue.js passing data by input parameters). Vuex pattern is similar to Redux, Flux existing libraries for state management.Vuex Core Building Blocks: Actions: Actions are task performers which have the capabilities to do either synchronous or asynchronous operations. In Vuex actions are used to invoke the rest API's to fetch the data and then actions call mutations to change the store state. To invoke mutations actions use a command called 'commit'. This 'commit' command invokes appropriate mutation and receives …

A Sample On HttpClientFactory Implementation Using Named Clients Technique In .Net Core Application

An Overview On Named Clients:In HttpClientFactory, the Named Clients technique is useful when an application has a requirement to consume multiple external API's.In the Named Client approach HttpClienFactory produces the HttpClient object specific to the domain.So if our requirement to consume multiple external domains then HttpClientFactory generates HttpClient object per domain based on their registration in a startup.cs file.So each external API domain needs to be registered in the startup.cs file with a specific 'Name' to that HttpClient.This name will be passed to HttpClientFactory to produce a HttpClient object with the specified configuration in the startup.cs fileHere we have a configuration object to set time out for the expiration of the HttpClient object. Click here to learn more about an overview of HttpClientFactoryBasic Implementation Sample On HttpClientFactory Using HttpRequestMessage ObjectTest 3rd Party API's:So to understand and implement a sample on …

.Net Core Sample Example On HttpClientFactory Basic Implementation With HttpRequestMessage Object.

In this article, we are going to see the HTTP client factory's basic implementation technique to consume an API in our .Net Core application. Click here to understand how HttpClientFactory works.Create A Sample API Project:Now let's create a .net core web API sample project in which we are going to consume another API(Third-party API) using HttpClientFactory. You can create your sample project using editors like Visual Studio 2019 or Visual Studio Code. Test API To Consume:Let's consume a free Rest API to consume for our leaning process. There a lot of free developer API for learning purposes. Here we are going to use JSONPlaceholder. JSONPlaceholder: Guide :- https://jsonplaceholder.typicode.com/guide.html Endpoints:- 1.https://jsonplaceholder.typicode.com/users/1/todos (Todos endpoint) 2.https://jsonplaceholder.typicode.com/users/1/albums (Albums endpoint) 3.https://jsonplaceholder.typicode.com/albums/1/photos (Photos endpoint) 4.https://jsonplaceholder.typicode.com/user…

Why To Use HttpClientFactory In .Net Core

HttpClient instance was used to invoke or consume the external rest API by clients like console applications or web applications.What Is Socket?:A Socket is a system communication protocol providing a communication channel over TCP connection.
In programming, terminology socket can be defined as the combination of Url and Port Number to make communication channels. HttpClient Working Flow:
Let's assume that we have .Net Core application, which will consume an external API using HttpClient. The steps involved in communication are as follows: The user requests our application, in which we need to call an external API to serve results to the user.On receiving user request our application creates an instance of HttpClient.Next HttpClient looks for HttpRequestHandler object in the pool of HttpRequestHandlers. Then HttpClient picks up one of the HttpRequestHandler objects and gives all input information like Url, payload, tokens, etc to make an external API call.Then HttpRequestHandler look…

An Overview On Ionic Action Sheet In Angular(ion-action-sheet)

Ionic Action Sheet is a dialog that contains a collection of actionable buttons that display over the application. Here we are going to understand Ionic Action Sheet implementation in Angular.ActionSheetController And ActionSheetOptions:The main building blogs for developing Ionic Action Sheet can be like ActionSheetControllerActionSheetOptions ActionSheetController is imported from the package '@ionic/angular'. ActionSheetController is injectable controller into our any of the ionic angular component through constructor injection. An ActinSheetController can create an n-number of action sheets within the components. ActionSheetController bundled with three main methods like
createdismissgetTopcreate method helps to instantiate or build the Ionic Action Sheet by taking ActionSheetOptions as input configuration.Ionic Angular create(action sheet create method) syntax: create(opts?: Opts): Promise<Overlay>; dismiss method helps to destroy the action sheet, it takes 'data…