First create the NX workspace and the initial application named search
:
npx create-nx-workspace@latest ang-pokemon-mfe
Set it up as angular, with the name search
and SCSS for the styling:
First create the NX workspace and the initial application named search
:
npx create-nx-workspace@latest ang-pokemon-mfe
Set it up as angular, with the name search
and SCSS for the styling:
const delay = <T>(time: number, data: T): Promise<T> => | |
new Promise((resolve) => | |
setTimeout(() => { | |
resolve(data); | |
}, time) | |
); | |
class Users { | |
async getUsers() { | |
return await delay(1000, []); |
class EventProcessor { | |
handleEvent(eventName: ..., data: ...): void { | |
} | |
addHandler(handler: ...) { | |
} | |
getProcessedEvents(): ...[] { | |
} | |
} |
[ | |
{ "name": "Atreides", "planets": "Calladan" }, | |
{ "name": "Corrino", "planets": ["Kaitan", "Salusa Secundus"] }, | |
{ "name": "Harkonnen", "planets": ["Giedi Prime", "Arrakis"] } | |
] |
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
// Generic print function that takes an output stream. | |
// Can be used to print to the screen by passing cout. | |
// Can be used to print to a file by passing a file stream. | |
void printSomething(ostream &out, string somethingToSay) { | |
out << "Something cool:" << somethingToSay << endl; |
import { atom, WritableAtom } from "jotai"; | |
import firebase from "firebase"; | |
function atomWithCollection<TData>( | |
collection: firebase.firestore.CollectionReference | |
): WritableAtom< | |
TData[], | |
{ | |
id: string; | |
data: TData; |
import { Component } from "react"; | |
import { | |
ChakraProvider, | |
Heading, | |
Box, | |
Text, | |
Grid, | |
Image, | |
} from "@chakra-ui/react"; |
#include <random> | |
#include <iostream> | |
#include <sstream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int rollDice(int top) { | |
return (rand() % top) + 1; |
#include <iostream> | |
#include <list> | |
using namespace std; | |
int getValue(int index) { | |
int guessValue = 0; | |
/* | |
while (guessValue < 1 || guessValue > 100) { | |
cout << "Guess #" << index + 1 << ": "; |
/* | |
Make a simple text game that has: | |
[X] Has a design using a flowchart | |
[X] Uses deeply nested conditionals | |
[X] Handles edge cases | |
[X] Uses variables with a variety of the basic data types (string, bool, int, long, float, double) | |
[X] Uses random | |
[X] Uses a mathematical operator | |
[X] No gotos or globals |