carto/api-client JavaScript (and TypeScript) client library for CARTO APIs and framework-agnostic CARTO + deck.gl applications. Includes: Widget APIs … TBD Installation Install @carto/api-client: npm install –save @carto/api-client Documentation Fetching data Import vectorTableSource, vectorQuerySource, and other data source functions from the @carto/api-client package. These are drop-in replacements for the equivalent functions from the @deck.gl/carto package, and the same data source may be used with any number of layers… Continue reading carto/api-client
Tag: typeScript
What is TypeScript?
What is TypeScript? TypeScript is a superset of JavaScript developed by Microsoft. It adds static typing to JavaScript, which allows developers to define the types of variables, function parameters, and return values. This ensures that errors are caught during development instead of at runtime, making code safer and easier to debug. Files written in TypeScript… Continue reading What is TypeScript?
TypeScript Generics in Custom React Hooks
In custom hooks, TypeScript generics allow you to define flexible data types at runtime, enabling a single hook to work with various data structures. Generics are ideal for hooks that perform similar operations on different types of data, like fetching various API data or managing states of diverse data models. What Are Generics? In TypeScript,… Continue reading TypeScript Generics in Custom React Hooks
Quarks
three.quarks three.quarks is a high-performance javascript particle system based visual effect library for threejs written in modern TypeScript. three.quarks computes most particle information on CPU, and it uses customized shader , instancing, batch techniques to render those particles with as few draw calls as possible. three.quarks supports one dimension piecewise Bézier curves for the customizable transform visual… Continue reading Quarks
What is type null and its use in TypeScript?
The null keyword is considered as a data type in TypeScript as well as in JavaScript. The null keyword indicates the unavailability of a value. It can be used to check whether a value is provided to a particular variable. Example: function getData(orgName: string | null, orgDesc: string | null): void { if (orgName ===… Continue reading What is type null and its use in TypeScript?
What are the Advantages of TypeScript over JavaScript
Advantages of TypeScript over JavaScript: Static Typing: Advantage: TypeScript introduces static typing, which helps catch errors at compile time instead of runtime. This reduces bugs and increases reliability as you define types for variables, function parameters, and return values. Disadvantage: The need to explicitly define types may add extra code and complexity, especially for smaller… Continue reading What are the Advantages of TypeScript over JavaScript
Error Handling without the Result Class
Purposefully throwing errors can have several negative side effects to the readability and traceability of your code. In this article, we take a look at an alternative to how to handle errors within your Node.js + TypeScript applications. Do you ever find yourself wondering where exactly you should throw an error to be consumed by… Continue reading Error Handling without the Result Class
Commerce Module Migration to TypeScript
SuiteCommerce Advanced (SCA) source code is being migrated to TypeScript in phases. TypeScript is an open source superset of JavaScript designed to optimize development efficiency. The code migration to TypeScript is ongoing and includes changes such as: Changing filename extension from .js to .ts Transforming module system from Asynchronous Module Definition (AMD) to a TypeScript… Continue reading Commerce Module Migration to TypeScript
How to avoid timezone offset shift when displaying a date input value in typescript
I was using javascript to show the date field in ‘mm-dd-yyyy’ format from the date input field in typescript. But since the input date value was only having the date and not time, when using the ‘new Date()’ function time was set to 00:00:00 hours GMT. This caused date to shift a day before in… Continue reading How to avoid timezone offset shift when displaying a date input value in typescript
How to display a date object as a date value in another timezone
In Javascript, the date object does not store any specific timezone value. The time is stored in the value of the local timezone relative to GMT(Greenwich Mean Time). If we print the time object, we can see that the time is represented as a value with a sign and offset from the UTC(Coordinated Universal Time)… Continue reading How to display a date object as a date value in another timezone