177177177
Can you make a fresh route detect, if it is being requested by `deno run`
Can you make a fresh route detect, if it is being requested by
deno run
like deno run https://localhost:3000/api/test
doing deno run https://localhost:3000/api/test
on the fresh route gives me this error
8 replies
Signal value not updating from inside of `for await of` loop inside of an IIFE
I'm using an IIFE here because otherwise the
for await of
loop will block the code and page keeps loading till WebSocketStream
connection ends, so I did that.
But why does setting message.value = msg
not update the button text, it is stuck at the initial Connecting
text.
But when I set message.value = 'updated outside of the IIFE'
then it works fine, the value is updating as expected.
The console.log(msg)
inside the IIFE's for await of
loop also works and logs the msg
to the console, but still message.value = msg
doesn't. Why ??11 replies
How to monkey patch an installed third party deno module.
Is it possible to monkey patch an installed third party deno module??
I want to overwrite a function from a third party module that I'm using so the function logic gets updated everywhere.
3 replies
About performance
if a function takes only one paramater
and i pass unnecessary additional parameters would it affect the performance of just the function part of the code?
this is what im caonfused abt
i have a object, every value is a function that takes the same parameter
payload
except only one value that takes an additional second parameter args
i want to know which way from these two would perform better
7 replies
How to stop reading from a ReadableStream?
the
break
stops the for loop, but it doesnt exit? because it only logs the user
after the readable
stream is completed. i dont want to wait for the stream to complete/end, i want to get user
immidiately after break
is called.
here readable
is ReadableStream
2 replies
type a whole directory to make sure each file in the directory exports a default module of a type.
Can you type a whole directory
to make sure that every file in the directory is exporting a default module of a certain type
im making a library, and it reads a directory named
commands
in the users current working directory, each file in the commands directory should export a default object of type Command
currently my library checks if the file is exporting a default module before going further,
but i was wondering if typescript could do that
since its about exporting the correct type1 replies
extract generic type of generic class
how to get typeof generic type in generic class
i want to extract type T
i am using a library, it exports a generic class, but doesnt export the generic type that the generic class takes, and i want to extend the generic class, like this
another example,
i want the generic type of
ExtendedClient
be the same as the generic type of Client
. but i dont have access to generic type of Client
, so thats why i want to extract it.
so i can do 4 replies