Skip to content

Instantly share code, notes, and snippets.

View next.tsx
import { animation, Button, Card, Geometry, Row, Title, View } from '@o/ui'
import React from 'react'
export const TestCarousel = () => {
const apps = [{ title: 'ok' }, { title: 'ok2' }, { title: 'ok3' }, { title: 'o4' }]
const carousel = animation(() => ({
scrollLeft: 0,
zoomed: false,
View now.tsx
import { always, AppDefinition, AppIcon, createUsableStore, ensure, getAppDefinition, react, shallow, Templates, useReaction } from '@o/kit'
import { AppBit } from '@o/models'
import { Card, CardProps, fuzzyFilter, idFn, Row, useIntersectionObserver, useNodeSize, useParentNodeSize, useTheme, View } from '@o/ui'
import { numberBounder, numberScaler } from '@o/utils'
import React, { createRef, memo, useEffect, useLayoutEffect, useRef, useState } from 'react'
import { to, useSpring, useSprings } from 'react-spring'
import { useGesture } from 'react-use-gesture'
import { om, useOm } from '../../om/om'
import { queryStore } from '../../om/stores'
natew / example.tsx
Created Mar 8, 2019
tree list example
View example.tsx
import { ensure, useReaction } from '@mcro/use-store'
import { getTargetValue, List, searchBits, TreeList, useTreeList } from '@o/kit'
import { Button, InputRow, Panel, preventDefault, useToggle, View } from '@o/ui'
import { flow } from 'lodash'
import React, { useState } from 'react'
export function ListsAppIndex() {
const treeList = useTreeList('list')
const [addQuery, setAddQuery] = useState('')
const [showSearch, toggleShowSearch] = useToggle(false)
View gist:e68de34e98543bb06112e27190963f71
This file has been truncated, but you can view the full file.
➜ orbit-app git:(nate/dev) ✗ PUNDLE=true npm start
> @mcro/orbit-app@2.2.1 start /Users/nw/projects/motion/orbit/app/orbit-app
> ./scripts/
Process on port 3002 killed
start w pundle
Starting Dev Server at http://localhost:3002/ (with resetted cache)
Static mappings:
View debug-puppeteer.js
import r2 from '@mcro/r2'
import puppeteer from 'puppeteer'
import * as _ from 'lodash'
const sleep = ms => new Promise(res => setTimeout(res, ms))
const onFocus = page => {
return page.evaluate(() => {
return new Promise(res => {
if (document.hasFocus()) {
View cloudSettings
View parallax.js
import React from 'react'
import PropTypes from 'prop-types'
import {
} from 'react-spring'
import * as _ from 'lodash'
View react-spring-parallax-with-effects.js
import React from 'react'
import PropTypes from 'prop-types'
import {
} from 'react-spring'
View gist:6f268b8d3deef803e0e2b19ec6f20ce8
User.homeDocument.getChildrenStream().subscribe(x => console.log('done', x))
Processing: i5557z2caw:1500447342160
Subscriber {closed: false, _parent: null, _parents: null, _subscriptions: Array(1), syncErrorValue: null…}
documents: i5557z2caw:1500447342160 (7) [RxDocument, RxDocument, RxDocument, RxDocument, RxDocument, RxDocument, RxDocument]
Getting childs for: 06hfxakxcy:1500516727785
Processing: 06hfxakxcy:1500516727785
Getting childs for: 1btrmkd5qz:1500518892760
Processing: 1btrmkd5qz:1500518892760
Getting childs for: 4cx050ynfd:1500516607679
Processing: 4cx050ynfd:1500516607679
View extractstatics.js
import state from '../state'
import { t, options, exprStatement, nodeToStr } from './helpers'
import hash from 'hash-sum'
// splits styles into static/dynamic pieces
export function extractAndAssign(node, file) {
// if array of objects
if (t.isArrayExpression(node.right)) {
return getArrayStatics(node, file)