<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Moruling James</title>
    <description>The latest articles on DEV Community by Moruling James (@captainmor).</description>
    <link>https://dev.to/captainmor</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F811041%2Fc5b3ae88-13ce-494c-b333-c81bc3e42249.png</url>
      <title>DEV Community: Moruling James</title>
      <link>https://dev.to/captainmor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/captainmor"/>
    <language>en</language>
    <item>
      <title>Online imaging tools to speed up your development</title>
      <dc:creator>Moruling James</dc:creator>
      <pubDate>Mon, 16 Jan 2023 14:58:16 +0000</pubDate>
      <link>https://dev.to/captainmor/online-imaging-tools-to-speed-up-your-development-5fdg</link>
      <guid>https://dev.to/captainmor/online-imaging-tools-to-speed-up-your-development-5fdg</guid>
      <description>&lt;p&gt;Lets say you are developing an app, mobile or web for someone or your own project but you need logos, icon or images with certain size and transparency real quick. &lt;/p&gt;

&lt;p&gt;Here is a list of imaging tools available for free online that you can utilize to get that image in 5 minutes!&lt;/p&gt;

&lt;p&gt;Say you scaffolded your app and need to change the header logo&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F69559u21v5gwcizpg4o9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F69559u21v5gwcizpg4o9.png" alt="Image description" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and this is the logo you need to work with&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnornj8pvbg65ya43i30.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnornj8pvbg65ya43i30.PNG" alt="Image description" width="597" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and below is the style for the logo&lt;br&gt;
&lt;code&gt;.logo {&lt;br&gt;
  width: 120px;&lt;br&gt;
  height: 31px;&lt;br&gt;
  background: rgba(255, 255, 255, 0.2);&lt;br&gt;
  margin: 16px 24px 16px 0;&lt;br&gt;
  float: left;&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Crop PNG &amp;amp; resize 
&lt;a href="https://resizing.app/features/resize-png/" rel="noopener noreferrer"&gt;https://resizing.app/&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;crop&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqlv21k4vkcrg7upyhgr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqlv21k4vkcrg7upyhgr.png" alt="Image description" width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;resize&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm89r1cdw1czprlxwkhc0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm89r1cdw1czprlxwkhc0.png" alt="Image description" width="800" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Remove background &lt;a href="https://onlinepngtools.com/create-transparent-png" rel="noopener noreferrer"&gt;onlinepngtools.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw6ia3mnh0lqfg1uf5vk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw6ia3mnh0lqfg1uf5vk.png" alt="Image description" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;use it&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fayhwot23yeyf38pazrqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fayhwot23yeyf38pazrqt.png" alt="Image description" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you have a transparent image to use as logo. Not the prettiest but that gets you going superfast!&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>discuss</category>
      <category>challenges</category>
    </item>
    <item>
      <title>Events removed in Ionic 5</title>
      <dc:creator>Moruling James</dc:creator>
      <pubDate>Sun, 15 Jan 2023 08:23:52 +0000</pubDate>
      <link>https://dev.to/captainmor/events-removed-in-ionic-5-5b2b</link>
      <guid>https://dev.to/captainmor/events-removed-in-ionic-5-5b2b</guid>
      <description>&lt;p&gt;Gone were the days where you were able to simply publish something like this from everywhere in your ionic app&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.events.publish('user:created', user, Date.now());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and listening to them by subscribing to the events by the given id&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;events.subscribe('user:created', (user, time) =&amp;gt; { 
    console.log('Welcome', user, 'at', time);
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you &lt;code&gt;ionic start&lt;/code&gt; your new app, created your first few components and by the time you were ready to have them communicate with each other realized,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mGgGeO_h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i3bgvqkpl8otwe0pc3w0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mGgGeO_h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i3bgvqkpl8otwe0pc3w0.png" alt="Image description" width="721" height="78"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the Events you were used to using, is not there anymore!. According to the changelog,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Events&lt;br&gt;
The @ionic/angular Events service has been removed.&lt;br&gt;
Use "Observables" for a similar pub/sub architecture: &lt;a href="https://angular.io/guide/observables"&gt;https://angular.io/guide/observables&lt;/a&gt;&lt;br&gt;
Use "Redux" for advanced state management: &lt;a href="https://ngrx.io"&gt;https://ngrx.io&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;read more here : &lt;a href="https://github.com/ionic-team/ionic-framework/blob/45d03baf981d0e10eb1fe689908532adef2ba31d/BREAKING.md#events-1"&gt;https://github.com/ionic-team/ionic-framework/blob/45d03baf981d0e10eb1fe689908532adef2ba31d/BREAKING.md#events-1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So now what?&lt;br&gt;
Easy! lets go with something I would call as a notification based service. Lets build something simple.&lt;/p&gt;

&lt;p&gt;Go ahead and use the ionic cli to create a new application, in this example I am using the tabs template. Here is what we will be building&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--df9niXXz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/253fbrcalrxhlpyxslk9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--df9niXXz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/253fbrcalrxhlpyxslk9.png" alt="Image description" width="388" height="840"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will be creating 2 components inside of Tab1 tab, name it&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tab-info-component&lt;/li&gt;
&lt;li&gt;tab-info-entry-component&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;we will have an input in tab-info-entry-component that will change the value of the tab-info-component on top when the input loses focus. Simple as that.&lt;/p&gt;

&lt;p&gt;The structure should be something like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gxA-S6Uw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ucnor0fcrrvblbr1cm66.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gxA-S6Uw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ucnor0fcrrvblbr1cm66.png" alt="Image description" width="393" height="555"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lets start by adding the controls in our components html and their binding property&lt;/p&gt;

&lt;p&gt;tab-info.component.html&lt;br&gt;
&lt;code&gt;&amp;lt;h2&amp;gt;Tab-info Component&amp;lt;/h2&amp;gt;&lt;br&gt;
&amp;lt;ion-label&amp;gt;Info&amp;lt;/ion-label&amp;gt;&lt;br&gt;
&amp;lt;ion-textarea [(ngModel)]="text"&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;tab-info.component.ts&lt;br&gt;
&lt;code&gt;text = '...';&lt;br&gt;
 constructor() { }&lt;br&gt;
 ngOnInit() {}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;tab-info-entry.html&lt;br&gt;
&lt;code&gt;&amp;lt;h2&amp;gt;Tab-info-entry Component&amp;lt;/h2&amp;gt;&lt;br&gt;
&amp;lt;ion-item&amp;gt;&lt;br&gt;
  &amp;lt;ion-label&amp;gt;Enter Info&amp;lt;/ion-label&amp;gt;&lt;br&gt;
  &amp;lt;ion-input placeholder="Info" [(ngModel)]="info" (ionBlur)="onBlur()"&amp;gt;&amp;lt;/ion-input&amp;gt;&lt;br&gt;
&amp;lt;/ion-item&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;tab-info-entry.ts&lt;br&gt;
&lt;code&gt;info = '';&lt;br&gt;
  constructor() { }&lt;br&gt;
  ngOnInit() {}&lt;br&gt;
  onBlur(){&lt;br&gt;
    console.log('info')&lt;br&gt;
  }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;at this point, no communication is established yet. So lets go ahead and create a service called tabInfoEntryNotificationService for that purpose. This service will do 2 things, provide a method to notify other component consuming this service, and also returns a subscribeable subject to listen to the notification.&lt;/p&gt;

&lt;p&gt;I will go an extra step now, to add an interface that will provide the blueprint of that, since logically, we will be having a lot of this notification service for each different components.&lt;/p&gt;

&lt;p&gt;icomponent-notification.interface.ts&lt;br&gt;
&lt;code&gt;import { Subject } from "rxjs";&lt;br&gt;
export interface IComponentNotification {&lt;br&gt;
  notify(data: any): void;&lt;br&gt;
  notification(): Subject&amp;lt;any&amp;gt;;&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
then finally create the service&lt;/p&gt;

&lt;p&gt;info-entry-notification.service.ts&lt;br&gt;
&lt;code&gt;import { Injectable } from '@angular/core';&lt;br&gt;
import { Subject } from 'rxjs';&lt;br&gt;
import { IComponentNotification } from './icomponent-notification.interface';&lt;br&gt;
@Injectable({&lt;br&gt;
  providedIn: 'root'&lt;br&gt;
})&lt;br&gt;
export class InfoEntryNotificationService implements IComponentNotification {&lt;br&gt;
  constructor() { }&lt;br&gt;
  private subject = new Subject&amp;lt;any&amp;gt;();&lt;br&gt;
  notify(data: any): void {&lt;br&gt;
    this.subject.next(data);&lt;br&gt;
  }&lt;br&gt;
  notification(): Subject&amp;lt;any&amp;gt; {&lt;br&gt;
    return this.subject&lt;br&gt;
  }&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now in each of the components, inject the service and make use of it.&lt;/p&gt;

&lt;p&gt;tab-info-entry.component.ts&lt;br&gt;
&lt;code&gt;constructor(private infoEntryNotificationService: &lt;br&gt;
 InfoEntryNotificationService) { }&lt;br&gt;
  ngOnInit() {}&lt;br&gt;
  onBlur(){&lt;br&gt;
    this.infoEntryNotificationService.notify({&lt;br&gt;
      text: this.info&lt;br&gt;
    });&lt;br&gt;
  }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;tab-info.component.ts&lt;br&gt;
&lt;code&gt;text = '...';&lt;br&gt;
  constructor(private infoEntryNotificationService: InfoEntryNotificationService) { }&lt;br&gt;
  ngOnInit() {&lt;br&gt;
    this.infoEntryNotificationService.notification().subscribe((data) =&amp;gt; {&lt;br&gt;
      this.text = data.text;&lt;br&gt;
    })&lt;br&gt;
  }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now everytime you change the input value in the 'Enter Info' field, the value will be reflected at the 'Info' textarea field and this was communicated via the notification service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JqJI3BR9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/re6ejaudke2tjkgjbdex.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JqJI3BR9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/re6ejaudke2tjkgjbdex.png" alt="Image description" width="385" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy Morr n Morrr coding!&lt;/p&gt;

&lt;p&gt;Github : &lt;a href="https://github.com/captainmor/ionic6-service-based-component-notification.git"&gt;https://github.com/captainmor/ionic6-service-based-component-notification.git&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ionic</category>
      <category>angular</category>
      <category>typescript</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
