Generator Functions Javascript

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

REDUX SAGA &

GENERATORS
Kushan Joshi
GENERATORS

WHY PROMISES HELP

Trustable: You can totally trust them

Composability: Easily compose promise. / chaining?

Inversion of Control:

Error handling:
TEXT

WHATS WITH GENERATORS

Complement Promises not replace them!

They look almost synchronous, easier for humans to


understand

Do lazy stuff // explain more on this

Pause and Resume

Generating Values
TEXT

SIMPLE GENERATOR EXAMPLE


TEXT

COMMUNICATING WITH YIELD

Yield has powerful dual characteristic

Yield Messaging example here


TEXT

GENERATING VALUES WITH GENERATORS


When you execute a generator you get back an iterable.
TEXT

DELEGATING WITH YIELD*


TEXT

INTRODUCTION TO REDUX SAGA


Brief introduction
TEXT

COMPARING WITH THUNKS


TEXT

COMPLEX LOGIN/LOGOUT EXAMPLE


TEXT

REDUX SAGA HELPER FUNCTIONS


TEXT

TESTABILITY

You might also like