Introducing Immer: Immutability the easy way – Hacker Noon

  • The producer function receives one argument, the draft, which is a proxy to the current state you passed in.
  • The currentState will be untouched during this process.Because immer uses structural sharing, and our example producer above didn’t modify anything, the next state above is simply the state we started with.Let’s take look at what happens when we start modifying the draft in our producer.
  • It is not too bad in this simple case, but this process has to be repeated for every action, and on every level in which we want modify something.We have to make sure to return the existing state if the reducer doesn’t do anythingWith Immer, we only need to reason…
  • Both the original reducer and the new one behave exactly the same.No strings attachedThe idea to produce the next immutable state by modifying a temporarily draft isn’t new.
  • This will create a new function that will execute the producer when it’s passed in a state.

Immutable, structurally shared data structures are a great paradigm for storing state. Especially when combined with an event-sourcing architecture. However, there is a cost to pay. In a language…
Continue reading “Introducing Immer: Immutability the easy way – Hacker Noon”

JavaScript programmers need to learn Clojure – Reactive Conf

#JavaScript programmers NEED to learn #Clojure:  #ReactJS

  • And later he gave one of the most exciting talks of the last year’s ReactiveConf:Eventually, since we are huge fans of Clojure, we joined our efforts with EuroClojure and persuaded them to organize their 2016 conference in Bratislava:Clojure has forever changed the JavaScript communityMaybe you’ve never heard about Clojure, but it’s had a huge impact on you how program front-ends regardless.
  • Redux, immutable data, time travel debugging, hot reloading — all of this has been inspired by the Clojure community.Its creator, Rich Hickey, has taught us over the time thatDaniel Higginbotham summarized the key takeaways in The Unofficial Guide to Rich Hickey’s Brain, and I strongly recommend this read for everyone coming to functional programming from the OOP world.Closer look at ClojureNow you’re wondering what makes Clojure so special.Clojure is a dialect of Lisp, and we all know the jokes about Lisp parentheses, don’t we?
  • Even the code is just a huge nested list of lists, which is where the parentheses come from.Extremely simple Clojure exampleThis simplicity makes it easy to write functions that transform and generate the Clojure code.
  • For instance, generators, CSP, destructuring, or pattern matching, are implemented in Clojure as macros.You don’t use classes and objects in Clojure, you work with pure data instead.
  • The ticket will grant you access to all three days of the event.3 days packed with React, Reason, Vue, Angular, Clojure, and moreDon’t forget to follow us on Twitter, Facebook, and Medium for exciting news and announcements.By Samuel Hapák, co-organizer of ReactiveConf

It’s half past noon, and I’m sitting in a nice hummus place in Manhattan. I look anxiously at the big clock on the wall every few seconds because I should be having lunch with David Nolen, my…
Continue reading “JavaScript programmers need to learn Clojure – Reactive Conf”

Sharing state in a Symfony hybrid with Twig, React and other JavaScript apps

  • I still wanted to keep working with these two applications fluent, so I decided to share the state of the object via a dedicated object.
  • The way I see it is that this sharing of a state object can reduce friction on working with PHP-JavaScript hybrid applications by removing guessing variable names and inventing new data structures.
  • A while back I was working on an application where the back end is a full stack Symfony application.
  • In the end we’ll pass the Twig templating engine the object as well as the serialized state.
  • I was working on decoupling the front end completely by having the Symfony app serve only as an API backend.

Front end development has certainly grown up in the last few years. UI logic is increasingly being moved to the client side, but the tradit…
Continue reading “Sharing state in a Symfony hybrid with Twig, React and other JavaScript apps”

The path of software development craftsmanship

The path of software development craftsmanship  #angular #reactjs #nodejs

  • Or that you never had a case to use the Bellman-Ford algorithm in JavaScript.
  • Libraries with algorithms exist, but developer simply cannot see the case when they are useful.
  • The programming fundamentals consist of algorithms, data structures and programming language knowledge.
  • Proficient developer can see the situations when certain data structure or algorithm makes the code more productive.
  • The knowledge of algorithms and data structures is very limited.

Detailed learning of algorithms and data structures is a must for everyone who plans to become a great software developer. Half knowledge is zero knowledge.
Continue reading “The path of software development craftsmanship”

6 lessons learned from going to production with React-Redux — Medium

6 lessons learned from going to production with React-Redux:  #ReactJS

  • Every React component uses several reducers in a real world application, as most advanced apps use several data pieces.
  • if its not in the react component and there is no actual data layer that is responsible then someone is, the action .
  • Every container can hold other containers and components.
  • Some claim that you should use only props, and some say that you should use props as the data representation and state for UI states of the view.
  • We decided to adopt this concept reference it as Container and Components.

Read the full article, click here.

@ReactiveConf: “6 lessons learned from going to production with React-Redux: #ReactJS”

A few months ago i published a blog about how we started to move at Bizzabo from Backbone + RequireJS + Handlebars + Grunt to React + Redux…

6 lessons learned from going to production with React-Redux — Medium