Classes and Patterns

Type classes and patterns: generic stacks and caches, observables, commands, plugins, builders and dependency injection.

  1. 01

    Write a Generic Stack Class

    • easy
    • Code
  2. 02

    Write a Typed Observable Subject

    • easy
    • Code
  3. 03

    Share Behaviour Through an Abstract Class

    • easy
    • Code
  4. 04

    Guard a Balance with a Private Field

    • easy
    • Code
  5. 05

    Make a Class Iterable with Symbol.iterator

    • easy
    • Code
  6. 06

    Build a Typed LRU Cache Class

    • medium
    • Code
  7. 07

    Expire Cache Entries with an Injected Clock

    • medium
    • Code
  8. 08

    Write a Priority Queue Class with a Comparator

    • medium
    • Code
  9. 09

    Run and Undo Typed Commands

    • medium
    • Code
  10. 10

    Chain Results with Ok and Err Classes

    • medium
    • Code
  11. 11

    Look Up Plugins by Name, Fully Typed

    • medium
    • Code
  12. 12

    Subscribe to a Typed Slice of a Store

    • medium
    • Code
    • Pro
  13. 13

    Make a Builder That Can't Build Too Early

    • hard
    • Code
    • Pro
  14. 14

    Resolve Typed Services from a DI Container

    • hard
    • Code
    • Pro
  15. 15

    Type a State Machine Class from Its Table

    • hard
    • Code
    • Pro