<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Admin, Author at Program Easily</title>
	<atom:link href="https://programeasily.com/author/gprincelin11/feed/" rel="self" type="application/rss+xml" />
	<link>https://programeasily.com/author/gprincelin11/</link>
	<description>Program Easily helps people to learn about software programs in a easy manner.</description>
	<lastBuildDate>Thu, 15 Dec 2022 03:57:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://i0.wp.com/programeasily.com/wp-content/uploads/2020/12/cropped-logo.png?fit=32%2C32&#038;ssl=1</url>
	<title>Admin, Author at Program Easily</title>
	<link>https://programeasily.com/author/gprincelin11/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">187075990</site>	<item>
		<title>When to use NextTick API in Vue.js</title>
		<link>https://programeasily.com/2022/12/15/when-to-use-nexttick-api-in-vue-js/</link>
					<comments>https://programeasily.com/2022/12/15/when-to-use-nexttick-api-in-vue-js/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 15 Dec 2022 03:54:10 +0000</pubDate>
				<category><![CDATA[Vuejs]]></category>
		<category><![CDATA[vue]]></category>
		<category><![CDATA[vue.js]]></category>
		<category><![CDATA[vue3]]></category>
		<guid isPermaLink="false">https://programeasily.com/?p=2042</guid>

					<description><![CDATA[<p>NextTick is one of the cool feature in the VUE world. In Vue.js, When we change the state, it will not update/affect the DOM instantly or synchronously. Rather It will collect the state changes and do the DOM update once asynchronously no matter how many state changes you have made. NextTick API in Vue.js &#60;script&#62; import { nextTick } from 'vue' export default { data() { return { count: 0 } }, methods: { async increment() { this.count++ // DOM...</p>
<p class="read-more"><a class="btn btn-default" href="https://programeasily.com/2022/12/15/when-to-use-nexttick-api-in-vue-js/"> Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/12/15/when-to-use-nexttick-api-in-vue-js/">When to use NextTick API in Vue.js</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://vuejs.org/api/general.html#nexttick">NextTick</a> is one of the cool feature in the VUE world. In <a href="https://programeasily.com/vue/">Vue.js</a>, When we change the state, it will not update/affect the DOM instantly or synchronously. Rather It will collect the state changes and do the DOM update once asynchronously no matter how many state changes you have made.</p>
<p><img fetchpriority="high" decoding="async" class="size-full wp-image-2046" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/12/Snapshot_58.png?resize=640%2C360&#038;ssl=1" alt="NextTick API" width="640" height="360" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/12/Snapshot_58.png?w=1920&amp;ssl=1 1920w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/12/Snapshot_58.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/12/Snapshot_58.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/12/Snapshot_58.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/12/Snapshot_58.png?resize=1536%2C864&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/12/Snapshot_58.png?resize=480%2C270&amp;ssl=1 480w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/12/Snapshot_58.png?w=1280&amp;ssl=1 1280w" sizes="(max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></p>
<h2>NextTick API in Vue.js</h2>
<pre><code class="language-javascript">&lt;script&gt;
import { nextTick } from 'vue'

export default {
  data() {
    return {
      count: 0
    }
  },
  methods: {
    async increment() {
      this.count++

      // DOM not yet updated
      console.log(document.getElementById('counter').textContent) // 0
    }
  }
}
&lt;/script&gt;

&lt;template&gt;
  &lt;button id="counter" @click="increment"&gt;{{ count }}&lt;/button&gt;
&lt;/template&gt;</code></pre>
<p>In the above program, we are changing the state of count by doing count++. But this will not update the DOM instantly rather the vue.js frameworks collects this information in the backend. After the whole execution of <code>increment()</code> method, It will update the DOM asynchronously.</p>
<p>But the problem is <code>document.getElementById('counter').textContent)</code> returns 0 in the <code>increment()</code> method. so if someone wants to use DOM element immediately, which is not possible in Vue.js directly. That&#8217;s where we have to use nextTick global API. <a href="https://v2.vuejs.org/v2/api/#Vue-nextTick" rel="noreferrer"><code>nextTick</code></a> allows you to execute code <em>after</em> you have changed some data and Vue.js has updated the virtual DOM based on your data change, but <em>before</em> the browser has rendered that change on the page.</p>
<p>We can pass the callback function to the <code>nextTick(callback(){})</code> which can be triggered after the successful DOM update. You can either pass a callback as an argument, or await the returned Promise.</p>
<pre><code class="language-javascript">import { nextTick } from 'vue'

export default {
  methods: {
    increment() {
      this.count++
      nextTick(() =&gt; {
        // access updated DOM
      })
    }
  }
}</code></pre>
<h2>Why Not SetTimeout ?</h2>
<p>Some people would think, why not <code>setTimeOut</code>!. We can also use <code>setTimeOut</code> But the problem is When you invoke <code>setTimeout</code>…</p>
<pre><code class="language-javascript">setTimeout(function() { 
    // access updated DOM
}, 100);</code></pre>
<p>then the browser would have a chance to update the page, and <em>then</em> your callback would get called. So the UI will render the old record first and then the new record will come. It&#8217;s not look good right. But with the help of <code>nextTick()</code> we can change the DOM value before being render into the screen. That&#8217;s the beauty of this API in Vue.js</p>
<h2>Summary</h2>
<p><code>nextTick()</code> can be used immediately after a state change to wait for the DOM updates to complete. We should not use <code>setTimeOut</code>to update the DOM rather should prefer <code>nextTick()</code></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/12/15/when-to-use-nexttick-api-in-vue-js/">When to use NextTick API in Vue.js</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programeasily.com/2022/12/15/when-to-use-nexttick-api-in-vue-js/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2042</post-id>	</item>
		<item>
		<title>AWS S3 Client &#8211; Local Stack &#8211; Test Container</title>
		<link>https://programeasily.com/2022/11/18/aws-s3-client-local-stack-test-container/</link>
					<comments>https://programeasily.com/2022/11/18/aws-s3-client-local-stack-test-container/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Fri, 18 Nov 2022 16:27:13 +0000</pubDate>
				<category><![CDATA[J-unit]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[localstack]]></category>
		<category><![CDATA[test container]]></category>
		<guid isPermaLink="false">https://programeasily.com/?p=1676</guid>

					<description><![CDATA[<p>Test Container Test container is a third party Java library which offers to test or validate anything that can run in a Docker container. For Example, we can create lightweight database instances of  MySQL, PostgreSQL or Oracle database to test our data access layer code (DAO , Repositories). Similarly we can test our AWS cloud services like server less apps without actually using the cloud. We can do this with the help of LocalStack, a fully functional local AWS cloud...</p>
<p class="read-more"><a class="btn btn-default" href="https://programeasily.com/2022/11/18/aws-s3-client-local-stack-test-container/"> Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/11/18/aws-s3-client-local-stack-test-container/">AWS S3 Client &#8211; Local Stack &#8211; Test Container</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Test Container</h2>
<p>Test container is a third party Java library which offers to test or validate anything that can run in a Docker container. For Example, we can create lightweight database instances of  MySQL, PostgreSQL or Oracle database to test our data access layer code (DAO , Repositories). <strong>Similarly we can test our AWS cloud services like server less apps without actually using the cloud.</strong> We can do this with the help of <a href="http://localstack.cloud/">LocalStack,</a> a fully functional local AWS cloud stack.</p>
<h2>Local Stack</h2>
<p><a href="https://localstack.cloud/">LocalStack</a> is a cloud service emulator. We can able to run AWS applications like Lambda, S3 entirely on your laptop or machine without connecting to a remote cloud provider.</p>
<p><img decoding="async" class="aligncenter size-full wp-image-1954" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/11/Snapshot_38.png?resize=640%2C360&#038;ssl=1" alt="AWS S3 Client with Local Stack and Test Container" width="640" height="360" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/11/Snapshot_38.png?w=1920&amp;ssl=1 1920w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/11/Snapshot_38.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/11/Snapshot_38.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/11/Snapshot_38.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/11/Snapshot_38.png?resize=1536%2C864&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/11/Snapshot_38.png?resize=480%2C270&amp;ssl=1 480w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/11/Snapshot_38.png?w=1280&amp;ssl=1 1280w" sizes="(max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></p>
<h2>Why It is needed ?</h2>
<p>We can able to connect to AWS services like S3 from Java using their SDK&#8217;s. But here the problem is, if we wants to validate our code then we are need to connect cloud sandboxes using AWS SAM or anything like that. And While we access the cloud services, It is billable as well. Secondly we can not write unit test or integration test for this sources in a efficient way which would be a another downside of it. So In this article, we are going to learn to write unit testing for AWS S3 services with the help of Local stack and Test containers. Let&#8217;s dive into that. Cheers.</p>
<h2>Prerequisite</h2>
<ul>
<li>Java</li>
<li>Maven</li>
<li>Docker</li>
</ul>
<h2>Create a Spring initializer project</h2>
<p>First, I am creating basic spring initializer project with Spring boot starter, Spring boot test and <strong>AWS SDK maven dependencies</strong>.</p>
<pre><code class="language-java">&lt;dependency&gt;
            &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
            &lt;artifactId&gt;aws-java-sdk&lt;/artifactId&gt;
            &lt;version&gt;1.11.163&lt;/version&gt;
&lt;/dependency&gt;</code></pre>
<h2>Creating AWS S3 Client</h2>
<p>Second, now I am creating AWS S3 client with simple upload object functionality. Here I am validating whether the bucket is exist or not, followed by uploading an object into the S3 storage system.</p>
<pre><code class="language-java">package awsservicestutorial.client;

import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.model.ObjectMetadata;

import java.io.IOException;
import java.io.InputStream;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.Path;

public class AwsS3Client {

    private final AmazonS3 amazonS3;

    public AwsS3Client(final AmazonS3 amazonS3) {
        this.amazonS3 = amazonS3;
    }

    public void uploadObject(final String bucketName, final Path path) throws IOException {

        isBucketExists(bucketName);

        final String filename = path.getFileName().toString();

        final ObjectMetadata metadata = new ObjectMetadata();
        metadata.setContentType(URLConnection.guessContentTypeFromName(filename));
        metadata.setSSEAlgorithm("AES256");
        metadata.setContentLength(Files.size(path));

        try(final InputStream stream = Files.newInputStream(path)){
            amazonS3.putObject(bucketName, filename, stream, metadata);
        }
    }

    private void isBucketExists(final String bucketName) {
        if(!amazonS3.doesBucketExist(bucketName)) {
            throw new IllegalStateException(String.format("Bucket %s does not exist", bucketName));
        }
    }

}</code></pre>
<h2>Local Stack and Test Container Dependencies</h2>
<p>Add the following dependency to your <code>pom.xml</code> for using local stack and test container libraries.</p>
<pre><code class="language-apacheconf">        &lt;dependency&gt;
            &lt;groupId&gt;org.testcontainers&lt;/groupId&gt;
            &lt;artifactId&gt;localstack&lt;/artifactId&gt;
            &lt;version&gt;1.17.6&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.testcontainers&lt;/groupId&gt;
            &lt;artifactId&gt;junit-jupiter&lt;/artifactId&gt;
            &lt;version&gt;1.17.6&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;</code></pre>
<p>Here I am using Junit-5 for unit testing the application. It is up to to decide whether Junit 5 or 4. We can do this with Junit 4 as well.</p>
<h2>AWS S3 Client &#8211; Local Stack &#8211; Test Container &#8211; Create Unit Test</h2>
<p>Creating unit test with local stack is really very simple. we just need to create local stack instance. This instance can act as AWS S3 services with the help of test container and docker. It will create a exact AWS mock in local or in our CI environment. This will reduce a lot money, since we don&#8217;t need to interact AWS cloud services during local development and testing.</p>
<pre><code class="language-java">package awsservicestutorial;

import awsservicestutorial.client.AwsS3Client;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.testcontainers.containers.localstack.LocalStackContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;

import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;

@Testcontainers(disabledWithoutDocker = true)
@ExtendWith(SpringExtension.class)
class AwsServicesTutorialApplicationTests {
    private static final String BUCKET_NAME = "test-bucket";
    @Container
    public final static LocalStackContainer LOCAL_STACK_CONTAINER =
            new LocalStackContainer(DockerImageName.parse("localstack/localstack:0.12.16"))
                    .withServices(LocalStackContainer.Service.S3).withEnv("DEFAULT_REGION", "us-east-1");
    private AmazonS3 amazonS3 = AmazonS3ClientBuilder.standard()
            .withEndpointConfiguration(LOCAL_STACK_CONTAINER.getEndpointConfiguration(LocalStackContainer.Service.S3))
            .withCredentials(LOCAL_STACK_CONTAINER.getDefaultCredentialsProvider()).build();

    private AwsS3Client awsS3Client;

    @BeforeEach
    public void beforeEach() throws IOException, InterruptedException {
        LOCAL_STACK_CONTAINER.execInContainer("awslocal", "s3", "mb", "s3://" + BUCKET_NAME);
        awsS3Client = new AwsS3Client(amazonS3);
    }

    @AfterEach
    public void afterEach() throws IOException, InterruptedException {
        LOCAL_STACK_CONTAINER.execInContainer("awslocal", "s3", "rb", "s3://" + BUCKET_NAME, "--force");
    }

    /**
     * First assert whether localstack is running!
     */
    @Test
    public void test_isLocalstackRunning() {
        Assertions.assertTrue(LOCAL_STACK_CONTAINER.isRunning());
    }

    @Test
    public void test_uploadObjectSuccess() throws URISyntaxException, IOException {

        awsS3Client.uploadObject(BUCKET_NAME, createPath());
        Assertions.assertTrue(amazonS3.doesObjectExist(BUCKET_NAME, "sample.csv"));
    }

    @Test
    public void tes_uploadObjectError() throws IOException, InterruptedException {

        LOCAL_STACK_CONTAINER.execInContainer("awslocal", "s3", "rb", "s3://" + BUCKET_NAME, "--force");
        Assertions.assertThrows(IllegalStateException.class, () -&gt; awsS3Client.uploadObject(BUCKET_NAME, createPath()));
    }

    private Path createPath() throws URISyntaxException {
        return Optional.ofNullable(ClassLoader.getSystemResource("sample.csv").toURI())
                .map(Paths::get)
                .orElseThrow(IllegalArgumentException::new);
    }

}
</code></pre>
<ul>
<li>First, I am validating whether the local or CI machine having docker environment.</li>
<li>Second, <strong>@Container creates the local stack container instance and mimic the AWS S3 as we are providing S3 as a service here. </strong>If you are using Junit-4, then you must use @ClassRule annotation here.</li>
<li>During <code>beforeEach()</code> method, we are just creating the bucket in the S3 where as <code>afterEach()</code> method deletes the bucket after each test execution.</li>
<li>You will need to create sample.csv file under test/resources directory for uploading into local stack S3.</li>
<li>During upload test, once the file upload has been done, we can assert that using <code>amazonS3.doesObjectExist</code> method, whether the file has been successfully uploaded or not.</li>
<li>And also we are validating after deleting the the bucket, whether it is throwing <code>IllegalStateException</code> exception or not.</li>
<li><strong>Finally In this way, we tested our AWS S3 client class effectively without connecting into AWS services.</strong></li>
</ul>
<h2>AWS S3 Client &#8211; Local Stack &#8211; Test Container &#8211; Code Sample</h2>
<ul>
<li><a href="https://github.com/programeasily/aws-services-tutorial/blob/main/src/main/java/awsservicestutorial/client/AwsS3Client.java">https://github.com/programeasily/aws-services-tutorial/blob/main/src/main/java/awsservicestutorial/client/AwsS3Client.java</a></li>
<li><a href="https://github.com/programeasily/aws-services-tutorial/blob/main/src/test/java/awsservicestutorial/AwsServicesTutorialApplicationTests.java">https://github.com/programeasily/aws-services-tutorial/blob/main/src/test/java/awsservicestutorial/AwsServicesTutorialApplicationTests.java</a></li>
<li><a href="https://github.com/programeasily/aws-services-tutorial">https://github.com/programeasily/aws-services-tutorial</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/11/18/aws-s3-client-local-stack-test-container/">AWS S3 Client &#8211; Local Stack &#8211; Test Container</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programeasily.com/2022/11/18/aws-s3-client-local-stack-test-container/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1676</post-id>	</item>
		<item>
		<title>String in Java &#8211; String Literal, String Pool, String Objects</title>
		<link>https://programeasily.com/2022/09/01/string-in-java/</link>
					<comments>https://programeasily.com/2022/09/01/string-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 01 Sep 2022 04:49:00 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[core java]]></category>
		<category><![CDATA[string]]></category>
		<guid isPermaLink="false">https://programeasily.com/?p=1672</guid>

					<description><![CDATA[<p>         String is a special non primitive data type in java if we compare with any others. But why! In String, we are having string pool as well as heap memory to store the values. The strings are immutable by nature. String is an object which contains sequence of character&#8217;s. String is not belong to primitive data type whereas we can create object using java.lang.String. There are two ways to create the string in Java.    ...</p>
<p class="read-more"><a class="btn btn-default" href="https://programeasily.com/2022/09/01/string-in-java/"> Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/09/01/string-in-java/">String in Java &#8211; String Literal, String Pool, String Objects</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>         String is a special non primitive data type in java if we compare with any others. But why! In String, we are having string pool as well as heap memory to store the values. The strings are immutable by nature. String is an object which contains sequence of character&#8217;s. String is not belong to primitive data type whereas we can create object using <em>java.lang.String</em>. There are two ways to create the string in Java.</p>
<p>             1. By Literal in Java</p>
<p>             2. By New Keyword</p>
<h2>String Literal in Java</h2>
<p>String Literals are very special in Java. We can create String object using double quotes as followed,</p>
<pre><code class="language-java">String message = "Hello ! I am a string";</code></pre>
<p>The above code calls the intern() method of string first. Then the intern checks whether the same object is exists in pool or not!. If it is exist, it will return the same object reference. Otherwise It will create the new object in the pool and return the new object reference. Ultimately the string literal should be fast if we compare with new keyword since it will not create the new objects every time.</p>
<p><img decoding="async" class="wp-image-1704 size-large aligncenter" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/untitled_page.png?resize=640%2C277&#038;ssl=1" alt="String Literal" width="640" height="277" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/untitled_page.png?resize=1024%2C443&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/untitled_page.png?resize=300%2C130&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/untitled_page.png?resize=768%2C333&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/untitled_page.png?resize=1536%2C665&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/untitled_page.png?w=1725&amp;ssl=1 1725w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/untitled_page.png?w=1280&amp;ssl=1 1280w" sizes="(max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></p>
<h2>By New Keyword</h2>
<p>We can create String object using new keyword as followed,</p>
<pre><code class="language-java">String message = new String("Hello ! I am a string");</code></pre>
<p>The above code creates two string objects. It will create one object in Heap Memory directly and other in String Pool Area. And the reference will points to heap memory object.</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-1717 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/heap-1.png?resize=640%2C360&#038;ssl=1" alt="new of string in java" width="640" height="360" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/heap-1.png?w=1064&amp;ssl=1 1064w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/heap-1.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/heap-1.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/09/heap-1.png?resize=768%2C432&amp;ssl=1 768w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></p>
<h3>Caution in String Compare</h3>
<p>We have to use equals method of string to compare two strings always, not ==. Because == compares only the memory locations. But the equals method compare the memory location as well as the content of the stored objects.</p>
<pre><code class="language-java">String a = "Hello";
String b = "Hello";

// since literals re-use existing objects from the pool
System.out.println(a == b) // true

String c = new String("Hello");

// new keyword always creates new objects in the heap
// And == compares the memory locations not the exact
// content of the objects
System.out.println(a == c) // false

// Always use equals for comparison
// String class equals method checks the content of the 
// object as well
System.out.println(a.equals(c)) // true</code></pre>
<h2>Why String is Immutable</h2>
<p>The rule to create any <a href="https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html">immutable object</a> is, it&#8217;s state can not be changed after it is created. And String class designed to follow this rule. Even we could create N number of objects by following this rule. Let&#8217;s come to the point, why string is immutable ? The most correct answer is probably: Because the java language authors or designers figured it was a good idea. So that It will provide lot of benefits to us, Let&#8217;s see one by one.</p>
<h3>Security</h3>
<p>We have been mostly using string object in network connections, database connection URLs, usernames/passwords and etc. It it were mutable, we can change these parameters and runtime And which creates security issues.</p>
<h4>Synchronization And Concurrency</h4>
<p>We can say an object is thread safe, when multiple threads are operating on it but none of them is able to corrupt its state and object hold the same state for every thread at any point in time. Making String immutable automatically makes them thread safe by default thereby solving the synchronization issues.</p>
<h4>Caching</h4>
<p>when compiler optimizes your String objects, it sees that if two objects have same value (a=&#8221;test&#8221;, and b=&#8221;test&#8221;) and thus you need only one string object (for both a and b, these two will point to the same object)</p>
<h4>Hash Code Caching</h4>
<p>String object caches its hash code at the time of object creation which makes it the great candidate for hashing related operations because hash code doesn&#8217;t need to be calculated again which save us some time. This is why String is mostly used as <code>Hash Map</code> keys</p>
<h4>Class Loading</h4>
<p>We have been using String as an arguments for class loading. If mutable, it could result in wrong class being loaded (because mutable objects change their state).</p>
<h2>Summary</h2>
<ol>
<li>
<p>Usually we design classes as immutable for them being thread safe and to optimize performance and memory consumption.</p>
</li>
<li>
<p>Security and Efficiency to be the primary design goals, then immutable strings are a means to meet those goals.</p>
</li>
<li>
<p>immutable objects in java are like copy-by-value, you can have 2 references to a String, but you should consider them 2 separate Strings since it&#8217;s immutable, and working with one of them won&#8217;t affect the other.</p>
</li>
</ol>
<h3>You May Also Like</h3>
<ul>
<li><a href="https://programeasily.com/2022/01/04/java-8-interview-questions-for-experienced/">Java 8 Interview Questions for Experienced</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/09/01/string-in-java/">String in Java &#8211; String Literal, String Pool, String Objects</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programeasily.com/2022/09/01/string-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1672</post-id>	</item>
		<item>
		<title>Pinia &#8211; The Vue Store Library</title>
		<link>https://programeasily.com/2022/08/23/pinia-the-vue-store-library/</link>
					<comments>https://programeasily.com/2022/08/23/pinia-the-vue-store-library/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Tue, 23 Aug 2022 04:14:22 +0000</pubDate>
				<category><![CDATA[Vuejs]]></category>
		<category><![CDATA[pinia]]></category>
		<category><![CDATA[store]]></category>
		<category><![CDATA[vue]]></category>
		<category><![CDATA[vue3]]></category>
		<guid isPermaLink="false">https://programeasily.com/?p=688</guid>

					<description><![CDATA[<p>What is Pinia Pinia is a library store for Vue.js. It will work with Vue.js 3 as well as Vue.js 2. Pinia holds the state and business logic which is not bounded with component object trees. In other words, I would say it creates a global state where everybody can read and write the data. Pinia has three area&#8217;s as follows, State Getters Action We can assume and compare these things with data, computed and methods in components. Why Pinia...</p>
<p class="read-more"><a class="btn btn-default" href="https://programeasily.com/2022/08/23/pinia-the-vue-store-library/"> Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/08/23/pinia-the-vue-store-library/">Pinia &#8211; The Vue Store Library</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>What is Pinia</h2>
<p><span style="font-weight: 400;"><a href="https://pinia.vuejs.org/">Pinia</a> is a library store for <a href="https://programeasily.com/vue/">Vue.js</a>. It will work with Vue.js 3 as well as Vue.js 2. Pinia holds the state and business logic which is not bounded with component object trees. In other words, <strong>I would say it creates a global state where everybody can read and write the data</strong>. Pinia has three area&#8217;s as follows,</span></p>
<ol>
<li>State</li>
<li>Getters</li>
<li>Action</li>
</ol>
<p><span style="font-weight: 400;">We can assume and compare these things with data, computed and methods in components.</span></p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-1625 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/08/Snapshot_13.png?resize=640%2C360&#038;ssl=1" alt="Pinia Introduction" width="640" height="360" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/08/Snapshot_13.png?w=1920&amp;ssl=1 1920w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/08/Snapshot_13.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/08/Snapshot_13.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/08/Snapshot_13.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/08/Snapshot_13.png?resize=1536%2C864&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/08/Snapshot_13.png?resize=480%2C270&amp;ssl=1 480w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/08/Snapshot_13.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></p>
<h2 id="when-should-i-use-a-store" tabindex="-1">Why Pinia (A Store)</h2>
<p><span style="font-weight: 400;"><strong>Store will have the data that can be used everywhere in our application</strong>. Meanwhile we should avoid the local data in the store which can be added in the component instead. Pinia is a choice if your application needs to access the global state values.</span></p>
<h2>Features of Pinia</h2>
<ul>
<li>Hot module replacement
<ul>
<li>Modify your stores without reloading your page</li>
<li>Keep any existing state while developing</li>
</ul>
</li>
<li>Plugins: extend Pinia features with plugins</li>
<li>Proper TypeScript support or <strong>autocompletion</strong> for JS users</li>
<li>Server Side Rendering Support</li>
<li>Devtools support
<ul>
<li>A timeline to track actions, mutations</li>
<li>Stores appear in components where they are used</li>
<li>Time travel and easier debugging</li>
</ul>
</li>
</ul>
<h2>Full Tutorial</h2>
<h3>Installations</h3>
<p>You can install pinia with the help of NPM or Yarn as follows,</p>
<pre><code class="language-bash">npm install pinia
or
yarn add pinia</code></pre>
<h3>Inject Pinia with CreateApp</h3>
<p><span style="font-weight: 400;">Here we are going to have only one store for the application. So we have to create its instance and inject the same in VUE createApp. You can call it a root store.</span></p>
<pre><code class="language-javascript">import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'

const pinia = createPinia()
const app = createApp(App)

app.use(pinia)
app.mount('#app')</code></pre>
<p><span style="font-weight: 400;">So what createPinia does here ?. It creates the entity which holds the state for our application. And It&#8217;s global state where one can read and write as well. It has three concepts or property&#8217;s</span></p>
<ol>
<li>state</li>
<li>getters</li>
<li>actions</li>
</ol>
<p>(You can assume this three components with data, computed and methods)</p>
<h3>Create the Store</h3>
<p><span style="font-weight: 400;">First we need to create the store template. We can create a store template using defineStore() and it requires a unique name. We may use this template across our application.</span></p>
<pre><code class="language-javascript">import { defineStore } from 'pinia'

// useStore could be anything like useUser, useCart
// the first argument is a unique id of the store across your application
export const useStore = defineStore('main', {
  // other options...
})</code></pre>
<p><span style="font-weight: 400;">Second we need to use this store template inside the setup() function so that it will create the store. We have to call useStore() as follows,</span></p>
<pre><code class="language-javascript">import { useStore } from '@/stores/counter'

export default {
  setup() {
    const store = useStore()

    return {
      // you can return the whole store instance to use it in the template
      store,
    }
  },
}</code></pre>
<p><span style="font-weight: 400;">Once the store is created you can access its properties like state, getters and actions.</span></p>
<h3>State</h3>
<p>The state is the heart of the system. It is a function that returns the initial state of the application.</p>
<pre><code class="language-javascript">import { defineStore } from 'pinia'

const useStore = defineStore('storeId', {
  // arrow function recommended for full type inference
  state: () =&gt; {
    return {
      // all these properties will have their type inferred automatically
      counter: 0,
      name: 'Eduardo',
      isAdmin: true,
    }
  },
})</code></pre>
<p><span style="font-weight: 400;">We can access the store to read and write its data through store instance, and we can reset it to the initial state as well</span></p>
<pre><code class="language-javascript">const store = useStore()

store.counter++

store.$reset()</code></pre>
<h3>Getter</h3>
<p><span style="font-weight: 400;">We can define the getters property in defineStore() template. I would say, it is a replacement for computed values.</span></p>
<pre><code class="language-javascript">export const useStore = defineStore('main', {
  state: () =&gt; ({
    counter: 0,
  }),
  getters: {
    // automatically infers the return type as a number
    doubleCount(state) {
      return state.counter * 2
    },
    // the return type **must** be explicitly set
    doublePlusOne(): number {
      // autocompletion and typings for the whole store 
      return this.doubleCount + 1
    },
  },
})</code></pre>
<p><span style="font-weight: 400;">Then we can access and use the getters inside the template as follows,</span></p>
<pre><code class="language-javascript">&lt;template&gt;
  &lt;p&gt;Double count is {{ store.doubleCount }}&lt;/p&gt;
&lt;/template&gt;

&lt;script&gt;
export default {
  setup() {
    const store = useStore()

    return { store }
  },
}
&lt;/script&gt;</code></pre>
<h3>Actions</h3>
<p><span style="font-weight: 400;">Actions are the replacement for the methods. We can add our actions in the defineStore() template. Unlike getters, we can write </span><b>asynchronous </b><span style="font-weight: 400;">operations inside action. It will useful for creating API calls for our business logic</span></p>
<pre><code class="language-javascript">import { mande } from 'mande'

const api = mande('/api/users')

export const useUsers = defineStore('users', {
  state: () =&gt; ({
    userData: null,
    // ...
  }),

  actions: {
    async registerUser(login, password) {
      try {
        this.userData = await api.post({ login, password })
        showTooltip(`Welcome back ${this.userData.name}!`)
      } catch (error) {
        showTooltip(error)
        // let the form component display the error
        return error
      }
    },
  },
})</code></pre>
<h2>Summary</h2>
<ul>
<li>Pinia is a store library for Vue, it allows you to share a state across components/pages.</li>
<li>Compared to Vuex, Pinia provides a simpler API with less ceremony, offers Composition-API-style APIs, and most importantly, has solid type inference support when used with TypeScript.</li>
<li>The formula is Create the template -&gt; create the store with state, getters and actions and use across the application.</li>
</ul>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/08/23/pinia-the-vue-store-library/">Pinia &#8211; The Vue Store Library</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programeasily.com/2022/08/23/pinia-the-vue-store-library/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">688</post-id>	</item>
		<item>
		<title>Vue vs React vs Angular</title>
		<link>https://programeasily.com/2022/03/07/vue-vs-react-vs-angular/</link>
					<comments>https://programeasily.com/2022/03/07/vue-vs-react-vs-angular/#comments</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Mon, 07 Mar 2022 15:51:04 +0000</pubDate>
				<category><![CDATA[Frontend]]></category>
		<category><![CDATA[angular]]></category>
		<category><![CDATA[react]]></category>
		<category><![CDATA[vue]]></category>
		<guid isPermaLink="false">https://programeasily.com/?p=854</guid>

					<description><![CDATA[<p>Today in the front end world, people are moving to modern JavaScript frameworks rather than hanging with legacy frameworks like jQuery, Google Closure. Among them, React Angular Vue.js are the declarative and component based rich frameworks. These three are perfect and stand by their super features as well. But What you will choose ? That&#8217;s the question here. And the answer is, it all depends. Yes, it depends upon your use cases, projects and requirements. Still in struggle to pick...</p>
<p class="read-more"><a class="btn btn-default" href="https://programeasily.com/2022/03/07/vue-vs-react-vs-angular/"> Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/03/07/vue-vs-react-vs-angular/">Vue vs React vs Angular</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Today in the front end world, people are moving to modern JavaScript frameworks rather than hanging with legacy frameworks like jQuery, Google Closure. Among them,</p>
<ul>
<li>React</li>
<li>Angular</li>
<li>Vue.js</li>
</ul>
<p><span style="font-weight: 400;">are the declarative and component based rich frameworks. These three are perfect and stand by their super features as well. But What you will choose ? That&#8217;s the question here. And the answer is, it all depends. Yes, it depends upon your use cases, projects and requirements. Still in struggle to pick one, then this article for you. Let&#8217;s take a deep dive into it.</span></p>
<h3>Vue vs React vs Angular</h3>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-892" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/Vue-vs-React-vs-Angular.png?resize=640%2C293&#038;ssl=1" alt="Vue vs React vs Angular" width="640" height="293" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/Vue-vs-React-vs-Angular.png?w=1284&amp;ssl=1 1284w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/Vue-vs-React-vs-Angular.png?resize=300%2C137&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/Vue-vs-React-vs-Angular.png?resize=1024%2C469&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/Vue-vs-React-vs-Angular.png?resize=768%2C352&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/Vue-vs-React-vs-Angular.png?resize=590%2C270&amp;ssl=1 590w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></p>
<h2>What Should I Choose Between React, Angular and Vue.js</h2>
<p><span style="font-weight: 400;">We can create and update dynamic web pages using JavaScript. Though JavaScript is good, it is really difficult sometimes to build a complex website. You have to work with DOM and manipulate Data. Oh!! It&#8217;s not the best way right. Even frameworks like jQuery couldn&#8217;t solve such problems. So these frameworks segregate the process into four modules,</span></p>
<ol>
<li>Core Library</li>
<li>Virtual DOM</li>
<li>Data</li>
<li>Components</li>
</ol>
<p><span style="font-weight: 400;">Virtual DOM acts as a shallow DOM of the web pages. </span><b>I would say that the Virtual DOM will respond while we change the Data. It will maintain the old data and compare the same with new one while we refresh it</b><span style="font-weight: 400;">. So it will update the actual DOM, whenever there is a difference in old and new data. We are calling this Reactive feature. You don&#8217;t have to worry about the traditional DOM update process, rather you can concentrate more on your business data. Design the UI as a component and pass the data dynamically into it. Core Library will have all common library files for the utilities. These are all the fundamental features of these modern frameworks. This really makes our work simple and helps to build responsive rich applications.</span></p>
<h2>Vue vs React vs Angular &#8211; Survey</h2>
<p>Survey of most popular web frameworks &#8211; Year 2021</p>
<p><a href="https://insights.stackoverflow.com/survey/2021#most-loved-dreaded-and-wanted-language-want"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-888" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/web-framework-stack-overflow-survey-programeasily.png?resize=640%2C418&#038;ssl=1" alt="Web frameworks-Survey" width="640" height="418" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/web-framework-stack-overflow-survey-programeasily.png?w=1276&amp;ssl=1 1276w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/web-framework-stack-overflow-survey-programeasily.png?resize=300%2C196&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/web-framework-stack-overflow-survey-programeasily.png?resize=1024%2C669&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/web-framework-stack-overflow-survey-programeasily.png?resize=768%2C502&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/03/web-framework-stack-overflow-survey-programeasily.png?resize=413%2C270&amp;ssl=1 413w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p><strong>LINK</strong> &#8211; <a href="https://insights.stackoverflow.com/survey/2021#section-most-popular-technologies-web-frameworks">https://insights.stackoverflow.com/survey/2021#section-most-popular-technologies-web-frameworks</a></p>
<h2>React</h2>
<p><span style="font-weight: 400;">React is the most popular and has more than</span><a href="https://github.com/facebook/react"> <span style="font-weight: 400;">183k GitHub stars</span></a><span style="font-weight: 400;">. React is not a new language; rather I would say it is just a JavaScript framework. Anyone who knows JavaScript, is able to adapt themselves over a short period. It was created by Facebook and made open source later. So it has a large DEV Community as well. It is really simple to approach people. You could clarify your questions and concepts easily.</span></p>
<h2>When to prefer React Over Angular and VUE</h2>
<ul>
<li style="list-style-type: none;">
<ul>
<li style="font-weight: 400;" aria-level="1"><b>React is simple to learn.</b><span style="font-weight: 400;"> Over a short period you can adapt to it. Whereas Angular is a type-script based language and will take time to learn about the inbuilt framework functionalities.</span></li>
<li style="font-weight: 400;" aria-level="1"><b>React follows one way data flow which helps to identify the state change easily.</b><span style="font-weight: 400;"> Whereas angular follows Bi-directional data flow. This makes it harder to control the data flow.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Angular uses traditional DOM. So it needs to rewrite the whole HTML tree when we change the data ( To compromise this they are using a change detection mechanism). </span><b>React Virtual DOM is much faster than angular traditional DOM.</b><span style="font-weight: 400;"> It will not rewrite the entire HTML tree when we change the data.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Most people prefer React. Oh this is a really nice one right!</span></li>
</ul>
<ul>
<li style="font-weight: 400;" aria-level="1"><b>React has a larger DEV Community than Vue.js.</b><span style="font-weight: 400;"> You can clarify the doubts easily here.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">If you love JSX templates over HTML templates you would prefer React. But most people won&#8217;t prefer JSX syntax.</span></li>
<li style="font-weight: 400;" aria-level="1"><b>You can use React with React native as well for mobile application development.</b><span style="font-weight: 400;"> This will help to write some common functionalities.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">If you are going to depend on a lot of third party dependencies, then you can prefer React.</span></li>
</ul>
</li>
</ul>
<h2>VUE</h2>
<p><a href="https://programeasily.com/vue/" target="_blank" rel="noopener"><span style="font-weight: 400;">Vue.js</span></a><span style="font-weight: 400;"> is an open source JavaScript Framework. It was created by</span><a href="https://twitter.com/youyuxi"> <span style="font-weight: 400;">Evan You</span></a><span style="font-weight: 400;"> and maintained by active core team members along with him. Vue.js is used mainly to create rich single page applications and user interfaces. Believe me, Vue.js has 194k stars more than React in GitHub. It is one of the growing languages. And it is very simple to learn. Whoever knows JavaScript, then can easily adapt themselves to learn VUE in a very short time.</span></p>
<h2>When to prefer VUE over React and Angular</h2>
<ul>
<li style="font-weight: 400;" aria-level="1"><b>Vue.js is very simple and easier than React as well.</b><span style="font-weight: 400;"> The single file components contain HTML, CSS and Script in the same file which makes developer friendly component design.</span></li>
<li style="font-weight: 400;" aria-level="1"><b>Size of the Vue.js runtime library is very small.</b><span style="font-weight: 400;"> Even lightweight than React.</span></li>
<li style="font-weight: 400;" aria-level="1"><b>If you love HTML templates and CSS over JSX,</b><span style="font-weight: 400;"> then VUE is your language.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">In React when the component state changes, it will trigger the re-render for the entire component sub-tree, taking that component as root. But in VUE, </span><b>a component’s dependencies are automatically tracked during its render, so the system knows precisely which components actually need to re-render when state changes.</b></li>
<li style="font-weight: 400;" aria-level="1"><b>React also follows one way data flow like React. </b><span style="font-weight: 400;">When you update the parent component, it will re-render all it&#8217;s children.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Code readability is better compared to React and Angular.</span></li>
</ul>
<h2>Angular</h2>
<p>Angular is a type script based open source front end framework. It was created and maintained by google. Angular is a choice for most large companies since it has been used to develop enterprise-grade applications. It is having 79.k stars by today. Angular uses traditional DOM. So it needs to rewrite the whole HTML tree when we change the data ( To compromise this they are using change detection mechanism).</p>
<h2>When to prefer Angular Over React and VUE</h2>
<ul>
<li><b>Angular has an in-built Material toolset</b><span style="font-weight: 400;"> which offers a lot of components. It makes it easier to design the rich design in a fast manner.</span></li>
<li><b>Angular also has a large DEV community</b><span style="font-weight: 400;"> which makes solving the problem easier.</span></li>
<li><b>It is well suited for enterprise level application development</b><span style="font-weight: 400;"> since it is a framework (Whereas React and VUE are libraries).</span></li>
<li><span style="font-weight: 400;">Angular has a lot of inbuilt tools and modules which offers us not to depend on external libraries.</span></li>
<li><b>Angular follows bi-directional data flow.</b><span style="font-weight: 400;"> It has both pros and cons. And this makes the development a little bit easier.</span></li>
<li><b>Angular uses a change detection mechanism to detect the state change.</b><span style="font-weight: 400;"> So even if it updates the entire tree of real DOM, it effectively matches the performance of Virtual DOM operation.</span></li>
</ul>
<h2>Vue vs React vs Angular &#8211; Summary</h2>
<p>I would say, all three frameworks are good. The matter is which one suites our requirement,</p>
<ol>
<li>If you want to learn quickly, you are going to create a simple website UI, you don&#8217;t want any community support and want to use HTML and CSS to design then I will prefer <strong>VUE</strong>.</li>
<li><strong>React</strong> can be preferred when you want to learn quickly, you are going to create a simple or medium UI with community support and third party dependencies .</li>
<li>If you going to create enterprise level application, then <strong>Angular</strong> is your choice.</li>
</ol>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/03/07/vue-vs-react-vs-angular/">Vue vs React vs Angular</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programeasily.com/2022/03/07/vue-vs-react-vs-angular/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">854</post-id>	</item>
		<item>
		<title>Props in Vue 3</title>
		<link>https://programeasily.com/2022/02/26/props-in-vue-3/</link>
					<comments>https://programeasily.com/2022/02/26/props-in-vue-3/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sat, 26 Feb 2022 18:04:59 +0000</pubDate>
				<category><![CDATA[Vuejs]]></category>
		<category><![CDATA[vue]]></category>
		<category><![CDATA[vue3]]></category>
		<guid isPermaLink="false">https://programeasily.com/?p=221</guid>

					<description><![CDATA[<p>In the HTML elements, we are having attributes. This attribute provides additional information about elements. Similarly, we are having props as attributes for Components in Vue.js. Props provides additional information about the components. But there is an important difference between HTML elements and Components Props. To clarify, props are reactive and follow one way data flow with its children. Vue.js components require explicit props declaration which it assumes as it&#8217;s attributes. Props are declared using the props option, export default...</p>
<p class="read-more"><a class="btn btn-default" href="https://programeasily.com/2022/02/26/props-in-vue-3/"> Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/02/26/props-in-vue-3/">Props in Vue 3</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="font-weight: 400;">In the HTML elements, we are having attributes. This attribute provides additional information about elements. Similarly, we are having props as attributes for Components in Vue.js. <strong>Props provides additional information about the components.</strong> But there is an important difference between HTML elements and Components Props. To clarify, props are reactive and follow one way data flow with its children. Vue.js components require explicit props declaration which it assumes as it&#8217;s attributes. Props are declared using the props option,</span></p>
<pre><code class="language-javascript">export default {
  props: ['foo'],
  created() {
    // props are exposed on `this`
    console.log(this.foo)
  }
}</code></pre>
<p>Let&#8217;s take a deep dive into that with this post. If you are not familiar with Vue.js components, You should read <a href="https://programeasily.com/2020/12/22/components-in-vue-3/">Components in Vue 3 </a> first.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-870" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/02/Props-in-Vue-3.jpg?resize=640%2C427&#038;ssl=1" alt="Props in Vue 3" width="640" height="427" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2022/02/Props-in-Vue-3.jpg?w=1280&amp;ssl=1 1280w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/02/Props-in-Vue-3.jpg?resize=300%2C200&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/02/Props-in-Vue-3.jpg?resize=1024%2C682&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/02/Props-in-Vue-3.jpg?resize=768%2C512&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2022/02/Props-in-Vue-3.jpg?resize=405%2C270&amp;ssl=1 405w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></p>
<h2>One way data flow &#8211; Props in Vue 3</h2>
<p><span style="font-weight: 400;">Props follows one way data flow with it&#8217;s child component property. <strong>As a result, when we update the value of parent props, it will flow down and update the child property as well.</strong> At the same time it will not do vice versa. If you want to update the component state, the flow should start from the parent and all props in the child component will be refreshed with the latest value. We are having event emit concept to reverse back from child to parent in Vue.js.</span></p>
<pre><code class="language-javascript">export default {
  props: ['foo'],
  created() {
    // &#x274c; warning, props are readonly!
    this.foo = 'bar'
  }
}</code></pre>
<p>Suppose if you want to change the prop in the child component based on business scenario, you can transform the same using <a href="https://programeasily.com/2021/01/30/computed-in-vue-3/">computed in Vue.js</a></p>
<pre><code class="language-javascript">export default {
  props: ['size'],
  computed: {
    // computed property that auto-updates when the prop changes
    normalizedSize() {
      return this.size.trim().toLowerCase()
    }
  }
}</code></pre>
<h4>Note</h4>
<p><span style="font-weight: 400;">However, when passing arrays and objects as props, Vue.js will not prevent mutation of it&#8217;s nested properties. Because objects and arrays are passed by reference. Firstly, you should avoid such mutations as a best practice. Secondly, if you need this scenario in-deed, the child can emit an event and the parent listens to it and performs the mutation.</span></p>
<h2>Static and Dynamic Props</h2>
<p>The static props are nothing but just assign the static values like below,</p>
<pre><code class="language-markup">&lt;Blog title="I am a static prop example" /&gt;
</code></pre>
<p>You can also assign dynamic values to props with the help of  <code>v-bind</code> or its <code>:</code> like below</p>
<pre><code class="language-javascript">&lt;!-- Dynamically assign the value of a variable --&gt;
&lt;Blog v-bind:title="post.title"&gt;&lt;/Blog&gt;
// OR
&lt;Blog :title="post.title" &lt;/Blog&gt;</code></pre>
<h3>Passing other different values to prop</h3>
<p>We can pass Numbers, Boolean, Arrays as well as Object to a props value.</p>
<pre><code class="language-markup">// Number
&lt;!-- Even though `42` is static, we need v-bind to tell Vue that --&gt;
&lt;!-- this is a JavaScript expression rather than a string.  --&gt;
&lt;Blog :likes="42" /&gt;

&lt;!-- Dynamically assign to the value of a variable. --&gt;
&lt;Blog :likes="post.likes" /&gt;

// Boolean
&lt;!-- Including the prop with no value will imply `true`. --&gt;
&lt;Blog is-published /&gt;

&lt;!-- this is a JavaScript expression rather than a string. --&gt;
&lt;Blog :is-published="false" /&gt;

&lt;!-- Dynamically assign to the value of a variable. --&gt;
&lt;Blog :is-published="post.isPublished" /&gt;

// Array
&lt;!-- this is a JavaScript expression rather than a string. --&gt;
&lt;Blog :comment-ids="[234, 266, 273]" /&gt;

&lt;!-- Dynamically assign to the value of a variable. --&gt;
&lt;Blog :comment-ids="post.commentIds" /&gt;

// Object
&lt;!-- this is a JavaScript expression rather than a string. --&gt;
&lt;Blog
  :author="{
    name: 'Veronica',
    company: 'Veridian Dynamics'
  }"
 /&gt;

&lt;!-- Dynamically assign to the value of a variable. --&gt;
&lt;Blog :author="post.author" /&gt;</code></pre>
<h2>Validation &#8211; Props in Vue 3</h2>
<p><span style="font-weight: 400;">There are three ways of prop validations available in Vue.js. <strong>If the validation fails, then Vue.js will warn us in the browser&#8217;s JavaScript console.</strong> This is really needed to define the component and the application developers are aware of the intention of the component as well.</span></p>
<ol>
<li>Type validation</li>
<li>Mandatory or not (Required)</li>
<li>Custom validator</li>
</ol>
<pre><code class="language-javascript">export default {
  props: {
    // 1. Type Validation
    //  (`null` and `undefined` values will allow any type)
    propA: Number,
    // Multiple possible types
    propB: [String, Number],
    // 2. Mandatory validation with default value
    propC: {
      type: String,
      required: true,
      default: "Hello"
    },
    // 3. Custom validator
    propF: {
      validator(value) {
        // The value must match one of these strings
        return ['success', 'warning', 'danger'].includes(value)
      }
    }
  }
}</code></pre>
<h2>In setup Hook &#8211; Props in Vue 3</h2>
<p>The setup function is the entry point of the Composition API in Vue.js. The first argument of the setup function is the props argument. <strong>Props inside the setup function are reactive by nature.</strong></p>
<pre><code class="language-javascript">export default {
  props: {
    title: String
  },
  setup(props) {
    console.log(props.title)
  }
}</code></pre>
<p><span style="font-weight: 400;">If you destructor the props object, it will lose the reactivity. So we should avoid changing the props object there. But if you really need to destructor the props, you can go for</span><a href="https://vuejs.org/api/reactivity-utilities.html#torefs"> <span style="font-weight: 400;">toRefs()</span></a><span style="font-weight: 400;"> and </span><a href="https://vuejs.org/api/reactivity-utilities.html#toref"><span style="font-weight: 400;">toRef()</span></a><span style="font-weight: 400;"> API.</span></p>
<pre><code class="language-javascript">import { toRefs } from 'vue'

export default {
  setup(props) {
    // turn `props` into an object of refs, then destructure
    const { title } = toRefs(props)
    // `title` is a ref that tracks `props.title`
    console.log(title.value)

    // OR, turn a single property on `props` into a ref
    const title = toRef(props, 'title')
  }
}</code></pre>
<h2>Special Feature &#8211; Boolean Casting</h2>
<p>When we use Boolean props , <span style="font-weight: 400;">it has a</span> special casting rule. It is similar to the native Boolean attribute in any programming language. Let me show you with below example,</p>
<pre><code class="language-javascript">&lt;!-- equivalent of passing :disabled="true" --&gt;
&lt;MyComponent disabled /&gt;

&lt;!-- equivalent of passing :disabled="false" --&gt;
&lt;MyComponent /&gt;

// The casting rules for Boolean will apply regardless of type appearance order for below example as well
export default {
  props: {
    disabled: [Boolean, Number]
  }
}</code></pre>
<h2><strong>Name Casing in Props</strong></h2>
<p>When we declare props in Vue.js we have to follow camelCase. It will avoid to use quotes when we dealing them as property keys, and makes as valid JavaScript identifiers.</p>
<pre><code class="language-javascript">export default {
  props: {
    greetingMessage: String
  }
}
// using the “Mustache” syntax (double curly braces)
&lt;span&gt;{{ greetingMessage }}&lt;/span&gt;
</code></pre>
<p><span style="font-weight: 400;">So when we pass the props values to the child component , we can use camelCase. <strong>But Here the convention is kebab-case similar to the one below.</strong></span></p>
<pre><code class="language-javascript">&lt;MyComponent greeting-message="hello" /&gt;
</code></pre>
<h2>Summary</h2>
<p>In Conclusion,</p>
<ul>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Firstly, <strong>we are having props as attributes for Components in Vue.js. Props provides additional information about the components.</strong></span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">Secondly, props follows one way data flow with it&#8217;s child component property. <strong>When we update the value of parent props, it will flow down and update the child property as well.</strong> At the same time it will not vice versa.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">In Vue.js 3, The first argument of the setup function is the props argument. <strong>Props inside the setup function are reactive by nature.</strong></span></li>
</ul>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/02/26/props-in-vue-3/">Props in Vue 3</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programeasily.com/2022/02/26/props-in-vue-3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">221</post-id>	</item>
		<item>
		<title>Java 8 Interview Questions for Experienced</title>
		<link>https://programeasily.com/2022/01/04/java-8-interview-questions-for-experienced/</link>
					<comments>https://programeasily.com/2022/01/04/java-8-interview-questions-for-experienced/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Tue, 04 Jan 2022 09:36:49 +0000</pubDate>
				<category><![CDATA[Interview Questions]]></category>
		<category><![CDATA[Java Interview Questions]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java-8]]></category>
		<guid isPermaLink="false">https://programeasily.com/?p=540</guid>

					<description><![CDATA[<p>As same as in the previous versions, Java released two products in it&#8217;s 8th version. One is JRE-8 (Runtime environment) and the other one is JDK-8 (Development kit). JRE provides the base libraries (lang and util, input/output etc.), integration libraries (JDBC, RMI etc.), user interface toolkits (Java FX, Swing etc.) and deployments (Java web start). On the other hand, JDK has everything from JRE, in addition to tools like compiler, debuggers and API which are necessary for developing the applications....</p>
<p class="read-more"><a class="btn btn-default" href="https://programeasily.com/2022/01/04/java-8-interview-questions-for-experienced/"> Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/01/04/java-8-interview-questions-for-experienced/">Java 8 Interview Questions for Experienced</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="font-weight: 400;">As same as in the previous versions, Java released two products in it&#8217;s 8th version. One is JRE-8 (Runtime environment) and the other one is JDK-8 (Development kit). JRE provides the base libraries (lang and util, input/output etc.), integration libraries (JDBC, RMI etc.), user interface toolkits (Java FX, Swing etc.) and deployments (Java web start). On the other hand, JDK has everything from JRE, in addition to tools like compiler, debuggers and API which are necessary for developing the applications.</span></p>
<p><a href="https://docs.oracle.com/javase/8/docs/"><span style="font-weight: 400;">Java edition 8</span></a><span style="font-weight: 400;"> is a major release after the 6th edition. In this article we are going to refresh the concepts which will help us to improve the interview experience. Let&#8217;s take a deep dive into it.</span></p>
<h2>Java 8 Interview Questions for Experienced</h2>
<h2><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-726" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/12/java-8-interview-questions.png?resize=640%2C360&#038;ssl=1" alt="Java 8 Interview Questions" width="640" height="360" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/12/java-8-interview-questions.png?w=1366&amp;ssl=1 1366w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/12/java-8-interview-questions.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/12/java-8-interview-questions.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/12/java-8-interview-questions.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/12/java-8-interview-questions.png?resize=480%2C270&amp;ssl=1 480w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/12/java-8-interview-questions.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></h2>
<h3>1. Features of Java 8</h3>
<ul>
<li>Lambda Expressions &#8211; Lambda expressions are anonymous functions or methods without the name</li>
<li>Functional Interface &#8211; It is a single abstract method (SAM) interface, i.e. interface with only one abstract method.</li>
<li>Default Method &#8211; the default implementation of the method and we can override it in the concrete class if required.</li>
<li>Method Reference &#8211; <span style="font-weight: 400;">It will just refer to the existing method with name. An easy way of referring to a method of a functional interface.</span></li>
<li>Stream &#8211; a sequence of elements involved with sequential and parallel aggregate operations. The operations are composed into a stream pipeline.</li>
<li>Optional &#8211; A wrapper object which may or may not contain a non null value.</li>
<li>Static methods in interface &#8211; Static methods makes it easier to organize the helper methods in our libraries. We can create static methods specific to an interface in the same interface rather than in a separate class.</li>
<li>Nashorn &#8211; The Nashorn engine is an implementation of the ECMAScript. Nashorn Java API allows us to write Java Applications as scripts which can be interpreted by the Nashorn engine.</li>
</ul>
<h3>2. What are functional interface</h3>
<p><span style="font-weight: 400;">Java 8 introduced the concept of functional programming with the help of functional interfaces. It is a <strong>single abstract method</strong> (SAM) interface, i.e. interface with only one abstract method. So one abstract method is responsible for one particular functionality. <strong>@FunctionalInterface</strong> annotation is used to indicate that the interface is a functional interface. This annotation is not mandatory. It just let the compilers to throw the error incase if we maintain more than one abstract method in the interface.</span></p>
<p><span style="font-weight: 400;">Note that, we can create the functional interface instances with the help of lambda expressions, method references or constructor references.</span></p>
<h3>3. Some Predefined functional interfaces</h3>
<ul>
<li><strong>Consumer</strong> &#8211; a function that accepts a single input argument and returns no result.</li>
<li><strong>Function</strong> &#8211; a function that accepts one argument and produces a result.</li>
<li><strong>Predicate</strong> &#8211; Represents a predicate (boolean-valued function) of one argument.</li>
<li><strong>Supplier</strong> &#8211; a function that does not accept input and produces a result.</li>
</ul>
<h3>4. What is lambda expression</h3>
<p>Lambda expressions are anonymous functions or methods without the name. We can replace the anonymous class implementation with the help of lambda expressions after Java-8. We can pass functionality as an argument to another method here. Some of the key points are,</p>
<ul>
<li>Function without a name</li>
<li>Anonymous function</li>
<li>Executes on demand</li>
<li>Applied only to functional interface</li>
<li>Standalone, does not belong to any class</li>
</ul>
<p>The Lambda expression syntax consists of the following,</p>
<ol>
<li>A comma separated list of parameters enclosed in parentheses</li>
<li>The Arrow token, -&gt;</li>
<li>A Body, which consists of a single expression or a statement block.</li>
</ol>
<pre><code class="language-java">// single parameter and single expression example,
p -&gt; p.getGender() &gt; 25 &amp;&amp; p.getGender() &lt;= 18

// multiple parameter example,
( a, b ) -&gt; a + b;

// statement block example,
p -&gt;{
     return  p.getGender() &gt; 25 &amp;&amp; p.getGender() &lt;= 18 ;
}
</code></pre>
<h3>5. What is default method</h3>
<p>Before Java 8, interfaces allowed abstract methods only. From Java-8, we can do the abstract method implementation in the interface itself. Let&#8217;s say the default implementation of the method and we can override it in the concrete class if required.</p>
<p>The idea behind the default method is that the java-8 team wants to introduce new abstract methods in the old utility libraries. If they do so, it will provide compiler error to all it&#8217;s implemented classes. So the default method was introduced to ensure backward compatibility. It enables you to add new methods to the old interfaces with the compatibility of it&#8217;s older versions of those interfaces.</p>
<h3>6. What is Method Reference</h3>
<p><span style="font-weight: 400;">Sometimes we want to create the lambda function(anonymous function) that does nothing but call an existing method. Here we are having the super shortcut called method reference. It will just refer to the existing method by name, an easy way of referring to a method of a functional interface.</span></p>
<pre><code class="language-java">// a lambda expression does nothing but call an existing method
Arrays.sort(rosterAsArray,
    (a, b) -&gt; Person.compareByAge(a, b)
);

// Using method reference
// refer to the existing method by name
Arrays.sort(rosterAsArray, Person::compareByAge);</code></pre>
<h3>7. What is Optional</h3>
<p><span style="font-weight: 400;">A wrapper object which may or may not contain a non null value. We can use optional to handle null values after Java-8. If value is not null, isPresent() will return true and get() will return the value.</span></p>
<pre><code class="language-java">// Creates the optional object
Optional.of(argument);</code></pre>
<h3>8. What is Stream</h3>
<p><span style="font-weight: 400;">A Stream is not a data structure that stores elements. It does not hold any data(No Storage). Whereas, is a sequence of elements involved with sequential and parallel aggregate operations. The operations are composed into a stream pipeline. The Stream pipeline consist of below components,</span></p>
<ul>
<li>A source (array, collection, generator function, an I/O channel)</li>
<li>Zero or more intermediate operations (each intermediate operation transform a stream into another stream)</li>
<li>A terminal operation (produces a result or side-effect)</li>
</ul>
<p><span style="font-weight: 400;">Here the important information is, you can have a number of intermediate operations and computation on the source data which is performed only when the terminal operation is initiated. Streams are Lazy and source elements are consumed only as needed.</span></p>
<h3>9. Stream vs Collection</h3>
<table dir="ltr" style="height: 410px;" border="1" width="637" cellspacing="0" cellpadding="0">
<colgroup>
<col width="331" />
<col width="275" /></colgroup>
<tbody>
<tr>
<td style="text-align: center;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Stream&quot;}"><strong>Stream</strong></td>
<td style="text-align: center;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Collections&quot;}"><strong>Collections</strong></td>
</tr>
<tr>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;No Storage. A stream is not a data structure that stores elements&quot;}">No Storage. A stream is not a data structure that stores elements</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Collections holds all the elements on memory&quot;}">Collections holds all the elements on memory</td>
</tr>
<tr>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Functional in nature. An operation on a stream produces a result, but does not modify its source&quot;}">Functional in nature. An operation on a stream produces a result, but does not modify its source</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Non Functional. An operations on a collection would modify its content&quot;}">Non Functional. An operations on a collection would modify its content</td>
</tr>
<tr>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Laziness-seeking. Many stream operations such as filtering, mapping can be implemented lazily.&quot;}">Laziness-seeking. Many stream operations such as filtering, mapping can be implemented lazily.</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Collections are not lazy&quot;}">Collections are not lazy</td>
</tr>
<tr>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Possibly unbounded. While collections have the finite size, streams need not. Short circuiting operations such as limit can allow compuations on infinite streams to complete in finite time&quot;}">Possibly unbounded. While collections have finite size, streams need not. Short circuiting operations such as limit can allow computations on infinite streams to complete in finite time</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;collections have the finite size&quot;}">Collections have the finite size</td>
</tr>
<tr>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Consumable. The elements of a stream are only visitied once during the life of a stream&quot;}">Consumable. The elements of a stream are only visited once during the life of a stream</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;We can process collections number of time&quot;}"><span style="font-weight: 400;">We can process collections a number of times.</span></td>
</tr>
<tr>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;API to process the data&quot;}">API to process the data</td>
<td data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Data structure which holds the data&quot;}">Data structure which holds the data</td>
</tr>
</tbody>
</table>
<h3>10. Intermediate operation vs Terminate operations in Stream</h3>
<p><span style="font-weight: 400;">Stream operations are divided into intermediate operations and terminal operations. They are combined to form a stream pipeline. </span><b>Intermediate operations</b><span style="font-weight: 400;"> return a new stream. It&#8217;s always lazy, meaning that executing intermediate operations such as filter() does not actually perform. But creates a new stream. When terminal operation is initiated, the traversal of all intermediate operations will be executed. </span><b>Terminal operations</b><span style="font-weight: 400;"> such as Stream.forEach may traverse the stream to produce the final result. After the terminal operation is performed, the stream pipeline is considered as consumed and can no longer be used.</span></p>
<h3>11. map vs flatmap</h3>
<p><strong>map</strong> <span style="font-weight: 400;">&#8211; Transforms the stream by applying the given function to all the elements of its stream. It is an intermediate operation.</span></p>
<pre><code class="language-java">// transforms all elements to uppercase
Stream.of("apple", "meta", "google")
        .map(mapper -&gt; mapper.toUpperCase()).collect(Collectors.toList());
// output
[APPLE, META, GOOGLE]</code></pre>
<p><strong>flatMap</strong> &#8211; flattening the resulting elements into a new stream. One-to-many transformation to the elements of the stream.</p>
<pre><code class="language-java">List&lt;Integer&gt; list1 = Arrays.asList(1,2,3);
        List&lt;Integer&gt; list2 = Arrays.asList(4,5,6);
        List&lt;Integer&gt; list3 = Arrays.asList(7,8,9);
        // flatten the elements into a single list
        List&lt;Integer&gt; result = Stream.of(list1, list2, list3)
        .flatMap(list -&gt; list.stream()).collect(Collectors.toList());

// output
[1, 2, 3, 4, 5, 6, 7, 8, 9]</code></pre>
<h3>12. findFirst vs findAny vs anyMatch vs allMatch vs noneMatch</h3>
<p><strong>findFirst</strong> &#8211; To find the first element of the stream. It will return the Optional object with either the first element or the empty optional object. This is a terminal operation.</p>
<pre><code class="language-java">Optional&lt;String&gt; first = Stream.of("apple", "meta", "google").findFirst();
System.out.println(first.get());
// output
apple</code></pre>
<p><strong>findAny</strong> &#8211; To find any element of the stream. It will return the Optional object with any one of the <span style="font-weight: 400;">elements </span> or the empty optional object. This is also a terminal operation.</p>
<pre><code class="language-java">Optional&lt;String&gt; any = Stream.of("apple", "meta", "google").findAny();
System.out.println(any.get());
// output
apple</code></pre>
<p><strong>anyMatch</strong> &#8211; <span style="font-weight: 400;">Returns true if any one of the elements evaluates true with the provided predicate. If the stream is empty or all elements evaluate false with the provided predicate then it will return false.</span></p>
<pre><code class="language-java">boolean any = Stream.of("apple", "meta", "google").anyMatch(predicate -&gt; predicate.equals("apple"));
System.out.println(any);
// output
true</code></pre>
<p><strong>allMatch</strong> &#8211; Returns true if all the elements <span style="font-weight: 400;">evaluate </span> true with the provided predicate. If the stream is empty then it will return true without evaluating the predicate.</p>
<pre><code class="language-java">boolean allMatch = Stream.of("apple", "meta", "google").allMatch(predicate -&gt; predicate instanceof String);
System.out.println(allMatch);
// output
true</code></pre>
<p><strong>noneMatch</strong> &#8211; Returns true if no elements evaluate true with the provided predicate. If the stream is empty then it will return true without evaluating the predicate.</p>
<pre><code class="language-java">boolean noneMatch = Stream.of("apple", "meta", "google").noneMatch(predicate -&gt; predicate.equals("facebook"));
System.out.println(noneMatch);
// output
true</code></pre>
<h3>13. skip vs limit vs count</h3>
<p><strong>skip</strong> &#8211; discards the first N elements of the stream. If the stream contains less elements than N ,then it will return an empty stream. This is an intermediate operation.</p>
<pre><code class="language-java">List&lt;Integer&gt; skipList = Stream.of(10,20,30,40,50).skip(2).collect(Collectors.toList());
System.out.println(skipList);
// output
[30, 40, 50]</code></pre>
<p><strong>limit</strong> &#8211; returns only the first N elements of the stream. It will throw an exception if the N is negative. This is also an intermediate operation.</p>
<pre><code class="language-java">// first skip the list, and then limit from it
List&lt;Integer&gt; limitList = Stream.of(10,20,30,40,50).skip(2).limit(2).collect(Collectors.toList());
System.out.println(limitList);
// output
[30, 40]</code></pre>
<p><strong>count</strong> &#8211; returns the count of elements in the stream. This is a terminal operation.</p>
<pre><code class="language-java">Long count = Stream.of(10,20,30,40,50).skip(2).limit(2).count();
System.out.println(count);
// output
2</code></pre>
<h3>14. map vs filter vs forEach vs sorted</h3>
<p><strong>map</strong> &#8211; a transformation operation. Returns a new stream after applying the given Function to all the elements of this stream. This is an intermediate operation.</p>
<pre><code class="language-java">&lt;R&gt; Stream&lt;R&gt; map(Function&lt;? super T, ? extends R&gt; mapper);
// Transformation operation
List&lt;String&gt; strings =  Stream.of("apple", "meta", "google")
        .map(mapper -&gt; mapper.toUpperCase()).collect(Collectors.toList());
// output
[APPLE, META, GOOGLE]</code></pre>
<p><strong>filter</strong> &#8211; Returns a new stream which matches the given predicate(the predicate should evaluate true). This is also an intermediate operation.</p>
<pre><code class="language-java">Stream&lt;T&gt; filter(Predicate&lt;? super T&gt; predicate);
// Filter operation
List&lt;Integer&gt; filterList = Stream.of(10,20,30,40,50)
                .filter(predicate -&gt; predicate &gt; 25).collect(Collectors.toList());
// output
[30, 40, 50]</code></pre>
<p><strong>forEach</strong> &#8211; Performs the action for each element of this stream. This is a terminal operation.</p>
<pre><code class="language-java">void forEach(Consumer&lt;? super T&gt; action);
// Just performs an action of its element
Stream.of(10,20,30,40,50).forEach(action -&gt; System.out.println(action));
// output
10
20
30
40
50</code></pre>
<p><strong>sorted</strong> &#8211; Returns a new stream after sorting the elements based on the provided Comparator. This is an intermediate operation.</p>
<pre><code class="language-java">// Default sorting is ascending without Comparator
List&lt;Integer&gt; sortedList1 = Stream.of(4,2,3,1).sorted().collect(Collectors.toList());

// Based on provided Comparator 
List&lt;Integer&gt; sortedList2 = Stream.of(4,2,3,1).sorted(Comparator.reverseOrder()).collect(Collectors.toList());

// output - sortedList1
[1, 2, 3, 4]
// output - sortedList12
[4, 3, 2, 1]</code></pre>
<h3>15. groupBy vs mapping</h3>
<p><strong>groupBy</strong> &#8211; groups the elements based on the classification function and <span style="font-weight: 400;">returns </span> the result in the map. The key should be the grouping element and value should be the list.</p>
<pre><code class="language-java">The following will classify Person objects by city:

Map&lt;String, List&lt;Person&gt;&gt; peopleByCity = personStream.collect(Collectors.groupingBy(Person::getCity);
 
The following will classify Person objects by state and city, cascading two Collectors together:

     Map&lt;String, Map&lt;String, List&lt;Person&gt;&gt;&gt; peopleByStateAndCity =personStream.collect(Collectors.groupingBy(Person::getState,
                                        Collectors.groupingBy(Person::getCity)));</code></pre>
<p><strong>mapping</strong> &#8211; When we do collect with reduction operation, we can transform the element by applying the mapping function to each input before accumulation. In the below example, the Person object transforms to last name during the accumulation.</p>
<pre><code class="language-java">Map&lt;City, Set&lt;String&gt;&gt; lastNamesByCity
            = people.stream().collect(
              groupingBy(Person::getCity,
                         mapping(Person::getLastName,
                                toSet())));</code></pre>
<h3>16. Reduction operations</h3>
<p>A reduction operation takes a sequence of input elements and combines them into a single summary result. For example, finding the sum or accumulating elements into a list. The stream classes have multiple forms of general reduction operations called reduce() and collect(). And we are having reductions forms such as sum(), max(), or count().</p>
<pre><code class="language-java">int sum = 0;
for (int x : numbers) {
      sum += x;
}

// Above operation can be implemented using reduction
int sum = numbers.stream().reduce(0, (x,y) -&gt; x+y);</code></pre>
<p><strong>Mutable reduction</strong> accumulates input elements into a mutable result container such as a <code>Collection</code> or <code>StringBuilder</code>, as it processes the elements in the stream.</p>
<h3>17. stream vs parallel stream which one should use</h3>
<p>Parallel stream has a higher view compared to sequential stream. But Parallel stream needs threads which takes a significant amount of time. I would prefer to use sequential streams by default and we can go for parallel ones if</p>
<ul>
<li>having large amount of items to process</li>
<li>having the performance problem</li>
<li>we don&#8217;t already run other process in a <span style="font-weight: 400;">multithreaded </span> environment</li>
</ul>
<p><span style="font-weight: 400;">Meanwhile, note that parallel streams will not solve synchronization problems if predicates and functions in the process uses a shared resource. Here, we have to ensure that all are thread-safe. So whenever we use parallel streams, we should worry about side effects.</span></p>
<h3>18. why static method introduced in Interface with Java 8</h3>
<p><span style="font-weight: 400;">Static methods make it easier to organize the helper methods in our libraries. We can create static methods specific to an interface in the same interface rather than in a separate class. We can also ignore public modifiers since all methods are implicitly public in the interface. At the same time you should be careful that the interface has to be clear and does not create additional clutter in the API.</span></p>
<p><span style="font-weight: 400;">Even the JDK code has Collectors &#8211; static factory methods, and a Collector interface at the same time. Those methods could be merged into the Collector interface, but that would make the interface more clunky.</span></p>
<h3>19. Date API&#8217;s in Java 8</h3>
<p><strong>LocalDate</strong> &#8211; a date in ISO format(yyyy-MM-dd). LocalDate provides a lot of utility methods to perform various data operations.</p>
<pre><code class="language-java">LocalDate localDate = LocalDate.now();

LocalDate.of(2015, 02, 20);

LocalDate.parse("2015-02-20");</code></pre>
<p><strong>LocalTime</strong> &#8211; a time without the date. LocalTime also provides lot of utility methods.</p>
<pre><code class="language-java">LocalTime now = LocalTime.now();
LocalTime sixThirty = LocalTime.of(6, 30);
LocalTime sixThirty = LocalTime.parse("06:30");</code></pre>
<p><strong>LocalDateTime</strong> &#8211; a combination of date and time. We can use this while we need the combination of date and time.</p>
<pre><code class="language-java">LocalDateTime.now();
LocalDateTime.of(2015, Month.FEBRUARY, 20, 06, 30);
LocalDateTime.parse("2015-02-20T06:30:00");</code></pre>
<p><strong>ZonedDateTime API</strong> &#8211; If we need a zone specific date and time we can go for a ZonedDatTime class. Here the ZoneId used to represent different zones.</p>
<pre><code class="language-java">ZoneId zoneId = ZoneId.of("Europe/Paris");
ZonedDateTime zonedDateTime = ZonedDateTime.of(localDateTime, zoneId);
ZonedDateTime.parse("2015-05-03T10:15:30+01:00[Europe/Paris]");
</code></pre>
<p><strong>Period and Duration</strong> &#8211; The Period provides a quantity of time in terms of year, month and days. The Duration provides the quantity of time in terms of seconds and nanosconds.</p>
<h3>20. Nashorn Engine in java 8</h3>
<p><span style="font-weight: 400;">The Nashorn engine is an implementation of ECMAScript. It was developed in the Java language as the Nashorn project. The Nashorn engine is included in the JDK in Java 1.8. Nashorn Java API allows us to write Java Applications as scripts which can be interpreted by the Nashorn engine.</span></p>
<h3>You May Also Like</h3>
<ul>
<li><a href="https://programeasily.com/2021/07/16/basic-git-commands-part-1/">Basic Git Commands – Part 1</a></li>
<li><a href="https://programeasily.com/2021/06/20/react-best-free-admin-dashboard-template-in-2021/">React Best Free Admin Dashboard Template in 2021</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://programeasily.com/2022/01/04/java-8-interview-questions-for-experienced/">Java 8 Interview Questions for Experienced</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programeasily.com/2022/01/04/java-8-interview-questions-for-experienced/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">540</post-id>	</item>
		<item>
		<title>Petite Vue Introduction with Example</title>
		<link>https://programeasily.com/2021/07/17/petite-vue-introduction-with-example/</link>
					<comments>https://programeasily.com/2021/07/17/petite-vue-introduction-with-example/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sat, 17 Jul 2021 18:25:15 +0000</pubDate>
				<category><![CDATA[Vuejs]]></category>
		<category><![CDATA[vue]]></category>
		<category><![CDATA[vuejs]]></category>
		<guid isPermaLink="false">https://programeasily.com/?p=446</guid>

					<description><![CDATA[<p>Petite Vue.js is a new one from the Vue.js team which mainly focuses on optimization. It is only 5kb in size. Here the small amount of interactions are only done with HTML elements. So the question is what is this and what it&#8217;s for ?. Petite Vue.js is a JavaScript library which creates the DOM based mutates in places. This will deal with the HTML elements directly similar to Alpine.js. It uses Vue.js template and reactivity modules to update the...</p>
<p class="read-more"><a class="btn btn-default" href="https://programeasily.com/2021/07/17/petite-vue-introduction-with-example/"> Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2021/07/17/petite-vue-introduction-with-example/">Petite Vue Introduction with Example</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="font-weight: 400;">Petite Vue.js is a new one from the Vue.js team which mainly focuses on optimization. It is only 5kb in size. Here the small amount of interactions are only done with HTML elements. So the question is what is this and what it&#8217;s for ?.</span></p>
<p><b>Petite Vue.js is a JavaScript library which creates the DOM based mutates in places.</b><span style="font-weight: 400;"> This will deal with the HTML elements directly similar to Alpine.js. It uses Vue.js template and reactivity modules to update the DOM elements dynamically when the data changes. So here in this <strong>Petite Vue Introduction with Example</strong> article we are going to look at more details and use cases of petite vue.js in detail. Let&#8217;s take a deep dive into it.</span></p>
<h2 style="text-align: center;">Petite Vue Introduction with Example</h2>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-496" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Petite-Vue-Introduction-with-Example-scaled.jpg?resize=640%2C360&#038;ssl=1" alt="Petite Vue Introduction with Example" width="640" height="360" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Petite-Vue-Introduction-with-Example-scaled.jpg?w=2560&amp;ssl=1 2560w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Petite-Vue-Introduction-with-Example-scaled.jpg?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Petite-Vue-Introduction-with-Example-scaled.jpg?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Petite-Vue-Introduction-with-Example-scaled.jpg?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Petite-Vue-Introduction-with-Example-scaled.jpg?resize=1536%2C864&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Petite-Vue-Introduction-with-Example-scaled.jpg?resize=2048%2C1152&amp;ssl=1 2048w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Petite-Vue-Introduction-with-Example-scaled.jpg?resize=480%2C270&amp;ssl=1 480w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Petite-Vue-Introduction-with-Example-scaled.jpg?w=1280&amp;ssl=1 1280w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Petite-Vue-Introduction-with-Example-scaled.jpg?w=1920&amp;ssl=1 1920w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></p>
<p>Petite Vue.js available in CDN network. So we can take it from directly as follows,</p>
<pre><code class="language-http">&lt;html&gt;

&lt;script src="https://unpkg.com/petite-vue" defer init&gt;&lt;/script&gt;

&lt;!--process only below element (v-scope specfied elements) --&gt;
&lt;div v-scope="{ count: 0 }"&gt;
  {{ count }}
  &lt;button @click="count++"&gt;do increment&lt;/button&gt;
&lt;/div&gt;

&lt;/html&gt;</code></pre>
<p><span style="font-weight: 400;">In the above example, count is a reactive one. While you click the button, count changes( data changes ) and it updates the DOM. Reactivity achieved right !. Note that here we are using some more terms, that we described below,</span></p>
<ul>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;">We are using defer to execute the script after the HTML parsing operations.</span></li>
<li style="font-weight: 400;" aria-level="1"><span style="font-weight: 400;"><code>init</code> plays a major role here. <code>init</code> is a custom element that tells petite vue.js to automatically mount the application. You can find this logic from </span><a href="https://github.com/vuejs/petite-vue/blob/main/src/index.ts#L9"><span style="font-weight: 400;"> </span><span style="font-weight: 400;">https://github.com/vuejs/petite-vue/blob/main/src/index.ts#L9</span></a></li>
<li style="font-weight: 400;" aria-level="1"><b><span style="font-weight: 400;"><code><strong>v-scope</strong></code> </span> will be used to denote the area where the petite vue.js controls the page. Petite Vue.js processes only the <span style="font-weight: 400;"><code><strong>v-scope</strong></code> </span>specified element with its child elements.</b></li>
</ul>
<h3>Without Auto Init</h3>
<p><span style="font-weight: 400;">In addition, if you don&#8217;t want the auto <code>init</code> , remove it from the script tag. But you have to do it manually to the end of the body as follows.</span></p>
<pre><code class="language-markup">&lt;script src="https://unpkg.com/petite-vue"&gt;&lt;/script&gt;
&lt;script&gt;
  PetiteVue.createApp().mount()
&lt;/script&gt;</code></pre>
<h2>Root Scope &#8211; Global Data Object</h2>
<p>We can pass the optional data object to <span style="font-weight: 400;"><code>createApp()</code> </span> function. This will act as a global data and available to all expressions.</p>
<pre><code class="language-markup">&lt;html&gt;

&lt;script src="https://unpkg.com/petite-vue"&gt;&lt;/script&gt;

&lt;!-- global data object passed to createApp available --&gt;
&lt;div v-scope&gt;
  &lt;p&gt;{{ name }}&lt;/p&gt;
  &lt;p&gt;{{ reverseName }}&lt;/p&gt;
  &lt;button @click="addNumber"&gt;Add Number to Name&lt;/button&gt;
&lt;/div&gt;

&lt;script&gt;
    PetiteVue.createApp({
    // available to all expressions and act as reactive data
    name: 'Program Easily',
    number: 0,
    // getters
    get reverseName() {
      return this.name.split("").reverse().join("");
    },
    // methods
    addNumber() {
      this.name = this.name + ' ' + this.number++
    }
  }).mount()

&lt;/script&gt;

&lt;/html&gt;</code></pre>
<p><span style="font-weight: 400;">In the above example, we are using variables, getters and methods as global data to all expressions. We can use these values inside <code>v-scope</code> elements. It will maintain reactivity, when you change the data, it will update the DOM elements. You can check the full working example below,</span></p>
<p><iframe style="width: 100%; height: 500px; border: 0; border-radius: 4px; overflow: hidden;" title="Petite Vue Examples" src="https://codesandbox.io/embed/petite-vue-examples-v21y4?fontsize=14&amp;hidenavigation=1&amp;initialpath=global-scope-petite.html&amp;theme=dark" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe></p>
<h2>Create Components &#8211; Petite Vue Introduction with Example</h2>
<p><span style="font-weight: 400;">Creating components using Petite vue.js is a little bit different. We have to create a reusable function that will return the literal object. The returned object will be available as props inside the template. And you need to specify the template with the</span><i><span style="font-weight: 400;"> <code>$template</code> </span></i><span style="font-weight: 400;">key in the return object. There are two ways to provide the template value.</span></p>
<ol>
<li>Template String.</li>
<li>ID selector to template element.</li>
</ol>
<pre><code class="language-markup">&lt;html&gt;

&lt;script src="https://unpkg.com/petite-vue"&gt;&lt;/script&gt;

&lt;template id="pe-btn"&gt;
    &lt;div :style="{ margin: '8px'}"&gt;
        &lt;button :style="{ padding: '8px', color: color, fontSize: size + 'px' }"&gt; {{ label }} &lt;/button&gt;
    &lt;/div&gt;
&lt;/template&gt;

&lt;div v-scope :style="{ display: 'flex' , justifyContent: 'center'}"&gt;
&lt;div v-scope="peBtn({label: 'Red Button', color : 'red', size: '20'})"&gt;&lt;/div&gt;
&lt;div v-scope="peBtn({label: 'Green Button', color : 'green', size: '20'})"&gt;&lt;/div&gt;
&lt;div v-scope="peBtn({label: 'Yellow Button', color : 'yellow', size: '20'})"&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;script&gt;

// reusable function that will return the literal object
function peBtn(props){
    return {
        $template: "#pe-btn",
        label: props.label,
        color: props.color,
        size: props.size
    }
}

PetiteVue.createApp().mount()

&lt;/script&gt;

&lt;/html&gt;</code></pre>
<p><span style="font-weight: 400;">In the above example, we are creating the button component. The button component has three props namely label, color and size. Likewise you can create your own components with n number of props. When you wish to use your component you have to give <code>v-scope</code> attribute to the parent element. So that Petite Vue.js listen and process those elements. You can check the full working example below,</span></p>
<p><iframe style="width: 100%; height: 500px; border: 0; border-radius: 4px; overflow: hidden;" title="Petite Vue Examples" src="https://codesandbox.io/embed/petite-vue-examples-v21y4?fontsize=14&amp;hidenavigation=1&amp;initialpath=component-petite.html&amp;theme=dark" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe></p>
<h2>Reactive Modules &#8211; Petite Vue Introduction with Example</h2>
<p><span style="font-weight: 400;">Already we have seen the <code>createApp()</code> module which is used to mount the application. In addition Petite Vue.js provides a reactive module ( from <code>@vue/reactivity</code> ). Using a reactive module, we can create a global store. The data inside this store will act as reactive data and available throughout the application. Let us check with below example,</span></p>
<pre><code class="language-markup">&lt;html&gt;
  &lt;script src="https://unpkg.com/petite-vue"&gt;&lt;/script&gt;
  &lt;!-- local data object --&gt;
  &lt;div
    v-scope="{ 
      localName: 'Local PE', 
      localNumber: 0,
      get reverseName() {
        return this.localName.split('').reverse().join('')
      },
      addNumber() {
        this.localName = this.localName + ' ' + this.localNumber++;
      },
     }"
  &gt;
    &lt;h2&gt;Global&lt;/h2&gt;
    &lt;!-- using global reactive data object --&gt;
    &lt;p&gt;Name : {{ store.globalName }}&lt;/p&gt;
    &lt;p&gt;Reverse Name : {{ store.reverseName }}&lt;/p&gt;
    &lt;button @click="store.addNumber"&gt;Add Number to Global Name&lt;/button&gt;
    &lt;h2&gt;Local&lt;/h2&gt;
    &lt;!-- using local reactive data object --&gt;
    &lt;p&gt;Name : {{ localName }}&lt;/p&gt;
    &lt;p&gt;Reverse Name : {{ reverseName }}&lt;/p&gt;
    &lt;button @click="addNumber"&gt;Add Number to Local Name&lt;/button&gt;
  &lt;/div&gt;
  &lt;script&gt;
    // global reactive store
    const store = PetiteVue.reactive({
      globalName: "Global PE",
      globalNumber: 0,
      // getters
      get reverseName() {
        return this.globalName.split("").reverse().join("");
      },
      // methods
      addNumber() {
        this.globalName = this.globalName + " " + this.globalNumber++;
      },
    });
    // pass reactive object to createApp, so that it will act as global store
    PetiteVue.createApp({ store }).mount();
  &lt;/script&gt;
&lt;/html&gt;</code></pre>
<p><span style="font-weight: 400;">In the above example, we are creating a global store using <code>reactive</code> objects. And we are creating local data objects using <code>v-scope</code> value. The global store data available throughout the application. At the same time, local data objects are accessible only inside the respective <code>v-scope</code> element. Here the state will maintain that <code>Add number to Global Name</code>  will change the global records. The same way <code>Add number to Local Name</code> will change the local records.  You can check the full working example,</span></p>
<p><iframe style="width: 100%; height: 500px; border: 0; border-radius: 4px; overflow: hidden;" title="Petite Vue Examples" src="https://codesandbox.io/embed/petite-vue-examples-v21y4?fontsize=14&amp;hidenavigation=1&amp;initialpath=reactive-petite.html&amp;theme=dark" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe></p>
<h2>Summary</h2>
<ul>
<li>Petite Vue.js is a JavaScript library which creates the DOM based mutates in places.</li>
<li>It uses Vue.js template and reactivity modules to update the DOM elements dynamically when the data changes.</li>
<li><span style="font-weight: 400;"><code>v-scope</code></span> will be used to denote the area where the petite vue.js controls the page. Petite Vue.js <span style="font-weight: 400;">processes </span>the child elements only inside the <span style="font-weight: 400;"><code>v-scope</code></span> specified element.</li>
<li>Petite Vue.js provides a reactive module ( from <span style="font-weight: 400;"><code>@vue/reactivity</code></span>). Using a reactive module, we can create a global store.</li>
<li>And it&#8217;s a new one. So let&#8217;s wait and will see the full features of Petite vue.js</li>
</ul>
<h2>References</h2>
<ul>
<li><a href="https://github.com/vuejs/petite-vue">https://github.com/vuejs/petite-vue</a></li>
<li><a href="https://www.npmjs.com/package/petite-vue">https://www.npmjs.com/package/petite-vue</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://programeasily.com/2021/07/17/petite-vue-introduction-with-example/">Petite Vue Introduction with Example</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programeasily.com/2021/07/17/petite-vue-introduction-with-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">446</post-id>	</item>
		<item>
		<title>Teleport in Vue 3 with Example</title>
		<link>https://programeasily.com/2021/07/13/teleport-in-vue-3-with-example/</link>
					<comments>https://programeasily.com/2021/07/13/teleport-in-vue-3-with-example/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 06:47:54 +0000</pubDate>
				<category><![CDATA[Vuejs]]></category>
		<category><![CDATA[vuejs]]></category>
		<category><![CDATA[vuejs3]]></category>
		<guid isPermaLink="false">https://programeasily.com/?p=321</guid>

					<description><![CDATA[<p>Creating the web pages using components is a good idea. So that we can re-use the logic and structure of the design. We have to make a component hierarchy or tree to make the UI better. In Vue.js we are using template string or render function to build the HTML DOM in the components. The Vue compiler will compile it and make the div elements for us However, sometimes logically, we need one component which could be a child to...</p>
<p class="read-more"><a class="btn btn-default" href="https://programeasily.com/2021/07/13/teleport-in-vue-3-with-example/"> Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2021/07/13/teleport-in-vue-3-with-example/">Teleport in Vue 3 with Example</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="font-weight: 400;">Creating the web pages using components is a good idea. So that we can re-use the logic and structure of the design. We have to make a component hierarchy or tree to make the UI better. In Vue.js we are using template string or render function to build the HTML DOM in the components. The Vue compiler will compile it and make the div elements for us</span></p>
<p><span style="font-weight: 400;">However, sometimes logically, we need one component which could be a child to its parent component, But the component HTML div should not be nest to its parent. Meanwhile we need to place it somewhere else in the DOM. Little bit confusing right.</span></p>
<p><span style="font-weight: 400;">Generally the HTML tree structure will be the same as component tree structure. But if you want to change one component div&#8217;s parent somewhere else in the DOM, we can go for teleport in Vue.js. It is an advanced feature introduced in Vue.js 3. If you are not familiar with Vue.js You can refer to our page</span><a href="https://programeasily.com/vue/"> <span style="font-weight: 400;">Vue</span></a><span style="font-weight: 400;"> Let&#8217;s go to the topic in detail.</span></p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-466 size-large" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Teleport-in-Vue-3-with-Example-1.png?resize=640%2C535&#038;ssl=1" alt="Teleport in Vue 3 with Example" width="640" height="535" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Teleport-in-Vue-3-with-Example-1.png?resize=1024%2C856&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Teleport-in-Vue-3-with-Example-1.png?resize=300%2C251&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Teleport-in-Vue-3-with-Example-1.png?resize=768%2C642&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Teleport-in-Vue-3-with-Example-1.png?resize=323%2C270&amp;ssl=1 323w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/07/Teleport-in-Vue-3-with-Example-1.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></p>
<h2>Teleport</h2>
<p><strong>Teleport will change the parent element of a component. Note that teleport will move actual DOM nodes instead of recreating it.</strong> This will maintain the same component instance. Teleport has two attributes.</p>
<ol>
<li>to &#8211; String</li>
<li>disabled &#8211; Boolean</li>
</ol>
<p><code>to</code> &#8211; <code>string</code> is <span style="font-weight: 400;">a prop denoting a target parent element where the teleport will move it&#8217;s content. It is a mandatory prop. This prop can be a valid query selector, or an HTML element (Example : body).</span></p>
<pre><code class="language-markup">&lt;teleport to="#to-parent-id" /&gt; 
&lt;teleport to=".to-parent-id" /&gt; 
&lt;teleport to="[to-parent-data-teleport]" /&gt;</code></pre>
<p><code>disabled</code> &#8211; <code>boolean</code> is a prop which disables the teleport operation. This is an optional Boolean prop. If we apply the disable prop, this will not move the teleport content to the target element. <strong>At the same time it will render the elements where you specified the teleport tag just like normal components.</strong> A great example for this use case is, streaming the video in either pop up or normally like below,</p>
<pre><code class="language-markup">&lt;teleport to="#popup" :disabled="popupOrInline"&gt;
  &lt;video src="./my-movie.mp4"&gt;
&lt;/teleport&gt;</code></pre>
<h2>Teleport in Vue 3 with Example</h2>
<p>Generally, we can achieve the same operation without teleport also. If we need to change the positions of the elements but quickly ,the process becomes difficult. But teleport makes the work simple for us. In our example, we are going to teleport a component to HTML  <code>#toPlace</code> div. Firstly we are creating Teleport component as follows</p>
<pre><code class="language-javascript">// TeleportComp.vue
&lt;template&gt;
  &lt;div&gt;
    &lt;teleport :to="teleportTo" :disabled="disableTeleport"&gt;
      &lt;TeleportChild:imagePath="imagePath" /&gt;
    &lt;/teleport&gt;
  &lt;/div&gt;
&lt;/template&gt;

&lt;script&gt;
import TeleportChild from "./TeleportChild.vue";
export default {
  components: {
    TeleportChild,
  },
  props: {
    teleportTo: {
      type: String,
      default: "body",
    },
    imagePath: String,
    disableTeleport: Boolean,
  },
};
&lt;/script&gt;
</code></pre>
<p>Secondly we are creating the TeleportChild.vue component as follows,</p>
<pre><code class="language-javascript">// TeleportChild.vue
&lt;template&gt;
  &lt;img
    :src="imagePath"
    alt="Teleport child Text"
    :style="{ width: '100%', height: '100%' }"
  /&gt;
&lt;/template&gt;

&lt;script&gt;
export default {
  props: {
    imagePath: String,
    altText: String,
  },
};
&lt;/script&gt;</code></pre>
<p>In the above example,  we are using the child component <code>TeleportChild.vue</code> inside the Teleport Component. Note that here, logically <code>TeleportChild.vue</code> component will remain as child for <code>TeleportComp.vue</code> component even when it&#8217;s position changed (But actually not). Moreover the Vue.js Dev-tools also will have the same component hierarchy structure. Now we are creating the <code>TeleportDemo.vue</code> file to check the behaviors. Here we are enabling teleport operation based on <code>disableTeleport</code> flag.</p>
<pre><code class="language-javascript">// TeleportDemo.vue
&lt;template&gt;
  &lt;div id="toPlace"&gt;&lt;/div&gt;
  &lt;div :style="{ width: '200px', height: '200px' }"&gt;
    &lt;button class="btn" @click="onClickBtn"&gt;
      {{ disableTeleport ? "Move to toPlace" : "Come Back" }}
    &lt;/button&gt;
    &lt;TeleportComp
      teleportTo="#toPlace"
      imagePath="logo_transparent.png"
      :disableTeleport="disableTeleport"
    /&gt;
  &lt;/div&gt;
&lt;/template&gt;

&lt;script&gt;
import { ref } from "vue";
import TeleportComp from "../components/teleport/TeleportComp.vue";
export default {
  components: {
    TeleportComp,
  },
  setup() {
    let disableTeleport = ref(true);
    const onClickBtn = () =&gt; {
      disableTeleport.value = !disableTeleport.value;
    };
    return {
      onClickBtn,
      disableTeleport,
    };
  },
};
&lt;/script&gt;
&lt;style scoped&gt;
#toPlace {
  width: 200px;
  height: 200px;
  margin: auto;
  display: flex;
  justify-content: center;
}
.btn {
  background-color: #4999f5;
  border: none;
  color: white;
  padding: 10px;
  font-size: 16px;
  cursor: pointer;
}
.btn:hover {
  background-color: #0417c0;
  color: white;
}
&lt;/style&gt;</code></pre>
<p>In the above example, if <code>disableTeleport</code> is set to true, then the teleport component acts as a normal component. if <code>disableTeleport</code> is set to false, the teleport component will be moved to <code>#toPlace</code> div element. Teleport will not change the hierarchy of component tree structure logically. But the effect will reflect in the HTML DOM. Now the image element moved to <code>#toPlace</code> element. You can check the full working example below,</p>
<p><iframe style="width: 100%; height: 500px; border: 0; border-radius: 4px; overflow: hidden;" title="vue-3-basics-program-easily" src="https://codesandbox.io/embed/github/programeasily/vue-3-basics/tree/main/?fontsize=14&amp;hidenavigation=1&amp;initialpath=teleportdemo&amp;module=%2Fsrc%2Fcomponents%2Fteleport%2FTeleportComp.vue&amp;theme=dark" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe></p>
<h2>Multiple Teleport in Vue 3 with Example</h2>
<p>Now we are going to see multiple teleport operations. Here the same target element will have multiple teleport components. When we move the teleport components, It will follow the moving order and append to the target element.</p>
<pre><code class="language-javascript">&lt;teleport to="#toPlace"&gt;
  &lt;div&gt;A&lt;/div&gt;
&lt;/teleport&gt;
&lt;teleport to="#toPlace"&gt;
  &lt;div&gt;B&lt;/div&gt;
&lt;/teleport&gt;

&lt;!-- result--&gt;
&lt;div id="toPlace"&gt;
  &lt;div&gt;A&lt;/div&gt;
  &lt;div&gt;B&lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>In the above example, the <code>#toPlace</code> element will have A,B div elements on teleport operation. Now we are creating <code>TeleportMultipleDemo.vue</code> file where we are moving two teleport components to same <code>#toPlace</code> target element. You can refer the full working example below</p>
<p><iframe style="width: 100%; height: 500px; border: 0; border-radius: 4px; overflow: hidden;" title="vue-3-basics-program-easily" src="https://codesandbox.io/embed/github/programeasily/vue-3-basics/tree/main/?fontsize=14&amp;hidenavigation=1&amp;initialpath=teleportmultipledemo&amp;module=%2Fsrc%2Fpage%2FTeleportMultipleDemo.vue&amp;theme=dark" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe></p>
<h2>Summary</h2>
<ul>
<li><strong>Teleport will change the parent of a component. Note that teleport will move actual DOM nodes instead of recreating it.</strong></li>
<li style="text-align: left;">Even though teleport changes the parent elements, it will maintain the instances of components.</li>
<li>If disabled flag is given, it will render the elements where you specified the teleport tag just like normal components.</li>
<li>The same target element will have multiple teleport components.</li>
</ul>
<h2>Reference</h2>
<ul>
<li><a href="https://v3.vuejs.org/guide/teleport.html#teleport">https://v3.vuejs.org/guide/teleport.html#teleport</a></li>
<li><a href="https://v3.vuejs.org/api/built-in-components.html#teleport">https://v3.vuejs.org/api/built-in-components.html#teleport</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://programeasily.com/2021/07/13/teleport-in-vue-3-with-example/">Teleport in Vue 3 with Example</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programeasily.com/2021/07/13/teleport-in-vue-3-with-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">321</post-id>	</item>
		<item>
		<title>React Best Free Admin Dashboard Template in 2021</title>
		<link>https://programeasily.com/2021/06/20/react-best-free-admin-dashboard-template-in-2021/</link>
					<comments>https://programeasily.com/2021/06/20/react-best-free-admin-dashboard-template-in-2021/#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sun, 20 Jun 2021 07:24:39 +0000</pubDate>
				<category><![CDATA[React Template]]></category>
		<category><![CDATA[Template]]></category>
		<category><![CDATA[admin template]]></category>
		<category><![CDATA[free template]]></category>
		<category><![CDATA[react template]]></category>
		<guid isPermaLink="false">https://programeasily.com/?p=307</guid>

					<description><![CDATA[<p>React Templates React Templates are web pages which are already developed and well tested User Interfaces(UI Page) using React.js. Creating applications from scratch always has some side effects. Instead of that, we can use the Standard Templates which are already built and used by thousands of customers. Long ago, we used plain HTML and CSS to design the web pages. But today by evolution, we are all using rich front end libraries and frameworks to design the web pages. Among...</p>
<p class="read-more"><a class="btn btn-default" href="https://programeasily.com/2021/06/20/react-best-free-admin-dashboard-template-in-2021/"> Read More<span class="screen-reader-text">  Read More</span></a></p>
<p>The post <a rel="nofollow" href="https://programeasily.com/2021/06/20/react-best-free-admin-dashboard-template-in-2021/">React Best Free Admin Dashboard Template in 2021</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>React Templates</h2>
<p>React Templates are web pages which are already developed and well tested User Interfaces(UI Page) using React.js. Creating applications from scratch always has some side effects. Instead of that, we can use the Standard Templates which are already built and used by thousands of customers.</p>
<p>Long ago, we used plain HTML and CSS to design the web pages. But today by <span style="font-weight: 400;">evolution</span>, we are all using rich front end libraries and frameworks to design the web pages. <strong>Among them, React.js is one of the top programming <b>libraries </b> which makes web developers work simple.</strong> React Applications are user friendly, rich in UI, and much responsive due to reactivity features.</p>
<h2>React Best Free Admin Dashboard Template in 2021</h2>
<p>Admin Templates is the most popular topic among React templates. We can use admin templates for below features,</p>
<ul>
<li>Maintaining the website</li>
<li>Installation</li>
<li>User Creation and Management</li>
<li>Monitoring</li>
<li>Configuring website</li>
<li>Traffic and Performance</li>
</ul>
<h3>Advantages</h3>
<ul>
<li>Save time and money</li>
<li>More choices in the market</li>
<li>No need of professional designer</li>
<li>Already used by thousands of customers</li>
</ul>
<p>For instance, Today we are going to see the</p>
<h3>React Best Free Admin Dashboard Template in 2021</h3>
<h2>Material Dashboard React (Creative Tim)</h2>
<p><a href="https://www.creative-tim.com/product/material-dashboard-react?partner=148662"><img loading="lazy" decoding="async" class="alignnone wp-image-410 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/free-template-material-dashboard-react-2021.png?resize=640%2C537&#038;ssl=1" alt="Material Dashboard React (Creative Tim)" width="640" height="537" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/free-template-material-dashboard-react-2021.png?w=1902&amp;ssl=1 1902w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/free-template-material-dashboard-react-2021.png?resize=300%2C252&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/free-template-material-dashboard-react-2021.png?resize=1024%2C859&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/free-template-material-dashboard-react-2021.png?resize=768%2C644&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/free-template-material-dashboard-react-2021.png?resize=1536%2C1289&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/free-template-material-dashboard-react-2021.png?resize=322%2C270&amp;ssl=1 322w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/free-template-material-dashboard-react-2021.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p>Material Dashboard React is a free Admin Template which was released three years ago. It was one for the most downloaded react.js admin template from the partner Creative Tim. It uses <a href="https://material-ui.com/">Material-UI</a> v4.1.0 Framework and provides good material effects, ripples, animations and transitions. We can use five color filter choices for sidebars and card headers. We can also change the background image of the sidebar also.</p>
<ul>
<li>Rank &#8211; 1</li>
<li>Rating &#8211; 4.90/5</li>
<li>Downloads &#8211; Greater Than 100k</li>
<li>Reviews &#8211; Greater Than 500</li>
<li>Responsive &#8211; Fully Responsive</li>
<li>Technologies &#8211; HTML5, React.js, Material UI</li>
<li>License &#8211; MIT</li>
</ul>
<p><a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-visibility" style="background-color: #4769d8; color: #ffffff;" target="_blank" rel="noopener" href="https://demos.creative-tim.com/material-dashboard-react/?partner=148662&amp;_ga=2.143807477.1595395322.1623693362-114865548.1622567721#/admin/dashboard">Live Preview</a> &nbsp;<a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-cart" style="background-color: #3fb28f; color: #ffffff;" target="_blank" rel="noopener" href="https://www.creative-tim.com/product/material-dashboard-react?partner=148662">Free Download / Docs</a></p>
<h2>Light Bootstrap Dashboard React (Creative Tim)</h2>
<p><a href="https://www.creative-tim.com/product/light-bootstrap-dashboard-react?partner=148662" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-396 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/Light-Bootstrap-Dashboard-React-in-2021.png?resize=640%2C360&#038;ssl=1" alt="Light Bootstrap Dashboard React (Creative Tim)" width="640" height="360" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/Light-Bootstrap-Dashboard-React-in-2021.png?w=1860&amp;ssl=1 1860w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/Light-Bootstrap-Dashboard-React-in-2021.png?resize=300%2C169&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/Light-Bootstrap-Dashboard-React-in-2021.png?resize=1024%2C576&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/Light-Bootstrap-Dashboard-React-in-2021.png?resize=768%2C432&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/Light-Bootstrap-Dashboard-React-in-2021.png?resize=1536%2C864&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/Light-Bootstrap-Dashboard-React-in-2021.png?resize=480%2C270&amp;ssl=1 480w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/Light-Bootstrap-Dashboard-React-in-2021.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p>Light Bootstrap Dashboard is a free admin template which was released three years ago. It was the second most downloaded react.js admin template from the partner Creative Tim. This template has a simple admin dashboard which is built on top of Light Bootstrap Dashboard and React.js. In Addition, we can use this template for project management systems like CMS and CRM also. We can use six colors for the sidebar and it provides ways to change the background color also.</p>
<ul>
<li>Rank &#8211; 2</li>
<li>Rating &#8211; 4.90/5</li>
<li>Downloads &#8211; Greater Than 65k</li>
<li>Reviews &#8211; Greater Than 330</li>
<li>Responsive &#8211; Fully Responsive</li>
<li>Technologies &#8211; HTML5, React.js, Sass, Bootstrap</li>
<li>License &#8211; MIT</li>
</ul>
<p><a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-visibility" style="background-color: #4769d8; color: #ffffff;" target="_blank" rel="noopener" href="https://demos.creative-tim.com/light-bootstrap-dashboard-react/?partner=148662&amp;_ga=2.77853524.1595395322.1623693362-114865548.1622567721#/admin/dashboard">Live Preview</a> &nbsp;<a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-cart" style="background-color: #3fb28f; color: #ffffff;" target="_blank" rel="noopener" href="https://www.creative-tim.com/product/light-bootstrap-dashboard-react?partner=148662">Free Download / Docs</a></p>
<h2>React Material Admin (Flat Logic)</h2>
<p><a href="https://flatlogic.com/templates/react-material-admin?ref=UcaoqW5YCP"><img loading="lazy" decoding="async" class="alignnone wp-image-398 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-material-admin-2021.png?resize=640%2C623&#038;ssl=1" alt="React Material Admin (Flat Logic)" width="640" height="623" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-material-admin-2021.png?w=1899&amp;ssl=1 1899w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-material-admin-2021.png?resize=300%2C292&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-material-admin-2021.png?resize=1024%2C998&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-material-admin-2021.png?resize=768%2C748&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-material-admin-2021.png?resize=1536%2C1496&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-material-admin-2021.png?resize=277%2C270&amp;ssl=1 277w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-material-admin-2021.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p>React Material Admin is a free admin template which was released two years ago. It is one of the most downloaded React.js admin templates from the partner Flat Logic. This template is built with Material UI framework and provides fully responsive rich design. It has Charts, Basic Tables, Notification Bar and we can extend this template to start building a Front end Sass, E-Commerce, IoT Dashboard and much more. Instead of&nbsp; jQuery and Bootstrap, it uses React 16 built with React hooks and React context.</p>
<ul>
<li>Rank &#8211; 3</li>
<li>Rating &#8211; 4.5/5</li>
<li>Downloads &#8211; Greater Than 9.5k</li>
<li>Responsive &#8211; Fully Responsive</li>
<li>Technologies &#8211; HTML5, React.js, Sass, Material UI</li>
<li>License &#8211; MIT</li>
</ul>
<p><a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-visibility" style="background-color: #4769d8; color: #ffffff;" target="_blank" rel="noopener" href="https://flatlogic.com/templates/react-material-admin/demo?ref=UcaoqW5YCP">Live Preview</a> &nbsp;<a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-cart" style="background-color: #3fb28f; color: #ffffff;" target="_blank" rel="noopener" href="https://flatlogic.com/templates/react-material-admin?ref=UcaoqW5YCP">Free Download / Docs</a></p>
<h2>Black Dashboard React (Creative Tim)</h2>
<p><a href="https://www.creative-tim.com/product/black-dashboard-react?partner=148662"><img loading="lazy" decoding="async" class="alignnone wp-image-401 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/black-dashboard-react-2021.png?resize=640%2C645&#038;ssl=1" alt="Black Dashboard React (Creative Tim)" width="640" height="645" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/black-dashboard-react-2021.png?w=1905&amp;ssl=1 1905w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/black-dashboard-react-2021.png?resize=298%2C300&amp;ssl=1 298w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/black-dashboard-react-2021.png?resize=1017%2C1024&amp;ssl=1 1017w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/black-dashboard-react-2021.png?resize=150%2C150&amp;ssl=1 150w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/black-dashboard-react-2021.png?resize=768%2C774&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/black-dashboard-react-2021.png?resize=1525%2C1536&amp;ssl=1 1525w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/black-dashboard-react-2021.png?resize=268%2C270&amp;ssl=1 268w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/black-dashboard-react-2021.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p>Black Dashboard React is a free admin template which was released two years ago. This template is built on top of Bootstrap 4 and it looks amazing. Black dashboard comes with both dark mode and light mode. The <strong>Dark mode is one of my choices among the React.js admin templates.</strong> We can create thousands of combinations using over 16 features components. The great advantage of this plugin is that it comes with good colors for eyes.</p>
<ul>
<li>Rank &#8211; 4</li>
<li>Rating &#8211; 4.90/5</li>
<li>Downloads &#8211; Greater Than 28.5k</li>
<li>Reviews &#8211; Greater Than 160</li>
<li>Responsive &#8211; Fully Responsive</li>
<li>Language &#8211; HTML5, React.js, Sass, Bootstrap 4, Sketch files.</li>
<li>License &#8211; MIT</li>
</ul>
<p><a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-visibility" style="background-color: #4769d8; color: #ffffff;" target="_blank" rel="noopener" href="https://demos.creative-tim.com/black-dashboard-react/?partner=148662&amp;_ga=2.153745400.1595395322.1623693362-114865548.1622567721#/admin/dashboard">Live Preview</a> &nbsp;<a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-cart" style="background-color: #3fb28f; color: #ffffff;" target="_blank" rel="noopener" href="https://www.creative-tim.com/product/black-dashboard-react?partner=148662">Free Download / Docs</a></p>
<h2>Free Bootstrap Admin Template (Core UI)</h2>
<p><a href="https://secure.2checkout.com/affiliate.php?ACCOUNT=250288725771&amp;AFFILIATE=148662&amp;PATH=https%3A%2F%2Fcoreui.io%3FAFFILIATE%3D148662"><img loading="lazy" decoding="async" class="alignnone wp-image-403 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/coreui-io-react-free-template-dark-2021.png?resize=640%2C547&#038;ssl=1" alt="Free Bootstrap Admin Template (Core UI)" width="640" height="547" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/coreui-io-react-free-template-dark-2021.png?w=1886&amp;ssl=1 1886w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/coreui-io-react-free-template-dark-2021.png?resize=300%2C257&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/coreui-io-react-free-template-dark-2021.png?resize=1024%2C876&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/coreui-io-react-free-template-dark-2021.png?resize=768%2C657&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/coreui-io-react-free-template-dark-2021.png?resize=1536%2C1314&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/coreui-io-react-free-template-dark-2021.png?resize=316%2C270&amp;ssl=1 316w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/coreui-io-react-free-template-dark-2021.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p>Core UI provides rich responsive free open source apps. It is 100% Bootstrap built with react hooks instead of jQuery. Cross browser compatibility is the special feature of bootstrap admin template. No design skills required for creating the responsive application. The Free version comes with a login page, register page, 404 page, 500 page. In addition Core UI provides plugins, editors and google maps with pro version.</p>
<ul>
<li>Rank &#8211; 5</li>
<li>GitHub Stars &#8211; 3.3k (By June 2021)</li>
<li>GitHub Fork &#8211; 1.4K (By June 2021)</li>
<li>Responsive &#8211; Fully Responsive, Cross browser support</li>
<li>Technologies &#8211; HTML5, React.js, React Hooks, Bootstrap 5</li>
<li>License &#8211; MIT</li>
</ul>
<p><a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-visibility" style="background-color: #4769d8; color: #ffffff;" target="_blank" rel="noopener" href="https://secure.2checkout.com/affiliate.php?ACCOUNT=250288725771&amp;AFFILIATE=148662&amp;PATH=https%3A%2F%2Fcoreui.io%2Freact%2F%3FAFFILIATE%3D148662%23compare">Live Preview</a> &nbsp;<a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-cart" style="background-color: #3fb28f; color: #ffffff;" target="_blank" rel="noopener" href="https://secure.2checkout.com/affiliate.php?ACCOUNT=250288725771&amp;AFFILIATE=148662&amp;PATH=https%3A%2F%2Fcoreui.io%3FAFFILIATE%3D148662">Free Download / Docs</a></p>
<h2>Notus React (Creative Tim)</h2>
<p><a href="https://www.creative-tim.com/product/notus-react?partner=148662"><img loading="lazy" decoding="async" class="alignnone wp-image-404 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/notus-react-2021.png?resize=640%2C559&#038;ssl=1" alt="Notus React (Creative Tim)" width="640" height="559" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/notus-react-2021.png?w=1909&amp;ssl=1 1909w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/notus-react-2021.png?resize=300%2C262&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/notus-react-2021.png?resize=1024%2C894&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/notus-react-2021.png?resize=768%2C670&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/notus-react-2021.png?resize=1536%2C1340&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/notus-react-2021.png?resize=309%2C270&amp;ssl=1 309w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/notus-react-2021.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p>Notus React is a free admin template which was released 8 months ago. This template uses <a href="https://tailwindcss.com/">Tailwind CSS</a> and React UI Kit. Notus React made by Creative Tim and you will love the Tailwind CSS. We can extend this template and build components on top of this. It provides more than 100 components, giving us ways to combine and create the beautiful pages. Every element in Notus has multiple states for colors, styles and focus.</p>
<ul>
<li>Rank &#8211; 6</li>
<li>Rating &#8211; 5/5</li>
<li>Downloads &#8211; Greater Than 5.9k</li>
<li>Responsive &#8211; Fully Responsive</li>
<li>Technologies &#8211; HTML5, React.js, Tailwind CSS</li>
<li>License &#8211; MIT</li>
</ul>
<p><a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-visibility" style="background-color: #4769d8; color: #ffffff;" target="_blank" rel="noopener" href="https://demos.creative-tim.com/notus-react/?partner=148662&amp;_ga=2.252901193.1595395322.1623693362-114865548.1622567721#/">Live Preview</a> &nbsp;<a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-cart" style="background-color: #3fb28f; color: #ffffff;" target="_blank" rel="noopener" href="https://www.creative-tim.com/product/notus-react?partner=148662">Free Download / Docs</a></p>
<p>&nbsp;</p>
<h2>Admin Dashboard (MDB)</h2>
<p><a href="https://mdbootstrap.com/freebies/react/admin-dashboard?utm_ref_id=224486"><img loading="lazy" decoding="async" class="alignnone wp-image-406 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/mdbootstrap-previews-free-templates-react-admin-dashboard-2021.png?resize=640%2C598&#038;ssl=1" alt="Admin Dashboard (MDB)" width="640" height="598" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/mdbootstrap-previews-free-templates-react-admin-dashboard-2021.png?w=1904&amp;ssl=1 1904w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/mdbootstrap-previews-free-templates-react-admin-dashboard-2021.png?resize=300%2C280&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/mdbootstrap-previews-free-templates-react-admin-dashboard-2021.png?resize=1024%2C956&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/mdbootstrap-previews-free-templates-react-admin-dashboard-2021.png?resize=768%2C717&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/mdbootstrap-previews-free-templates-react-admin-dashboard-2021.png?resize=1536%2C1434&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/mdbootstrap-previews-free-templates-react-admin-dashboard-2021.png?resize=289%2C270&amp;ssl=1 289w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/mdbootstrap-previews-free-templates-react-admin-dashboard-2021.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p>Admin Dashboard from MDB is an open source free admin template with different styles of dashboards, data presentations and components. This template is built on top of Bootstrap 4 with React.js and Material Design. Cross browser support, frequent updates, community support, flex box support and Sass support are the most valuable features of MDB. MDB contains more than 500 material elements, 600+ material icons and 74 CSS animations.</p>
<ul>
<li>Rank &#8211; 7</li>
<li>GitHub Stars &#8211; 43 (By June 2021)</li>
<li>GitHub Forks &#8211; 51 (By June 2021)</li>
<li>Responsive &#8211; Fully Responsive</li>
<li>Technologies &#8211; HTML5, React.js, Sass, Bootstrap 4 and Material Design</li>
<li>License &#8211; MIT</li>
</ul>
<p><a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-visibility" style="background-color: #4769d8; color: #ffffff;" target="_blank" rel="noopener" href="https://mdbootstrap.com/previews/free-templates/react-admin-dashboard/?utm_ref_id=224486">Live Preview</a> &nbsp;<a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-cart" style="background-color: #3fb28f; color: #ffffff;" target="_blank" rel="noopener" href="https://mdbootstrap.com/freebies/react/admin-dashboard/?utm_ref_id=224486">Free Download / Docs</a></p>
<h2>Argon Dashboard Material UI (Creative Tim)</h2>
<p><a href="https://www.creative-tim.com/product/argon-dashboard-material-ui?partner=148662"><img loading="lazy" decoding="async" class="alignnone wp-image-408 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-free-template-argon-dashboard-material-ui-2021.png?resize=640%2C617&#038;ssl=1" alt="Argon Dashboard Material UI (Creative Tim)" width="640" height="617" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-free-template-argon-dashboard-material-ui-2021.png?w=1907&amp;ssl=1 1907w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-free-template-argon-dashboard-material-ui-2021.png?resize=300%2C289&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-free-template-argon-dashboard-material-ui-2021.png?resize=1024%2C987&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-free-template-argon-dashboard-material-ui-2021.png?resize=768%2C740&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-free-template-argon-dashboard-material-ui-2021.png?resize=1536%2C1480&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-free-template-argon-dashboard-material-ui-2021.png?resize=280%2C270&amp;ssl=1 280w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/react-free-template-argon-dashboard-material-ui-2021.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p>Argon Dashboard Material UI is a free open source admin template which was released 3 months ago. It is the latest and emerging admin template from the partner Creative Tim. Argon Dashboard built on top of Material UI features with many components. This will help to create amazing websites at very low budgets. It has over 100 components with pre-built examples.</p>
<ul>
<li>Rank &#8211; 8</li>
<li>Rating &#8211; 5/5</li>
<li>Downloads &#8211; Greater than 2.2k</li>
<li>Responsive &#8211; Fully Responsive</li>
<li>Technologies &#8211; HTML5, React.js, Material UI, Sass, Sketch Files, Adobe XD files, Figma Files</li>
<li>License &#8211; MIT</li>
</ul>
<p><a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-visibility" style="background-color: #4769d8; color: #ffffff;" target="_blank" rel="noopener" href="https://demos.creative-tim.com/argon-dashboard-material-ui/?partner=148662&amp;_ga=2.178909284.1595395322.1623693362-114865548.1622567721#/admin/index">Live Preview</a> &nbsp;<a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-cart" style="background-color: #3fb28f; color: #ffffff;" target="_blank" rel="noopener" href="https://www.creative-tim.com/product/argon-dashboard-material-ui?partner=148662">Free Download / Docs</a></p>
<h2>One Free React Template (Flat Logic)</h2>
<p><a href="https://flatlogic.com/templates/one-free-react-template?ref=UcaoqW5YCP"><img loading="lazy" decoding="async" class="alignnone wp-image-409 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/one-react-free-template-2021.png?resize=640%2C550&#038;ssl=1" alt="One Free React Template (Flat Logic)" width="640" height="550" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/one-react-free-template-2021.png?w=1897&amp;ssl=1 1897w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/one-react-free-template-2021.png?resize=300%2C258&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/one-react-free-template-2021.png?resize=1024%2C880&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/one-react-free-template-2021.png?resize=768%2C660&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/one-react-free-template-2021.png?resize=1536%2C1321&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/one-react-free-template-2021.png?resize=314%2C270&amp;ssl=1 314w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/one-react-free-template-2021.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p>One Free React Template is a free open source admin template which was released a year ago(2020). This template is a flat logic new emerging product built with React.js 16 and Bootstrap 4. One Free made with three colors, white, orange and grey. We can use this template mainly for building analytics and data. Beautiful charts, deep background, flat logic typography and icons, google maps integrated are the most valuable features of one free admin template.</p>
<ul>
<li>Rank &#8211; 9</li>
<li>Rating &#8211; 4.71/5</li>
<li>Downloads &#8211; Greater than 2.5k</li>
<li>Responsive &#8211; Fully Responsive</li>
<li>Technologies &#8211; HTML5, React.js, Bootstrap 4, Sass</li>
<li>License &#8211; MIT</li>
</ul>
<p><a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-visibility" style="background-color: #4769d8; color: #ffffff;" target="_blank" rel="noopener" href="https://flatlogic.com/templates/one-free-react-template/demo?ref=UcaoqW5YCP">Live Preview</a> &nbsp;<a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-cart" style="background-color: #3fb28f; color: #ffffff;" target="_blank" rel="noopener" href="https://flatlogic.com/templates/one-free-react-template?ref=UcaoqW5YCP">Free Download / Docs</a></p>
<h2><strong>React Dashboard (Flat Logic)</strong></h2>
<p><a href="https://flatlogic.com/templates/react-dashboard?ref=UcaoqW5YCP"><img loading="lazy" decoding="async" class="alignnone wp-image-405 size-full" src="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/React-Dashboard-Free-Template-in-2021.png?resize=640%2C403&#038;ssl=1" alt="Free Template React Dashboard (Flat Logic)" width="640" height="403" srcset="https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/React-Dashboard-Free-Template-in-2021.png?w=1700&amp;ssl=1 1700w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/React-Dashboard-Free-Template-in-2021.png?resize=300%2C189&amp;ssl=1 300w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/React-Dashboard-Free-Template-in-2021.png?resize=1024%2C645&amp;ssl=1 1024w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/React-Dashboard-Free-Template-in-2021.png?resize=768%2C483&amp;ssl=1 768w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/React-Dashboard-Free-Template-in-2021.png?resize=1536%2C967&amp;ssl=1 1536w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/React-Dashboard-Free-Template-in-2021.png?resize=429%2C270&amp;ssl=1 429w, https://i0.wp.com/programeasily.com/wp-content/uploads/2021/06/React-Dashboard-Free-Template-in-2021.png?w=1280&amp;ssl=1 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" data-recalc-dims="1" /></a></p>
<p>React Dashboard Template is a free open source admin template which was released 3 years ago. Firstly this template is built on top of React.js, Redux, GraphQL and Bootstrap. In addition we can use React Dashboard for CMS, CRM, SASS and E-Commerce. Server side rendering, Charts, Tables, Notification Bar and Authentication are the most valuable features of the React Dashboard template. It is a fully documented template and Fully Responsive.</p>
<ul>
<li>Rank &#8211; 10</li>
<li>Rating &#8211; 4.4/5</li>
<li>Downloads &#8211; Greater Than 6.5k</li>
<li>Responsive &#8211; Fully Responsive</li>
<li>Technologies &#8211; HTML5, React.js, Redux, Sass, GraphQL</li>
<li>License &#8211; MIT</li>
</ul>
<p><a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-visibility" style="background-color: #4769d8; color: #ffffff;" target="_blank" rel="noopener" href="https://flatlogic.com/templates/react-dashboard/demo?ref=UcaoqW5YCP">Live Preview</a> &nbsp;<a class="fasc-button fasc-size-medium fasc-type-glossy fasc-rounded-medium fasc-ico-before dashicons-cart" style="background-color: #3fb28f; color: #ffffff;" target="_blank" rel="noopener" href="https://flatlogic.com/templates/react-dashboard?ref=UcaoqW5YCP">Free Download / Docs</a></p>
<h2>You May Also Like</h2>
<ul>
<li><a href="https://programeasily.com/react-courses/">React Courses</a></li>
</ul>
<h2>Summary</h2>
<h3>In Conclusion of React Best Free Admin Dashboard Template in 2021,</h3>
<ul>
<li>React.js is one of the top programming <span style="font-weight: 400;">libraries</span> which makes web developers work simple.</li>
<li>React Templates are web pages which are already developed and well tested User Interfaces(UI Page) using React.js.</li>
<li>My favorite one is <a href="https://www.creative-tim.com/product/black-dashboard-react?partner=148662">Black Dash Board React</a> which comes with Dark Mode and Light Mode.</li>
</ul>
<p>The post <a rel="nofollow" href="https://programeasily.com/2021/06/20/react-best-free-admin-dashboard-template-in-2021/">React Best Free Admin Dashboard Template in 2021</a> appeared first on <a rel="nofollow" href="https://programeasily.com">Program Easily</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programeasily.com/2021/06/20/react-best-free-admin-dashboard-template-in-2021/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">307</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Page Caching using disk: enhanced 
Minified using disk
Database Caching using disk (Request-wide modification query)

Served from: programeasily.com @ 2025-06-20 07:39:41 by W3 Total Cache
-->