DEV Community

swyx
swyx

Posted on • Edited on • Originally published at dev.to

Make your own Dev.to CMS livestream - Part 3

This is day 3 of my livecode Dev.to CMS.

Source: https://github.com/sw-yx/dev-to-cms
Demo: https://dev-to-cms.now.sh

Things covered

Video

Here is the YouTube livestream (3 hours).

Dev.To embed:

Today we refactored the editor to a standalone component, and then added the ability to edit posts! It now works

We methodically worked thru all issues:

  • splitting out an editor component
  • creating api endpoint to fetch (GET) a single existing article
    • this later required fetching unpublished articles as well
  • creating api endpoint to update (PUT) a single existing article
  • wiring it up to the Dashboard (list of articles) and to existing editor pages.

Catch up on the Dev.to CMS LiveStream!

Top comments (0)

typescript

11 Tips That Make You a Better Typescript Programmer

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay