Preskoči na sadržaj
Korištenjem servisa na Twitteru pristajete na korištenje kolačića. Twitter i partneri rade globalno te koriste kolačiće za analize, personalizaciju i oglase.

Za najbolje sučelje na Twitteru koristite Microsoft Edge ili instalirajte aplikaciju Twitter iz trgovine Microsoft Store.

  • Naslovnica Naslovnica Naslovnica, trenutna stranica.
  • O Twitteru

Spremljena pretraživanja

  • obriši
  • U ovom razgovoru
    Ovjeren akauntZaštićeni tweetovi @
Predloženi korisnici
  • Ovjeren akauntZaštićeni tweetovi @
  • Ovjeren akauntZaštićeni tweetovi @
  • Jezik: Hrvatski
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English
    • English UK
    • Español
    • Filipino
    • Français
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Български език
    • Русский
    • Српски
    • Українська мова
    • Ελληνικά
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Imate račun? Prijava
    Imate račun?
    · Zaboravili ste lozinku?

    Novi ste na Twitteru?
    Registrirajte se
Profil korisnika/ce phry
Lenz Weber
Lenz Weber
Lenz Weber
@phry

Tweets

Lenz Weber

@phry

developer at @mayflowergmbh, sometimes speaker, sometimes teacher, doing mostly #react, #typescript and #devops

Deutschland
phryneas.de
Vrijeme pridruživanja: svibanj 2009.

Tweets

  • © 2020 Twitter
  • O Twitteru
  • Centar za pomoć
  • Uvjeti
  • Pravila o privatnosti
  • Imprint
  • Kolačići
  • Informacije o oglasima
Odbaci
Prethodni
Sljedeće

Idite na profil osobe

Spremljena pretraživanja

  • obriši
  • U ovom razgovoru
    Ovjeren akauntZaštićeni tweetovi @
Predloženi korisnici
  • Ovjeren akauntZaštićeni tweetovi @
  • Ovjeren akauntZaštićeni tweetovi @

Odjava

Blokiraj

  • Objavi Tweet s lokacijom

    U tweetove putem weba ili aplikacija drugih proizvođača možete dodati podatke o lokaciji, kao što su grad ili točna lokacija. Povijest lokacija tweetova uvijek možete izbrisati. Saznajte više

    Vaši popisi

    Izradi novi popis


    Manje od 100 znakova, neobavezno

    Privatnost

    Kopiraj vezu u tweet

    Ugradi ovaj Tweet

    Embed this Video

    Dodajte ovaj Tweet na svoje web-mjesto kopiranjem koda u nastavku. Saznajte više

    Dodajte ovaj videozapis na svoje web-mjesto kopiranjem koda u nastavku. Saznajte više

    Hm, došlo je do problema prilikom povezivanja s poslužiteljem.

    Integracijom Twitterova sadržaja u svoje web-mjesto ili aplikaciju prihvaćate Twitterov Ugovor za programere i Pravila za programere.

    Pregled

    Razlog prikaza oglasa

    Prijavi se na Twitter

    · Zaboravili ste lozinku?
    Nemate račun? Registrirajte se »

    Prijavite se na Twitter

    Niste na Twitteru? Registrirajte se, uključite se u stvari koje vas zanimaju, i dobivajte promjene čim se dogode.

    Registrirajte se
    Imate račun? Prijava »

    Dvosmjerni (slanje i primanje) kratki kodovi:

    Država Kod Samo za korisnike
    Sjedinjene Američke Države 40404 (bilo koje)
    Kanada 21212 (bilo koje)
    Ujedinjeno Kraljevstvo 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Irska 51210 Vodafone, O2
    Indija 53000 Bharti Airtel, Videocon, Reliance
    Indonezija 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italija 4880804 Wind
    3424486444 Vodafone
    » Pogledajte SMS kratke šifre za druge zemlje

    Potvrda

     

    Dobro došli kući!

    Vremenska crta mjesto je na kojem ćete provesti najviše vremena i bez odgode dobivati novosti o svemu što vam je važno.

    Tweetovi vam ne valjaju?

    Prijeđite pokazivačem preko slike profila pa kliknite gumb Pratim da biste prestali pratiti neki račun.

    Kažite mnogo uz malo riječi

    Kada vidite Tweet koji volite, dodirnite srce – to osobi koja ga je napisala daje do znanja da vam se sviđa.

    Proširite glas

    Najbolji je način da podijelite nečiji Tweet s osobama koje vas prate prosljeđivanje. Dodirnite ikonu da biste smjesta poslali.

    Pridruži se razgovoru

    Pomoću odgovora dodajte sve što mislite o nekom tweetu. Pronađite temu koja vam je važna i uključite se.

    Saznajte najnovije vijesti

    Bez odgode pogledajte o čemu ljudi razgovaraju.

    Pratite više onoga što vam se sviđa

    Pratite više računa da biste dobivali novosti o temama do kojih vam je stalo.

    Saznajte što se događa

    Bez odgode pogledajte najnovije razgovore o bilo kojoj temi.

    Ne propustite nijedan aktualni događaj

    Bez odgode pratite kako se razvijaju događaji koje pratite.

    Lenz Weber‏ @phry 14. sij
    • Prijavi Tweet

    While last #TypeScriptTuesday we looked at #TypeScript Generics Basics, today we continue where we left off, by taking a closer look at type argument inference, pitfalls and workarounds. We will take a look at a simplified version of #redux-toolkit's `createAction` function. 🧵👇pic.twitter.com/0pWmT8v88C

    interface PayloadAction<P, T = string> {
  type: T;
  payload: P;
}

