2024 OVO 21th July lowest Electricity rate for new customer. Changing your plan is super easy! Use the refer link to get $120 credit

After a bit of research. OVO is the lowest rate electricity retailer at 2024 July for new customer making the switch. Haven’t see any lower rate than 23c/kw. And switching is super easy. They even have a plan to let you use electricity free for 3 hours every day! Use the refer link to get…

SOILD Principles

Single-Responsibility Principle A class should have one and only one reason to change, meaning that a class should have only one job. Open-Closed Principle Objects or entities should be open for extension but closed for modification. Liskov Substitution Principle Let q(x) be a property provable about objects of x of type T. Then q(y) should…

React Hooks – More than just syntax sugar?

React hooks decouples state management from class based react component and allow it to be consumed in functional way. However the overwhelming limitation of “Don’t call Hooks inside loops, conditions, or nested functions” brings a lot of headache to developers.   There are 5 most useful hooks. const [state, setState] = useState(initialState); useState is a…

Flux, Observer, Factory pattern and Redux

Redux is an implementation of Flux pattern which aims to solve the state management issue in large scale complex react app.   Flux pattern at its core is pipe line: An action dispatches an event. Event is send at data store and triggers an mutation of the data. Then the data mutation triggers the view…

Super useful Arrow Function in React

To avoid the annoying function binding in react components classes constructor(props) {  super(props);  this.myFuncInClass = this.myFuncInClass.bind(this); } Install the following plugin via npm and enable it babel-plugin-transform-class-properties Then you can write arrow function and void the binding. myFuncInClass = () => { // code } Be aware about the difference between Arrow function expression and Traditional function…