Category Archives: general

Attitude that matters to become good Developer

 

Over the years, my experience in working as a developer and nurturing and managing front end team in Startup taught me some crucial key trails/habits a good developer possess and how does it matter for personal growth and thus for your carrier.

It begin with a state of our mind called Attitude.

In team if your role is to lead/manage the team, then you are expecting an end result/tasks on time, doesn’t matter HOW and WHAT.

Continue reading Attitude that matters to become good Developer

Advertisements

Using axios interceptors as a central place for ajax calls

axios is the great  HTTP client for the browser and node.js to work with React & Redux.

axios provides an callbacks to easily intercept requests or responses before they are handled by then or catch.

Continue reading Using axios interceptors as a central place for ajax calls

Infinite scrolling with Vue.js

vue-infinite-loading is the best plugin i found for this.

Installation

import InfiniteLoading from 'vue-infinite-loading';

export default {
  components: {
    InfiniteLoading,
  },
};

Implementation

In this case, i am using WordPress API’s to load posts of my own blog but with Infinite loading instead of paginations.

Assuming that we are using axios library to request posts over ajax. so here is code look like –

 

How to keep up to date on front end technologies

Hello there, can i ask you simple question ?

Why do we need to learn new tools, keeps our eyes on latest trends and workflows in our industry ?

The simplest answer would be – We don’t want to be outdated.

Right ? as you know that the web is a rapidly evolving universe and its vital part of our job is to stay updated with latest tools, trends, workflows, frameworks  …and so on in web industry.

Continue reading How to keep up to date on front end technologies

Ajax handling with redux-observable in Redux

While working Redux and for doing async operations/side effects you may found middlewares like redux-thunk or redux-saga or redux-observable ..and so on.

So far working with them i found redux-observable is an great and powerful redux middleware than others for doing async actions.

The powerful means –

  1. We can Compose and cancel async actions
  2. Can do complex async/side effects
  3. Can access store inside epics
  4. Injecting your dependencies

As you know Epic is nothing but an function which is the core primitive of redux-observable.
Its an glue between Action creators and Reducer.

Continue reading Ajax handling with redux-observable in Redux

Asynchronous files loading with jQuery deferred with callback

FilesLoader.js


// Main `TemplateManager` object
// The Template Loader. Used to asynchronously load files 

window.FilesLoader = {

  files: {},

  load: (function(views, callback) {

    var deferreds = [], tplPath;

    var defaults = {
      path: opt.tpl.options.path,
      ext: opt.tpl.options.ext
    };


    $.each(views, function(index, view) {
        var self = this;
        //Convert to string
        view = "" + view;
        //tpl file path
        tplPath = "" + defaults.path + view + defaults.ext;

        deferreds.push( $.ajax({
          url: tplPath,
          success: function(tplString) {
            self.files[view] = {
              tplString: tplString,
              compiled: Handlebars.compile(tplString)
            };
          },
          dataType: 'html',
          cache: true,
        }) );

    });
    $.when.apply($, deferreds).done(callback);
  }).bind(this);

};

Usage


var tplsToLoad = [
  'tpl/menu-section',
  'tpl/header',
  'tpl/footer'
];

window.FilesLoader.load(tplsToLoad,
function () {
  //Do what you want to do after all templates loaded
});