abstract class BaseError {
private final String message;
public BaseError(String message) { this.message = message; }
public String getMessage() { return this.message; }
}
async function loadArticle(articleId) { /* ... */ } | |
async function loadComments(articleId) { /* ... */ } | |
async function Page( {articleId} ) { | |
// Beide Requests starten parallel | |
const articlePromise = loadArticle(articleId); | |
const commentsPromise = loadComments(articleId); | |
return <React.Suspense fallback={<h1>Please wait, data is loading</h1>}> |
export default undefined; | |
type Container<T> = { | |
consume: (arg: T) => void; | |
}; | |
// string ist super-type von "hello" 😳 | |
// Entspricht in C# sowas hier: | |
// public class Event { } // => string | |
// public class MouseEvent : Event { } // => "hello" | |
type StringType = string; |
package nh.publy.backend.util; | |
import graphql.ExecutionResult; | |
import graphql.ExecutionResultImpl; | |
import graphql.execution.instrumentation.InstrumentationContext; | |
import graphql.execution.instrumentation.InstrumentationState; | |
import graphql.execution.instrumentation.SimpleInstrumentation; | |
import graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters; | |
import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters; | |
import graphql.schema.GraphQLFieldDefinition; |
Versuche einen Query auszuführen, der die ersten zehn Stories zurückliefert, und folgende Felder abfragt:
Id, Titel, Excerpt, Veröffentlichungsdatum, Wer hat die Story geschrieben und die jeweils ersten zehn Kommentare
query {
stories(first: 10) {
nodes {
id
title
#! /bin/zsh | |
#xcode-select --install | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
I recently (october 2020) evaluated MobX for a project as alternative to Redux (Redux Toolkit).
You can find my very subjective impressions below.
Redux DevTools better than MobX (for me they were more helpful when finding bugs)
Redux is more widely used than MobX
Change/Dependency tracking in MobX is powerful but not always obvious how it works (both behind the scene and in my application). If values didn't update where I expected it, finding the bug sometimes was hard
A Redux-based application holds a forest-like data structure, like Folders and Documents in a file system, but with many root Folders, like this:
In a React Component, DocumentList we display all Documents (all leafs of all trees) and when clicking on one Document, we need access to the Document's root (Folder) object (to read some information from it)
My very subjective impressions and opinions about VS Code and IntelliJ mainly for TypeScript development.
Note 1: This is not an objective comparison, just a list of points that I noticed when working with the two tools, and which I liked better or worse in each case.
Note 2: For IntelliJ, I used IntelliJ Ultimate Edition 2020.3
Note 3: I have used VS Code for TypeScript much longer than IntellIJ so also for this reason, this is not a "fair" comparison, because many things will turn out only in the long run, if good or bad
Note 4: many/some of the differences maybe could be adjusted by changing settings and/or keyboard shortcuts. And of course by learning the tools better.