type ActionCreator<P, T> = (payload: P) => PayloadAction<P, T>;

function createAction<P, T = string>(type: T): ActionCreator<P, T> {
  return (payload: P) => ({
    type,
    payload
  });
}
    11:08 - 14. sij 2020.
    • 13 proslijeđenih tweetova
    • 36 oznaka „sviđa mi se”
    • Barbara (kida)Regnizrek L. durap5 Nutti Saelor Raja Jaganathan Cédric De Loor sinchang Dalci Bagolin Joseph Curtis
    13 proslijeđenih tweetova 36 korisnika označava da im se sviđa
      1. Novi razgovor
      2. Lenz Weber‏ @phry 14. sij
        • Prijavi Tweet

        Here, we call this function three ways: 1. With explicit type arguments. Everything is fine. 2. With inferred type arguments. P cannot be inferred, because it does not relate to any method argument. 3. With one explicit type argument. But why is the second argument not inferred?pic.twitter.com/RUU42EpCmZ

        function createAction<P, T = string>(type: T): ActionCreator<P, T> {
  /* ... */
}

const type = "increment";

//  ActionCreator<number, "increment">
const incrementAction = createAction<number, "increment">(type);

// ActionCreator<unknown, "increment">
const actionCreator2 = createAction(type);

// ActionCreator<number, string>
const actionCreator3 = createAction<number>(type);
        1 reply 1 proslijeđeni tweet 3 korisnika označavaju da im se sviđa
        Prikaži ovu nit
      3. Lenz Weber‏ @phry 14. sij
        • Prijavi Tweet

        This is because #TypeScript cannot mix explicit and inferred type arguments. There is a PR for that at https://github.com/microsoft/TypeScript/pull/26349 …, but there is still discussion on what syntax to use. Let's just assume that this is impossible and try to work around it.

        0 proslijeđenih tweetova 1 korisnik označava da mu se sviđa
        Prikaži ovu nit
      4. Lenz Weber‏ @phry 14. sij
        • Prijavi Tweet

        One possible solution would be to wrap it in yet another function, let's call this "Type Argument Currying". Here `createAction` infers `T` and `withPayload` is called with `number` explicitly. But this requires a change in our existing runtime code, and it is a bit weird to use.pic.twitter.com/hCAHxBXic0

        function createAction<T = string>(type: T) {
  return function withPayload<P>(): ActionCreator<P, T> {
    return (payload: P) => ({
      type,
      payload
    });
  };
}

