by Ossi Hanhinen, @ohanhi
with the support of Futurice 💚.
Licensed under CC BY 4.0.
(function (originalOpen) { | |
XMLHttpRequest.prototype.open = function (method, url, async, user, password) { | |
if (url.match(/limits/)) url = "REJECTED"; | |
originalOpen.call(this, method, url, async, user, password); | |
}; | |
})(XMLHttpRequest.prototype.open); |
Real world application with a lot of pages (or "screens") have to deal with problem managing the pages' DOM and memory efficiently and at the same provide a nice smooth transition effect between pages. This is not a real problem when you do it in native apps since Android or iOS already handle the hard work for you, but when come to JavaScript, HTML, and CSS, running on mobile browsers, this is the real challenge.
There are 2 common approaches to solve this problem:
display
) to transit between pages.const React = require("react"); | |
const ReactDOM = require("react-dom"); | |
const reducer = (state, action) => { | |
switch (action) { | |
case "INCREMENT": | |
return state + 1; | |
case "DECREMENT": | |
return state - 1; | |
default: |