This document is an attempt to pin down all the things you don't think about when quoting for a project, and hopefully provide a starting point for some kind of framework to make quoting, working and delivering small-medium jobs more predictable and less stressful.
We've been deadlocked for a while on the pipeline operator proposal, for a few reasons. Partially it's just low implementor interest, as this is fundamentally just syntactic sugar, but also because there are three competing proposals and the proponents of each haven't been convinced by the others yet.
In this essay I hope to briefly outline the problem space, summarize the three proposals, and talk about what's gained/lost by each of them. (Spoiler: they're all nearly identical; we're arguing over very small potatoes.)
It is largely inspired by kscript. The idea is to leverage the scripting abilities of javascript using Deno. I feel that scripting can be so much fun with Deno
as:
- It can import modules from any location on the web,
- It is secure by default. Imported module can run in sandbox.
- It is Supports TypeScript out of the box.
- It is much more that
Node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Stream } from 'most'; | |
import * as most from 'most'; | |
type Maybe<T> = null | T | |
type Position = [number, number] | |
export function dragPositionStream( | |
touchStart$: Stream<TouchEvent>, | |
touchMove$: Stream<TouchEvent>, | |
touchEnd$: Stream<TouchEvent> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { render } from "react-dom"; | |
import Task from "data.task"; | |
import TaskComponent from "./TaskComponent"; | |
const users = [ | |
{ id: 1, name: "User A", points: 45 }, | |
{ id: 2, name: "User B", points: 22 }, | |
{ id: 3, name: "User C", points: 79 }, | |
{ id: 4, name: "User D", points: 54 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const wait = ( | |
time, | |
cancel = Promise.reject() | |
) => new Promise((resolve, reject) => { | |
const timer = setTimeout(resolve, time); | |
const noop = () => {}; | |
cancel.then(() => { | |
clearTimeout(timer); | |
reject(new Error('Cancelled')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var StaticSiteGeneratorPlugin = require('static-site-generator-webpack-plugin') | |
var ExtractTextPlugin = require('extract-text-webpack-plugin') | |
var webpack = require('webpack'); | |
var urlloader = require('url-loader'); | |
var React = require("react"); | |
var ReactDom = require("react-dom"); | |
var Redux = require("redux"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generic helper function that takes a main() (the top-level component) | |
// and wraps it with Stanga logic | |
function wrapWithStanga(main, initialState) { | |
return function (sources) { | |
const modProxy$ = new Subject(); | |
const modelSource = Model(initialState)(modProxy$); | |
sources.model = modelSource; | |
const sinks = main(sources); | |
sinks.model.subscribe(modProxy$); |
NewerOlder