Skip to content

Tag: javascript

How to understand JS realms

In ECMAScript specification there is notion of “realms” introduced: Before it is evaluated, all ECMAScript code must be associated with a realm. Conceptually, a realm consists of a set of intrinsic objects, an ECMAScript global environment, all of the ECMAScript code that is loaded within the scop…

Relationship between event loop,libuv and v8 engine

I am learning through the architecture of Node.js. I have following questions. Is event loop a part of libuv or v8? Is event queue a part of event loop? are event queue generated by libuv or v8 engine or event loop itself? What is the connection between libuv and v8 engine? If event loop is single threaded, d…

how to chain async methods

The API I’ve written has several async methods that do not return a value, but still should be executed in the order they are called. I’d like to abstract the awaiting resolution from the end user so that they can chain method calls and expect that each promise is executed after the previous is re…

Bind class to element depending on v-model in Vue.js

Trying to create dynamic table( link to Codepen) with Vue. Now i want to add class using :class to row when checkbox is checked. Every checkbox is bound with specific value in object of objects. There is no error or warning, it just not working. I would be glad to hear any idea about solving this problem. Ans…

Table sorting with index assignment

I have an array of objects: I use it as a model for a buefy table and at the same time, I’m using the extension sortable.js to manually order the table rows: The table is rendered correctly, but I need to update the order parameter on each manually sorting to reflect the real order o the table. For exam…

How to use Vuetify tabs with vue-router

I have the following jsfiddle that has two Vuetify tabs. The documentation doesn’t show examples on using vue-router with them. I found this Medium.com post on how to use Vuetify with vue-router, which has the following code: However, the code is now outdated as the Vuetify 1.0.13 Tabs documentation doe…

Decorator to return a 404 in a Nest controller

I’m working on a backend using NestJS, (which is amazing btw). I have a ‘standard get a single instance of an entity situation’ similar to this example below. This is incredibly simple and works – however, if the user does not exist, the service returns undefined and the controller ret…