Skip to content

Instantly share code, notes, and snippets.

{
"header": {
"Variant": "truefox",
"Generator": "KIICONF 0.2",
"Base": "TheTrueFoxBase",
"Date": "2016-05-30",
"KLL": "0.3c",
"Author": "Fabiano Taioli",
"Version": "0.2",
"Name": "WhiteFox",
@FbN
FbN / mm-mm.js
Last active April 28, 2019 16:01
mm function
// I: Immutable js library
// M: Most js
// m: Mithril
import { m, I, M } from './vendor.mjs'
export { mm, adapters, route }
// ...
// Function that generate mithril components based on most streams
// initialState: Map of initial state. Streams returned by VM will be matched by name to update this keys values.
@FbN
FbN / mm-item.js
Created April 28, 2019 15:32
Item VM
// m: Mithril lib
// M: Most Core lib
import { m, M } from '../vendor.mjs'
// T: Triggers imported from High-Leve model Todo
// $list: Stream imported from High-Leve model Todo
import { T as TodoT, $list, enter, esc } from '../model/todo.mjs'
// Utility function to generate many streams/triggers
import { adapters } from '../mm.mjs'
@FbN
FbN / mm-item-view.js
Created April 28, 2019 15:47
Item View
// m: Mithril lib
import { m } from '../vendor.mjs'
export default function itemView (
/* Immutable component state */
{ item, editing, editingText },
/* Trigger functions returned by Item VM */
{
_$keyup,
_$input,
@FbN
FbN / mm-components.js
Created April 28, 2019 15:52
Components Declaration
// m: Mithril lib
// I: Immutable JS
// M: Most Core
import { m, I, M } from './vendor.mjs'
// Function to generate mithril component with stream integration
import { mm } from './mm.mjs'
// We import component View e VM
import mainView from './view/main.mjs'
import React from 'react'
import ReactDOM from 'react-dom'
@FbN
FbN / package.json
Created July 9, 2019 14:12
package-part.json
{
"webmodules": {
"webDependencies": [
"@es/react",
"@es/react-dom"
]
}
@FbN
FbN / index.html
Created July 9, 2019 14:37
HTML Import Map Sample
<script type="importmap">
{
"imports": {
"react": "/web_modules/@es/react.js",
"react-dom": "/web_modules/@es/react-dom.js"
}
}
</script>
@FbN
FbN / serve.js
Last active July 9, 2019 14:43
Browsersync config
const browserSyncFactory = require('browser-sync')
const history = require('connect-history-api-fallback')
const babel = require("@babel/core")
const fs = require('fs')
const browserSync = browserSyncFactory.create()
browserSync.watch('app/**/*').on("change", browserSync.reload)
browserSync.watch('.tmp/**/*').on("change", browserSync.reload)
browserSync.watch('views/*.jsx', function (event, file) {
@FbN
FbN / package.json
Created July 9, 2019 15:26
@es React package.json
{
"name": "@es/react",
"version": "1.0.0",
"description": "",
"license": "UNLICENSED",
"module": "index.js",
"dependencies": {
"react": "*"
}
}