So Javascript has this interesting feature called Proxy. This will allow you to intercept value getting and setting in a given object. This can be used to achieve Signals in React. By notifying listeners whenever the value property is set. For there to be listeners, we should also add a subscribe function that returns a [ ]
This article is about a Norwegian educational initiative that I helped start up, Koding.no. For this reason, the article is in Norwegian. Kode24 skrev i dag om Koding.no, et nytt initiativ som jeg nylig har startet i gang. Koding.no sikter mot å bli en solid ressurs for nybegynnere som har lyst til å lære seg [ ]
Here s a useful abstraction on top of custom events that let you more easily set up typesafe channels to communicate between. This can be used in React like a hook: It s worth noting that the events collected in the hook are cleared when the component is unmounted, and it only start listening once the component [ ]
@ryfylke-react/toast is a lightweight headless toast library. The problem Most toast-libraries I ve come over are generally very clunky and opinionated. Yes, you can customize the toasts through options and props, but it s generally tedious, and you have to overwrite their existing styles. I ve found that whenever I ve needed to build a toast-system, I ve ended up [ ]
I ve been continuing to work on RTK Query Loader, on the side, since it s inception 4 months ago. In that time, I ve fixed some bugs, added some new features and written a proper documentation site. Interface updates One thing that I ve thought about for a while, was rewriting the input/output format for the loaders. It s [ ]
Typescript is great, for many reasons. I think everyone will agree with that statement if they ve given it a proper try. While writing type-safe NPM-packages, I ve learnt a few tips and tricks that can help you utilize it for it s full worth. Generics are magic Generics let you essentially tell Typescript that I m not sure [ ]
A new package that I ve made. What problem does it solve? Let us say that you are using redux toolkit, and utilising createAPI and it s generated useQuery hooks. You might have found yourself in a situation similar to this: I have a component that needs data from multiple queries And depending on your preferences, you [ ]
Welcome back to yet another edition of Håkon redesigns his portfolio/blog for the nth time . I really should come up with a more catchy name. Let s start off with some stats, shall we? The previous design has been live since atleast September 2020. I ve worked on it incrementally since it was launched back in September [ ]
So I ve been working on this educational site, an internal project at my company. One of the things I really wanted as a big feature was a on-site code-editor that can run React-code. In my mind this seemed like it was a pretty big task, but it turns out it s actually relatively straight forward. First [ ]
Before createAPI came out, my current team needed a way of cleaning up all of the loading logic around our async thunks. We were using @reduxjs/toolkit, with createSlice and createAsyncThunk. A simple solution to our problem was essentially adding a match on the extraReducer builder for any thunk that included :load in its name, and [ ]