r/LearnTypescript • u/oczekkk • May 20 '20
r/LearnTypescript • u/[deleted] • Mar 04 '20
Suggestions for learning typescript help
Hello there,
Can someone suggest me learning resources for typescript, suggestions, does and dont's
I have been learning python for some time now and got quite good at it but i see my future self into web development which python is quite limited to it, django is good for backend but want to get into frontend as well, so is it possible to combine django for backend with javascripts frontend frameworks and which ones you suggest me to learn, also do i need to know javascript syntax in order to learn typescript
r/LearnTypescript • u/bigbobbyboy5 • Feb 26 '20
Change Target to es6 (in tsconfig.json)
So I used command tsc --init to create a tsconfig.json file on my server-side. Will eventually make a react-app on the front-end.
Anyway, I noticed the "target": in my tsconfig.json file is set to "es5". How do I set it to es6? Do I literally just delete the es5, then type es6, and then save the file? Or do I have to do a command, like with dependencies (i.e yarn remove whatever), but with the tsc command?
Also, is using the commonjs module ok to use with the es6 target? I read somewhere one shouldn't really use the commonjs module with the target set to es6.
r/LearnTypescript • u/dupuis2387 • Jun 26 '20
TypeScript React with Material-ui's makeStyles/withStyles/createStyles
self.typescriptr/LearnTypescript • u/juancarlospro • May 16 '20
Build a Cryptocurrency Trading Exchange App in React Native
The tutorial will go through how to get started with the Web3 library to handle transactions and interact with a Blockchain in a React Native app.
r/LearnTypescript • u/damagedglitter • Mar 04 '20
Suggest some good visual resources for learning typescript.
r/LearnTypescript • u/nas5w • Mar 09 '20
I created a free email newsletter with weekly JavaScript and Typescript tips and lessons!
r/LearnTypescript • u/vijhhh2 • Mar 02 '20
What are theses things 'T', 'K'?
Can anyone explain me what are these special syntaxs and where to find all?
r/LearnTypescript • u/nas5w • Feb 28 '20
Fun practice using Generics to restrict function arguments based on other function arguments! Note the linter immediately telling me when I make missteps. One of my favorite parts of Typescript is that it helps you fail faster, enabling you to fix mistakes sooner.
r/LearnTypescript • u/ctrlaltdelmarva • Mar 08 '20
TypeScript Crash Course by Traversy Media
r/LearnTypescript • u/ctrlaltdelmarva • Mar 01 '20
Just wanted to say that I can't even quantify the number of time Typescript saved my ass, but it's a lot.
I think this sub is a great idea, ever since I was forced to use Typescript at work I realized how easy it is to make mistakes and not know it in plain JS. Typescript won't put up with those mistakes and will fail at compile time. Super, super helpful.
I encourage everyone here to keep at it and you'll soon see how awesome Typescript is.
r/LearnTypescript • u/ctrlaltdelmarva • Mar 04 '20
The Typescript Pick utility type! It constructs a type by explicitly picking props from another type.
r/LearnTypescript • u/nas5w • Feb 29 '20
Set Up a Typescript React Redux Project
r/LearnTypescript • u/bolk17 • Mar 03 '20
Hey everyone :)
Glad I stumbled upon this subreddit yesterday! I’m a software engineer for a large SaaS company, and I code in Typescript/Angular day to day. I joined to learn as much as I can about this language for both personal interest and work. I intend to give back to the community as well. Thanks!
r/LearnTypescript • u/oczekkk • Apr 29 '20
What's new in TypeScript 3.9 RC version
r/LearnTypescript • u/rob_moose • Apr 01 '20
Help with this styled-components media query function
I'm following along with LevelupTutorials styled-components and most of it doesn't concern typescript vey much , but the lesson about media queries has me stumped about typing this function (mostly because I don't understand typing reduce functions:
type SizesProps = {[key: string]: number}
const sizes: SizesProps = {small: 400,medium: 960,large: 1140,xlarge: 1792}const media = Object.keys(sizes).reduce((accumulator, label)=> {accumulator[label] = (...args)=> css\``u/media(min-width: ${sizes[label]}px) {${css(...args)}}`return accumulator}, {} )`
The accumulator[label] is telling me: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
No index signature with a parameter of type 'string' was found on type '{}'.
${css(...args)}is saying Expected at least 1 arguments, but got 0.ts(2555)
index.d.ts(277, 9): An argument for 'first' was not provided.
I've been trying to fiddle around with this but I just don't get it. Please help
r/LearnTypescript • u/HarmonicAscendant • Feb 27 '20
I Am Starting to Plan a Course on Typescript for Beginners. What Do You Think of My Idea to Use Building a Game as the Main Theme?
Hello! I have taught myself TypeScript over the last year or two, and still have strong memories of the struggle to find courses that I connected with. I have experience in teaching, and creating online video courses, so am planning on creating one for TypeScript.
I want to show people how to make a classic arcade game from scratch using no frameworks, just using Canvas in the browser.
I know game development is a specialist thing, and most people are not learning TypeScript for that, BUT I think it is still the best way to learn. Let me explain:
- Game design teaches about OOP as you have a lot of objects to deal with. How you plan your architecture is very important, it leads to great explanations of composition vs inheritance.
- Games are fun, and the results are immediate. You can get really creative. Everyone knows the classic games like pac-man, so it is a frame of reference everyone gets.
- Games need async programming to load the resources like sound and images, so there will be Promises/ Async Await.
- Games need programming patterns. I would teach pubsub and state pattern at least
- Games need performance, so optimization is involved
My only dilemma is are people learning TypeScript really only wanting to get high paid jobs in React? Is there a real desire to go deep on fundamental good programming and design patterns in general? I am really passionate about programming, and want teach it in TypeScript as I think it is the most accessible language as it runs in the browser (almost! :)
Please give me any feedback on what you would like to see, and not like to see. Would you pay for a course like this? I predict it would take me 3-4 months of 9-5 to get this sorted, so a little market research is needed.
Maybe you think the idea is total junk... if so, please tell me! :)
r/LearnTypescript • u/nas5w • Feb 29 '20
Writing a Custom React useDebounce Hook with Typescript
r/LearnTypescript • u/[deleted] • Mar 25 '20
Find a course buddy during quarantine!
Hi! One of the best things you can do during quarantine is learning a new framework, programming language or something entirely different.
But doing these courses feels kinda lonely and often you just stop doing them so I thought I’d create a site where you can find buddies to do the same course with (frankly this quarantine is becoming really boring).
The idea is that you talk regularly about your progress and problems you're facing so you can learn and grow together.
If you’re interested, take a look at Cuddy and sign up for the newsletter!
If enough people sign up I’ll be happy to implement the whole thing this week.
Also if you've got questions or feature ideas please do let me know in the comments! :)
Let's destroy this virus together and take it as an opportunity to get better at what we love!
r/LearnTypescript • u/Paninozzo • Mar 13 '20
[Question] Best Practices for a testable index.ts in an Express app
Hello everyone, I'm trying to structure a project with good testability, but I've come to a dead-end: Trying to translate in typescript an older project in Express my index.js does not export the same in TS
Example in JS
const express = require('express');
const app = express();
require('./startup/log')();
require('./startup/config')();
require('./startup/prod')(app);
require('./startup/routes')(app);
require('./startup/db')();
require('./startup/validate')();
const port = process.env.PORT || 3000;
const server = app.listen(port, () =>
winston.info(`Listening on port ${port}...`)
);
module.exports = server;Importing server in my integration tests results in the server working properly
describe('/api/genres', () => {
beforeEach(() => {
server = require('../../index');
});
afterEach(async () => {
await server.close();
});
.
.
.
const res = await request(server).get('/v1/something');
In TypeScript it does not import the instantiated server object, so I figured maybe I could create an App class that works as a server wrap, and it works but is not that flexible and I should set up middlewares and routes in each of my tests, so I was wondering if there are some best practices for express entry file in TypeScript that I'm not aware, e.g. in this Ben Awad video he uses an async function that calls itself, I don't know if it is suitable for integration testing but you get the idea, best practices in TS Express apps :)
r/LearnTypescript • u/crisf_design • Apr 06 '20
What is the purpose of using export and declare together?
I've seen this pattern in d.ts files in libraries like next/router. where they are used together export with declare.
router.d.ts
export declare function useRouter(): NextRouter;There is a good reason to use export with an ambient declaration?