« first day (2737 days earlier)      last day (1380 days later) » 

07:24
Hi @RE60K and sorry, there are rules for this room
1 message moved from GMTs
 
1 hour later…
 
3 hours later…
 
3 hours later…
14:42
is it so, that when i append like this: $("body").append($("<script />", {
type:"text/javascript",
src:"/lsScript.js?v=" + new Date().getTime()
}));
1 message moved from JavaScript
 
3 hours later…
18:31
yoyo my fellow js devs
Got a typescript questions:
export interface MediaState {
    camera: boolean,
    microphone: boolean,
    screen: boolean
}

export type MediaSource = keyof MediaState;

class MyInfoStore {
   public transports: Record<TransportJob, types.Transport | null> = {
        sending: null,
        receiving: null
    }
}
class MyInfoService {
    static pause(source: MediaSource) {
        MyInfoStore.producers[source]?.pause();
    }
}
TypeScript is complaining that Type MediaSource cannot be used as an index type. Why not?
How can I index a record like this?
4 messages moved from JavaScript
    export interface MediaState {
        camera: boolean,
        microphone: boolean,
        screen: boolean
    }

    export type MediaSource = keyof MediaState;

   class MyInfoStore {
       public producers: Record<MediaSource, types.Transport | null> = {
        camera: null,
        microphone: null,
        screen: null
      }
    }

    class MyInfoService {
        static pause(source: MediaSource) {
            MyInfoStore.producers[source]?.pause();
        }
    }
TypeScript is complaining that Type MediaSource cannot be used as an index type. Why not? How can I index a record like this?
4 messages moved from JavaScript
 
2 hours later…
20:43
stackoverflow.com/questions/63062686/… Would it be a good idea to include a line number setter option just like Code, Bold etc.?
21:18
Math.abs(0)

« first day (2737 days earlier)      last day (1380 days later) »