為了能讓大家能夠順利的建立起 Angular 18 開發環境,以下是需要安裝的相關軟體與安裝步驟與說明。
- Windows 10 以上版本
- Mac OS X 10.6 以上版本
| // Author: Sokdara Cheng | |
| // Contact me for web or mobile app development using React or React Native | |
| // https://chengsokdara.github.io | |
| import React, { createContext, useContext, useReducer } from "react"; | |
| import initialState from "./initialState"; // object of initial states | |
| import reducer from "./reducer"; // https://reactjs.org/docs/hooks-reference.html#usereducer | |
| const Store = createContext({ | |
| dispatch: () => null, | |
| state: initialState, | |
| }); |
| // for multiple requests | |
| let isRefreshing = false; | |
| let failedQueue = []; | |
| const processQueue = (error, token = null) => { | |
| failedQueue.forEach(prom => { | |
| if (error) { | |
| prom.reject(error); | |
| } else { | |
| prom.resolve(token); |
| const WsStateDisconnected = 0; | |
| const WsStateDisconnecting = 1; | |
| const WsStateConnected = 2; | |
| const WsStateConnecting = 3; | |
| class SimpleWSocket { | |
| constructor(url) { | |
| this.wsState = WsStateDisconnected; | |
| this.timer = null; | |
| this.url = url; | |
| this.ws = null; |
為了能讓大家能在課堂上順利地進行實作,請先將需要的軟體全部安裝好,以下是安裝的相關軟體與安裝步驟與說明。
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
| # first: | |
| lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
| sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
| # To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
| # go to /usr/local/lib and delete any node and node_modules | |
| cd /usr/local/lib | |
| sudo rm -rf node* |
These rules are adopted from the AngularJS commit conventions.
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com, example2.com, and example1.com/images on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers