frontend-fun / react-hooks-typescript-tome Goto Github PK
View Code? Open in Web Editor NEWTome walking you through React Hooks+TypeScript frontend web development
License: Apache License 2.0
Tome walking you through React Hooks+TypeScript frontend web development
License: Apache License 2.0
It'd be cool to emulate the real console log and render interactive as arrays, objects, etc.
in functions code, 'fahrenheitToCelius' should be 'fahrenheitToCelsius'.
/**
C = (F - 32) * 5/9
*/
export function fahrenheitToCelius(temperature: number): number {
return ((temperature - 32) * 5) / 9;
}
Our runnable code snippets translate TS to JS and execute it, but dont actually run any kind of type checking.
Turns out this is hard.
Almost certainly at that point we should use some other service that has more sophisticated support.
Just in case people want to know more about this
There is no real sandboxing in the runnable code. It's all just the big global namespace.
Basic support wouldn't be impossible, but handling all the features might be a bit much. Have to do some research on the whole API.
It'd be very convenient to provide "setup" code for examples. This could be to define interfaces or test data.
Students are requesting a dark mode, so I spent a little time looking into it.
The just-the-docs
theme we are using DOES have a switchable dark mode. In theory, you'd just want to add some code like this:
mode = localStorage.getItem("mode") || "light";
jtd.setTheme(mode);
And then have a button somewhere hovering around that would run:
const newMode = mode === "light" ? "dark" : "light";
localStorage.setItem("mode", newMode);
jtd.setTheme(newMode);
However, currently, the dark mode site looks terrible because of the Bootstrap and Ace Editor CSS rules. I believe that the simple solution is to move the Bootstrap rules to be before anything else. However, I'm not sure there's an easy solution when it comes to the Ace Editor stuff (I was never happy with having to use Ace, but whatever). Someone probably needs to play with it and add custom scheme rules instead of just using the just-the-doc
's default dark theme, to change how Ace looks.
Could do this manually, but should be doable automatically?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.