are you bad, good, better or best with java script promises

Post on 02-Jul-2015

148 Views

Category:

Software

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

JS Channel NCR Meetup Talk on "How to use JavaScript Promises in the best way possible" by Apoorv Saxena. It talks about: * How to you score yourself in your current implementation of JavaScript Promises? * Being creative with JavaScript Promises * JavaScript Promises Implementation as defined in EcmaScript 6 specifications. Meetup: http://www.meetup.com/JSChannel-NCR/events/216101952/

TRANSCRIPT

LoversHey,

I am Apoorv.

I love writingBeautiful code.

Let's get started.

Are you Bad, Good,Better or Best with

JavaScriptPromises?

But before that, let'splay a small game

Game 1:

What are Promises?

Rules: There are no Rules.

Take a moment to Congratulateyourself and others!!!

Game 2:

How are you using

Promises?

Game 3:

What do you understand, when you see....

BAD

GOODBETTER

BEST

History of Promises

Why Promises?

CallBack Hell

Pyramid of Doom:

Or writeSynchronous

JavaScript$.ajax({ url: "test.html", async: false }) console.log('This is how I write Synchronous JavaScript Code')

Handling ConcurrentAjax Calls

Error handlingbecomes more

complicated

Title Text

Yes, I love Promises

But what now?

“ Asynchronicityisn’t just for

concurrency, andpromises aren’t

just for XHR"

Being creative withPromises

Build UI Interactions

Different UI components communicatewith each other via Promises.

Message Passingbetween iFrame and

Window

is a Request/Response based wrapper aroundthe PostMessage API that makes use of jQuery Promisesplease.js

Increase Consistencyin Module Behavior

Using Promises to interact between two modules, willenable to retain the core logic of a module without

sharing its state with other dependent modules whilevalidating conditions or while applying their respective

logic.

Wanna Migrate from jQuery?

Exception Handling

Chaining

Asynchrony

Single vs. Multiple Values

Deferreds, Promises, Resolvers

What's new in ES6?Promises along with Generators and Iterators in going to be fun.Unifying asynchronous APIs ( fetch API is a promise-basedalternative to XMLHttpRequest)The for programmatically importing modulesis based on promises, tooPromises versus eventsPromises don't expose a progress api (e.g. to display a progressbar in a client-side user interface) :(

ECMAScript 6 API

There's no grading,it's all about

Learning

Thanks!!!

About Me:

Senior Software EngineerLove to Hack, Cook and Travel

I've worked before in:

and now working in:

Let's Connect..

LinkedIn: http://in.linkedin.com/in/saxenaapoorv

Google+: https://plus.google.com/+ApoorvSaxena/

Email: root@apoorv.pro

top related