HackerTrans
TopNewTrendsCommentsPastAskShowJobs

DrakeDeaton

no profile record

comments

DrakeDeaton
·8 ay önce·discuss
100% if you want composability go with a battle tested solution! That code really just demos how simple working the Result pattern can be.
DrakeDeaton
·9 ay önce·discuss
There's certainly situations where this pattern creates some tricky ambiguity, but more often than not Result is quite an ergonomic pattern to work with.

In case it's useful for anyone, here is a simple plug-in-play TypeScript version:

```

type Ok<T = void> = T extends undefined ? { ok: true; } : { ok: true; val: T; };

type Err<E extends ResultError = ResultError> = { ok: false; err: E; };

type Result<T = void, E = ResultError> = { ok: true; val: T; } | { ok: false; err: E | ResultError; };

class ResultError extends Error { override name = "ResultError" as const; context?: unknown; constructor (message: string, context?: unknown) { super(message); this.context = context; } }

const ok = <T = void>(val?: T): Ok<T> => ({ ok: true, val: val, } as Ok<T>);

const err = (errType: string, context: unknown = {}): Err<ResultError> => ({ err: new ResultError(errType, context), ok: false, });

```

```

const actionTaker = await op().then(ok).catch(err);

if (result.ok) // handle error

else // use result

```

I will be forever grateful to the developer first introduced to this pattern!
DrakeDeaton
·geçen yıl·discuss
Part of the thinking behind the Barbican's somewhat hidden entrances to the estate and tts maze-like layout was that they would reduce foot traffic, and it totally worked. Not many people use the public estate high-walks as a shortcut to get across the City. This has a wonderful effect wherein you're surrounded by the hustle and bustle of the City, while being just a touch insulated from it.

I lived there for the better part of a year and it completely changed my perspective on living in London. More city-life should be like the Barbican.
DrakeDeaton
·geçen yıl·discuss
Not sure if you're aware, but if you're interested in SEO/AEO marketing, there's very healthy monthly traffic for long-tail searches in this area. Some searches getting towards 100K per month.

Love the idea! Good luck.
DrakeDeaton
·2 yıl önce·discuss
looks cool, shareable emulators would be very useful for me. are you planning on supporting capacitor apps?
DrakeDeaton
·2 yıl önce·discuss
So the middle ages too had Doordash.
DrakeDeaton
·2 yıl önce·discuss
love the idea. hesitant to pay as I don't know if the product is for me. native english speaker. always interested in expanding my vocabulary and a tool that helps me do so using spaced repetition would be quite useful.