// ActionCreator<number, "increment">
const incrementAction = createAction("increment" as const)<number>();
        1 reply 1 proslijeđeni tweet 2 korisnika označavaju da im se sviđa
        Prikaži ovu nit
      5. Lenz Weber‏ @phry 14. sij
        • Prijavi Tweet

        So what did we do in #redux-toolkit? Actually, our `createAction` function can take an optional second `prepare` argument to modify the payload beforehand. Here we just create a helper fn that captures a type and returns a `prepare` function that just passes the payload through.pic.twitter.com/vjBGW8ssEd

        type PrepareAction<P> = (...args: any[] ) => { payload: P };

function createAction<P, T = string>(type: T, prepare?: PrepareAction<P>): ActionCreator<P, T> {
  return (payload: P) => ({
    type,
    payload
  });
}

function withPayloadType<T>() {
  return (t: T) => ({ payload: t });
}

const incrementAction = createAction("increment" as const, withPayloadType<number>());
        2 proslijeđena tweeta 5 korisnika označava da im se sviđa
        Prikaži ovu nit
      6. Lenz Weber‏ @phry 14. sij
        • Prijavi Tweet

        So, you now know two way to combine explicit and inferred type arguments - and that's it for today. Next week, you will learn how you can add restrictions to your type parameters. After all, right now you could pass any object as `T` parameter, and we don't want that.

        1 reply 1 proslijeđeni tweet 3 korisnika označavaju da im se sviđa
        Prikaži ovu nit
      7. Lenz Weber‏ @phry 21. sij
        • Prijavi Tweet

        Lenz Weber je proslijedio/a tweet korisnika/ceLenz Weber

        This is continued here:https://twitter.com/phry/status/1219701490530562049 …

        Lenz Weber je dodan/na,

        function createAction<P, T = string>(type: T, prepare?: PrepareAction<P>): ActionCreator<P, T> {
  return (payload: P) => ({
    type,
    payload
  });
}

//              this should not be possible
//                        v
// ActionCreator<number, Text>
const invalidAction = createAction(
  document.createTextNode("I really shouldn't be used as type!"),
  withPayloadType<number>()
);
        Lenz Weber @phry
        Last #TypeScriptTuesday, we left off with a version of #redux-toolkit's `createAction` method that could be used with a mix of inferred and explicit #TypeScript Generic Arguments. But that method would still take every `type` - including objects. Let's see how to restrict that. pic.twitter.com/MpcYAgzwYR
        Prikaži ovu nit
        0 replies 0 proslijeđenih tweetova 1 korisnik označava da mu se sviđa
        Prikaži ovu nit
      8. Kraj razgovora
      1. Novi razgovor
      2. Lars Röttig‏ @LarsRoettig 14. sij
        • Prijavi Tweet
        Odgovor korisniku/ci @phry

        @phry nice content why you don't publish it on a small blog post?

        1 reply 0 proslijeđenih tweetova 1 korisnik označava da mu se sviđa
      3. Lenz Weber‏ @phry 14. sij
        • Prijavi Tweet
        Odgovor korisniku/ci @LarsRoettig

        I might do a small blog post after each completed topic, but right now I like this format. There's no "changing the medium", so more people see the actual contents and the restrictions of tweets make it quite interesting as I have to think about what I *really* want to talk about

        0 replies 0 proslijeđenih tweetova 3 korisnika označavaju da im se sviđa
      4. Kraj razgovora

    Čini se da učitavanje traje već neko vrijeme.

    Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.

      Sponzorirani tweet

      false

      • © 2020 Twitter
      • O Twitteru
      • Centar za pomoć
      • Uvjeti
      • Pravila o privatnosti
      • Imprint
      • Kolačići
      • Informacije o oglasima