var a = 3;
print("$a 123");
print("${a+1} 123");
const jsdom = require("jsdom"); | |
const { JSDOM } = jsdom; | |
const fs = require("fs"); | |
const files = [ | |
"202012.html", | |
"202111.html", | |
"202112.html", | |
"202201.html", | |
"202202.html", |
import GlobalSpinner from '@/components/GlobalSpinner' | |
import { contextFactory } from './helpers/contextFactory' | |
import { useToggleState } from '@/hooks/useToggleState' | |
type GlobalSpinnerContextProviderProps = { | |
children: React.ReactNode | |
} | |
const GlobalSpinnerContextProvider = ( | |
props: GlobalSpinnerContextProviderProps |
import { createContext, useContext } from 'react' | |
export const contextFactory = <A extends unknown | null>() => { | |
const context = createContext<A | undefined>(undefined) | |
const useCtx = () => { | |
const ctx = useContext(context) | |
if (ctx === undefined) { | |
throw new Error('useContext must be used inside of a Provider with a value.') | |
} | |
return ctx |
import { FunctionComponent } from "react"; | |
import styled, { keyframes, css } from "styled-components"; | |
const SkeletonLoader: FunctionComponent<{ | |
isLoading?: boolean; | |
}> = (props) => { | |
return ( | |
<Content isLoading={props.isLoading}> | |
{props.isLoading && <Loader />} | |
{props.children} |
// use after view has been layout | |
extension UIView | |
{ | |
// different inner shadow styles | |
public enum innerShadowSide | |
{ | |
case all, left, right, top, bottom, topAndLeft, topAndRight, bottomAndLeft, bottomAndRight, exceptLeft, exceptRight, exceptTop, exceptBottom | |
} | |
class GradientView: UIView { | |
var gradientLayer: CAGradientLayer { | |
return layer as! CAGradientLayer | |
} | |
override class var layerClass: AnyClass { | |
return CAGradientLayer.self | |
} | |
} |
import UIKit | |
class ViewController: UIViewController { | |
var textField: UITextField! | |
var textView: UITextView! | |
private let maxLength = 20 | |
override func viewDidLoad() { | |
super.viewDidLoad() |
https://academy.realm.io/posts/krzysztof-siejkowski-mobilization-2017-rxswift-deep-cuts/ https://www.polidea.com/blog/8-Mistakes-to-Avoid-while-Using-RxSwiftPart-1/
Judging by the number of talks, articles and discussions related to reactive programming in Swift in general and the RxSwift library in particular, it looks like the community has been taken by the storm. The concept of reactiveness, however, is not a new shiny thing. The idea of using it for the development within the Apple ecosystem had been played with for a long time. Frameworks like ReactiveCocoa had existed for years and did an awesome job at bringing the reactive programming to the Objective-C. When Swift appeared with its new and exciting features, the way was paved for RxSwift, the elegant and compact port of C#-originated Reactive Extensions. It became even more convenient to go full in on the “signals as your apps’ building blocks” model.