Tag: javascript

  • Building a Full-Stack Type-Safe Website with OCaml

    Introduction In today’s fast-paced web development world, building reliable and maintainable applications is crucial. Type safety plays a significant role in catching errors early in the development process, reducing bugs, and improving code quality. OCaml, a statically typed functional programming language, offers robust features that make it an excellent choice for full-stack web development. This […]

  • Journey to Functional Programming in JavaScript

    Course Outline Understand the principles of functional programming Construct pure, stateless functions Use higher-order functions such as map, filter, reduce, etc. Avoid mutation; use immutable data structures Apply these practices in your React projects Some languages that support functional programming: Haskell, OCaml, F#, Erlang, Clojure, Scala, etc. So, What Is Functional Programming and Why Is […]

  • Create a nextjs app with chatgpt api

    OpenAI’s ChatGPT is a powerful language model that can be used to create engaging chatbots, virtual assistants, and content generators. In this blog post, we will explore how to integrate ChatGPT into a Next.js application using the OpenAI Node.js library. We will provide example code to demonstrate how to make API requests and process responses […]

  • Optimizing your components with useSignal

    State management is a fundamental part of building React and Preact applications. The useState hook is the most common way to manage state in React components, but there’s a new kid on the block that’s worth considering: useSignal. useSignal is part of the @preact/signals library, which provides a way to manage state using reactive principles. […]

  • Passing props to props.children in a React functional component

    Passing props to props.children in a React functional component is a way of passing data down to multiple child components at once. The props.children property is a reference to the child elements that are contained within the component’s JSX tag. Here’s an example of how to pass props to props.children in a functional component: import […]

  • How to get all Singapore startups, startups owner, investors profiles for free

    Recently I was reading some article and happened to came across this website https://www.startupsg.gov.sg, right is a website to showcase startups based in Singapore. In the website, there are a few directories such as startups, investors and profiles: https://www.startupsg.gov.sg/directory/startups/ As you can see the infos are protected on UI part, when you click disclosed funding […]

  • Higher order component for ReasonReact

    A higher order component is basically a reusable component which allows you to takes in another component and return a new component. To recap about higher component check our my older post here In ReasoML higher order function are called "Functors" which takes in a module type and returns a module type, functors are written […]

  • optional chaining in javascript

    Imaging if you need to access deep level of property and you are not sure that if such properties exists deep down, you are doing something like books && books.book && books.book.authors && books.book.authors.author This is really difficult to read and understand sometime. there is something called optional chaining in javascript proposal which you can […]