Skip to content

Refactor #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c7ada3c
transition repo to multi workspace setup; prototype watch mode --watch
Davidiusdadi Apr 4, 2024
5bc55f7
bootstrap canvas-dev-server
Davidiusdadi Apr 4, 2024
4fef30b
improve dev-server md-rendering
Davidiusdadi Apr 4, 2024
207adbe
canvas-dev-server: display arrows
Davidiusdadi Apr 4, 2024
c176755
canvas-dev-server: add coloration
Davidiusdadi Apr 4, 2024
962c4a8
start building dev-server inspection features
Davidiusdadi Apr 5, 2024
6812ca2
prototype inspection
Davidiusdadi Apr 7, 2024
3a6ceda
minor inspection related refactor
Davidiusdadi Apr 8, 2024
e9d112f
init tests and github workflow
Davidiusdadi Apr 22, 2024
0520c15
fix tests
Davidiusdadi Apr 22, 2024
52312a8
prototype / refactor
Davidiusdadi Apr 22, 2024
30a5a37
add bun run build:lib to the github workflow
Davidiusdadi Apr 23, 2024
f98b7b3
fix OPENAI_API_KEY being mandatory
Davidiusdadi Apr 23, 2024
c7a2ebc
impl. engine retuning last return_value and last_ctx
Davidiusdadi Apr 23, 2024
61ba9bb
add example.env
Davidiusdadi Apr 23, 2024
dfc360b
add some chalk nunjuck filters
Davidiusdadi Apr 25, 2024
2f08c84
impl. chart node overloading and minor changes
Davidiusdadi Apr 25, 2024
440fff0
update examples / feature-tour
Davidiusdadi Apr 25, 2024
f8d9206
add canvas-ui electron project
Davidiusdadi Apr 26, 2024
0af50d0
make canvas-dev-server support multi-view
Davidiusdadi Apr 26, 2024
894b42f
early WIP experiments
Davidiusdadi Apr 26, 2024
201a169
big update to core and build-in nodes
Davidiusdadi Apr 28, 2024
30772c7
update feature tour
Davidiusdadi Apr 28, 2024
4ee6bcf
fix question magic word node
Davidiusdadi May 1, 2024
3946287
impl. llm stop param being enforced
Davidiusdadi May 1, 2024
0fcf572
update examples
Davidiusdadi May 1, 2024
d3f58df
fix dev-server group render
Davidiusdadi May 1, 2024
d358843
update NodeCompiler compile signature
Davidiusdadi May 1, 2024
4f9772c
fix injection feature adding attributes of `onode.fn` instead of `onode`
Davidiusdadi May 1, 2024
70f9d0d
refactor and impl. hot reloading
Davidiusdadi May 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .env.exampe
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# this one is only need if you do not use openai as a provider
LLM_PROVIDER=OPENAI

OPENAI_API_KEY=
OPENAI_API_MODEL=gpt-3.5-turbo
OPENAI_BASE_URL=https://api.openai.com/v1

OLLAMA_API_KEY=none
OLLAMA_API_MODEL=phi3
OLLAMA_BASE_URL=http://127.0.0.1:11434/v1

GROQ_API_KEY=
GROQ_API_MODEL=gemma-7b-it
GROQ_BASE_URL=https://api.groq.com/openai/v1

MISTRAL_API_KEY=
MISTRAL_API_MODEL=mistral-medium
MISTRAL_BASE_URL=https://api.mistral.ai/v1



ANTROPIC=
ANTROPIC_API_MODEL=antropic-ai-7b
ANTROPIC_BASE_URL=https://api.antropic.com/v1
27 changes: 27 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Yarn Test

on:
push:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4
- name: setup bun
uses: oven-sh/setup-bun@v1
- name: install dependencies
run: bun install
- name: run tests
run: |
cd packages/canvas-engine
bun test
- name: test build
run: |
cd packages/canvas-engine
bun run build:lib
180 changes: 178 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,180 @@
node_modules
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store

build
local
.env
old
.obsidian
Binary file added bun.lockb
Binary file not shown.
37 changes: 37 additions & 0 deletions examples/feature-tour/1-arrow-propagation/propagation.canvas
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"nodes":[
{"id":"312705e29b96a272","type":"text","text":"start","x":-508,"y":-609,"width":121,"height":60,"color":"6"},
{"id":"79d4cebb7bb90a06","type":"text","text":"Here we print `input` and `state`!\n```ts\nconsole.log(input) // 2\nconsole.log(state.foo) // bar\nreturn 3\n```\n\nWe do not modify `state` - it is however anyways forwarded.","x":-225,"y":-240,"width":470,"height":240},
{"id":"e3d8cad7405cd110","type":"text","text":"```ts\nconsole.log(input) // 3\nconsole.log(state.foo) // bar\nreturn 10\n```","x":-225,"y":120,"width":470,"height":160},
{"id":"74e896e3e37fe457","type":"text","text":"","x":-1097,"y":466,"width":50,"height":50},
{"id":"af7d21a7d4da246a","type":"text","text":"empty node just for a cleaner look.\n`state` and `input` are both forwarded","x":-1030,"y":415,"width":207,"height":153,"color":"5"},
{"id":"a043b5759b55375f","type":"text","text":"```ts\nconsole.log(input) // 7\nconsole.log(state.foo) // B\n\n```","x":-881,"y":200,"width":340,"height":120},
{"id":"ff232e68056c62e7","type":"text","text":"There are 2 special variables:\n- `input` - the value received via an arrow\n- `state` - starting out as `{}` it can be reassigned \n\t- it is [shallowly cloned](https://lodash.com/docs/4.17.15#clone) whenever it is passed on\n```ts\nconsole.log(input) // undefined\nstate = {\n foo: 'bar'\n}\nconst local_var = 'local_var'\nreturn 2\n```","x":-255,"y":-717,"width":500,"height":354},
{"id":"04690b6c718c409b","type":"text","text":"`state` and `input` passed on","x":41,"y":-320,"width":204,"height":60,"color":"5"},
{"id":"2b63c752ded0afb8","type":"text","text":"you will learn - the *boring basics*:\n- how nodes receive input\n- how `state` propagates along arrows\n- how to use arrows\n- how to use **named arrows**\n- how to use the `this` variable","x":-1145,"y":-728,"width":529,"height":238,"color":"5"},
{"id":"dd5b074f7ac37197","type":"text","text":"`emit` is another way to send `state` and `input` along named arrows. \n\n```ts\nconsole.log(input) // 3\nconsole.log(state.foo) // bar\nemit('a', 5)\nstate.foo = 'A'\nemit('b', 6)\nstate.foo = 'B'\nreturn 7\n```","x":-914,"y":-460,"width":406,"height":300},
{"id":"76f7c024f19dd178","type":"text","text":"```ts\nconsole.log(input) // 5\nconsole.log(state.foo) // A\n// return undefined\n```","x":-1145,"y":-20,"width":340,"height":120},
{"id":"1a8f4d78596a33bb","type":"text","text":"```ts\nconsole.log(input) // 6\nconsole.log(state.foo) // B\nreturn input\n```","x":-617,"y":-20,"width":340,"height":120},
{"id":"3c07b23f84c68f41","type":"text","text":"","x":-360,"y":200,"width":50,"height":50},
{"id":"723bbd9e2d66d791","type":"text","text":"different `state` versions passed on","x":-1145,"y":-160,"width":204,"height":60,"color":"5"},
{"id":"3ec3bc45cac87c5c","type":"text","text":"This node will called **5** times - once form each in-arrow.\n```ts\nconsole.log(input) // ...\nconsole.log(state.foo) // ...\n\nemit('x', input)\nemit('x', state.foo)\n\nreturn 42 // this is never used \n```\n\n- the `42` is never used as there is no unnamed outgoing arrow.\n- other ways to await / join incoming arrows will be showin in [[zip-demo.canvas|zip-demo]] and [[zip-and-aggregate.canvas|zip-and-aggregate]]","x":-711,"y":460,"width":470,"height":400,"color":"6"},
{"id":"c318b1f3ef183b07","type":"text","text":"This node will called **10** times.\nAs the `emit` is called 2 times in the previous node.\n\n`this` can be used to preserve a variable across multiple invocations.\n\n```ts\nthis.i = (this.i ?? 0) + 1\n\nconsole.log('called', this.i)\n\nreturn this.i\n```","x":-140,"y":488,"width":385,"height":372}
],
"edges":[
{"id":"67433558d47dc9b1","fromNode":"312705e29b96a272","fromSide":"right","toNode":"ff232e68056c62e7","toSide":"left"},
{"id":"9f417c6d86136d78","fromNode":"ff232e68056c62e7","fromSide":"bottom","toNode":"79d4cebb7bb90a06","toSide":"top"},
{"id":"88ea517f38cb8bb4","fromNode":"79d4cebb7bb90a06","fromSide":"left","toNode":"dd5b074f7ac37197","toSide":"right"},
{"id":"8a9abb41e8e0623e","fromNode":"79d4cebb7bb90a06","fromSide":"bottom","toNode":"e3d8cad7405cd110","toSide":"top"},
{"id":"7939cfc621b90d66","fromNode":"dd5b074f7ac37197","fromSide":"bottom","toNode":"76f7c024f19dd178","toSide":"top","label":"a"},
{"id":"0f86025acaf98d6a","fromNode":"dd5b074f7ac37197","fromSide":"bottom","toNode":"1a8f4d78596a33bb","toSide":"top","label":"b"},
{"id":"0c903cbe31e43c33","fromNode":"dd5b074f7ac37197","fromSide":"bottom","toNode":"a043b5759b55375f","toSide":"top"},
{"id":"7a077fa13115c115","fromNode":"1a8f4d78596a33bb","fromSide":"bottom","toNode":"3ec3bc45cac87c5c","toSide":"top"},
{"id":"24621476d771e47f","fromNode":"e3d8cad7405cd110","fromSide":"bottom","toNode":"3ec3bc45cac87c5c","toSide":"top"},
{"id":"95bac9b4264ee8f2","fromNode":"76f7c024f19dd178","fromSide":"bottom","toNode":"74e896e3e37fe457","toSide":"top"},
{"id":"71d3e167cd0dd9df","fromNode":"74e896e3e37fe457","fromSide":"bottom","toNode":"3ec3bc45cac87c5c","toSide":"left"},
{"id":"d4d4b083fbb342b0","fromNode":"a043b5759b55375f","fromSide":"bottom","toNode":"3ec3bc45cac87c5c","toSide":"top"},
{"id":"c2fef52f6fbcdece","fromNode":"79d4cebb7bb90a06","fromSide":"bottom","toNode":"3c07b23f84c68f41","toSide":"top"},
{"id":"77424283215a8854","fromNode":"3c07b23f84c68f41","fromSide":"bottom","toNode":"3ec3bc45cac87c5c","toSide":"top"},
{"id":"0449712e6fb01b6a","fromNode":"3ec3bc45cac87c5c","fromSide":"right","toNode":"c318b1f3ef183b07","toSide":"left","label":"x"}
]
}
21 changes: 21 additions & 0 deletions examples/feature-tour/2-flow-control/aggregate-async.canvas
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"nodes":[
{"id":"42046e7ce5ac4520","type":"text","text":"start","x":-334,"y":-380,"width":112,"height":60},
{"id":"e229f9d13759d611","type":"text","text":"```ts\nfor(let i = 0; i < 10; i ++){\n emit('left', `left ${i}` )\n emit('right', `right ${i}` )\n}\nreturn 'extra'\n```\n\n ","x":-403,"y":-200,"width":423,"height":260},
{"id":"c0018d9216d4cd18","type":"text","text":"```ts\nawait sleep(100)\nreturn input\n```","x":200,"y":-200,"width":250,"height":260},
{"id":"366c4aa66d0e1cfb","type":"text","text":"**on**: test-agg-loop","x":-140,"y":-380,"width":200,"height":60},
{"id":"8875e4e65dc7b34c","type":"text","text":"```ts\nreturn aggregate().list()\n```","x":-357,"y":160,"width":334,"height":67},
{"id":"8a5606d63c36d325","type":"text","text":"**log** single aggregate: {{input | json}}","x":-359,"y":280,"width":336,"height":60},
{"id":"02bdefa657265a8b","type":"text","text":"**emit** aggs-result","x":-315,"y":400,"width":250,"height":60}
],
"edges":[
{"id":"64634ae7ba0e450f","fromNode":"42046e7ce5ac4520","fromSide":"bottom","toNode":"e229f9d13759d611","toSide":"top"},
{"id":"5ed8a0399f04340f","fromNode":"e229f9d13759d611","fromSide":"bottom","toNode":"8875e4e65dc7b34c","toSide":"top"},
{"id":"d79807e4fdccd30e","fromNode":"8875e4e65dc7b34c","fromSide":"bottom","toNode":"8a5606d63c36d325","toSide":"top"},
{"id":"363359c839c27a76","fromNode":"e229f9d13759d611","fromSide":"left","toNode":"8875e4e65dc7b34c","toSide":"left","label":"left"},
{"id":"5b57145aed61de2a","fromNode":"e229f9d13759d611","fromSide":"right","toNode":"c0018d9216d4cd18","toSide":"left","label":"right"},
{"id":"81eb1f4b16c8b0e3","fromNode":"c0018d9216d4cd18","fromSide":"bottom","toNode":"8875e4e65dc7b34c","toSide":"right"},
{"id":"3342cc6961544fd0","fromNode":"366c4aa66d0e1cfb","fromSide":"bottom","toNode":"e229f9d13759d611","toSide":"top"},
{"id":"298515bcee1a0536","fromNode":"8a5606d63c36d325","fromSide":"bottom","toNode":"02bdefa657265a8b","toSide":"top"}
]
}
16 changes: 16 additions & 0 deletions examples/feature-tour/2-flow-control/aggregate-loop.canvas
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"nodes":[
{"id":"b7ed0411df729d9a","type":"text","text":"start","x":-238,"y":-361,"width":250,"height":60},
{"id":"86576ae5e9e47dc5","type":"file","file":"feature-tour/2-flow-control/aggregate-async.canvas","x":-313,"y":-160,"width":400,"height":400},
{"id":"9e6354f35546d819","type":"text","text":"```ts\nawait sleep(1000)\nemit('loop')\nawait sleep(1000)\nemit('loop')\n```","x":-840,"y":-440,"width":378,"height":257},
{"id":"f58f32d1936b6978","x":-700,"y":50,"width":250,"height":60,"type":"text","text":"**log** now again"},
{"id":"43cd643a7e162587","type":"text","text":"**log**: aggs-result: {{input | json}}","x":240,"y":-625,"width":300,"height":370}
],
"edges":[
{"id":"ffa7f7512bea6a12","fromNode":"b7ed0411df729d9a","fromSide":"bottom","toNode":"86576ae5e9e47dc5","toSide":"top"},
{"id":"14de4b2381e51f51","fromNode":"b7ed0411df729d9a","fromSide":"left","toNode":"9e6354f35546d819","toSide":"right"},
{"id":"9eef504eaa0da94c","fromNode":"9e6354f35546d819","fromSide":"bottom","toNode":"f58f32d1936b6978","toSide":"left","label":"loop"},
{"id":"9f9ac0002fe3f865","fromNode":"86576ae5e9e47dc5","fromSide":"right","toNode":"43cd643a7e162587","toSide":"left","label":"aggs-result"},
{"id":"9c2fb7ddea349cac","fromNode":"f58f32d1936b6978","fromSide":"right","toNode":"86576ae5e9e47dc5","toSide":"left","label":"test-agg-loop"}
]
}
17 changes: 17 additions & 0 deletions examples/feature-tour/2-flow-control/aggregate.canvas
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"nodes":[
{"id":"5af0ad511d61a99c","x":-251,"y":-50,"width":250,"height":60,"type":"text","text":"aggregate"},
{"id":"e229f9d13759d611","type":"text","text":"```ts\nreturn 1\n```","x":-403,"y":-121,"width":250,"height":60},
{"id":"cf7360d9e9338567","type":"text","text":"```ts\nreturn 2","x":-100,"y":-121,"width":250,"height":60},
{"id":"42046e7ce5ac4520","type":"text","text":"start","x":-185,"y":-280,"width":112,"height":60},
{"id":"8875e4e65dc7b34c","type":"text","text":"```ts\nreturn aggregate().list()\n```","x":-309,"y":40,"width":334,"height":67},
{"id":"8a5606d63c36d325","type":"text","text":"**log** {{input | json}}","x":-267,"y":180,"width":250,"height":60}
],
"edges":[
{"id":"64634ae7ba0e450f","fromNode":"42046e7ce5ac4520","fromSide":"bottom","toNode":"e229f9d13759d611","toSide":"top"},
{"id":"8c59cfd083358a05","fromNode":"42046e7ce5ac4520","fromSide":"bottom","toNode":"cf7360d9e9338567","toSide":"top"},
{"id":"5ed8a0399f04340f","fromNode":"e229f9d13759d611","fromSide":"bottom","toNode":"8875e4e65dc7b34c","toSide":"top"},
{"id":"c9021a6e02f999d4","fromNode":"cf7360d9e9338567","fromSide":"bottom","toNode":"8875e4e65dc7b34c","toSide":"top"},
{"id":"d79807e4fdccd30e","fromNode":"8875e4e65dc7b34c","fromSide":"bottom","toNode":"8a5606d63c36d325","toSide":"top"}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
"nodes":[
{"id":"367f2fabbc0ee841","type":"text","text":"```ts\nreturn {\n id: 'a', \n key1: 'key1'\n}\n``` ","x":-259,"y":-60,"width":250,"height":140},
{"id":"bfd2de90be95a59c","type":"text","text":"```ts\nreturn {\n id: 'a', \n key2: 'key2'\n}\n``` ","x":40,"y":-60,"width":236,"height":140},
{"id":"335af68f62fea62f","type":"text","text":"```ts\nfor(let i = 0; i <= 10; i++) {\n emit('count', i)\n}\n```","x":583,"y":252,"width":377,"height":128},
{"id":"5fd6841400f9083f","type":"text","text":"```ts\naggregate()\n\nconsole.log('a: counter now', input)\n```","x":358,"y":533,"width":414,"height":167},
{"id":"f0b9fdb709d7430d","type":"text","text":"```ts\nconst inputs = aggregate().list()\n\nconsole.log('counter vals:', inputs)\nconsole.log('b: counter now', input)\n```","x":820,"y":533,"width":480,"height":167},
{"id":"4f3293d8c9e8f499","type":"text","text":"```ts\naggregate()\n```","x":886,"y":958,"width":314,"height":83},
{"id":"f7fd42e3afd1fb4d","type":"text","text":"**log** all aggregates completed","x":860,"y":1120,"width":367,"height":60},
{"id":"c0a7a2db1dda4c5d","type":"text","text":"```ts\naggregate()\n```","x":401,"y":1240,"width":314,"height":83},
{"id":"c0a7a2db1dda4c5d","type":"text","text":"```ts\nreturn aggregate().list()\n```","x":401,"y":1240,"width":314,"height":83},
{"id":"a7b72ff5dad61f82","type":"text","text":"**log** Everything completed ","x":401,"y":1380,"width":314,"height":50},
{"id":"99f1766f28d485ca","type":"text","text":"**Merge order can not yet not be controlled.** \n\nMerge order is currently goes by invocation order which is a runtime implementation detail that likely to change . \nIn the future there might be a way to mark an edge's merge / list precedence.\n","x":361,"y":-100,"width":445,"height":220,"color":"2"},
{"id":"c497949d9beaf0d0","type":"text","text":"**log** count: {{input}}","x":1340,"y":587,"width":300,"height":60},
Expand All @@ -16,7 +15,8 @@
{"id":"f34d176e9901212b","type":"text","text":"```ts\nconst obj = zipOnInput('id').merge()\nconsole.log('1. merge on id:', obj)\nreturn obj\n```","x":-103,"y":196,"width":522,"height":120},
{"id":"4542eba5d1247c99","type":"text","text":"```ts\nreturn {\n id: 'a', \n key3: 'key3'\n}\n```","x":-420,"y":380,"width":370,"height":153},
{"id":"26484d7c5e9c5181","type":"text","text":"**log** an aggregate completed","x":415,"y":970,"width":300,"height":60},
{"id":"2bb0a8756165dac5","type":"text","text":"start","x":-59,"y":-400,"width":99,"height":60}
{"id":"2bb0a8756165dac5","type":"text","text":"start","x":-59,"y":-400,"width":99,"height":60},
{"id":"335af68f62fea62f","type":"text","text":"```ts\nfor(let i = 0; i <= 10; i++) {\n emit('count', i)\n}\n```","x":584,"y":252,"width":377,"height":128}
],
"edges":[
{"id":"ebc1fd2def1cc442","fromNode":"2bb0a8756165dac5","fromSide":"bottom","toNode":"95109145540231cf","toSide":"top"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"nodes":[
{"id":"1f6829180234712b","type":"text","text":"```ts\nreturn {\n id: 'a', \n key2: 'key2'\n}\n``` ","x":-495,"y":-372,"width":236,"height":140},
{"id":"3c795494b7d50d92","type":"text","text":"```ts\nreturn {\n id: 'a', \n key1: 'key1'\n}\n``` ","x":-781,"y":-372,"width":250,"height":140},
{"id":"d6828590bc7e2628","x":-577,"y":-540,"width":114,"height":60,"type":"text","text":"start"},
{"id":"d6828590bc7e2628","type":"text","text":"start","x":-577,"y":-540,"width":114,"height":60},
{"id":"f0a8aed013f8b831","type":"text","text":"```ts\nconst obj = zipOnInput('id').merge()\n```\n`obj` will be:\n\n```json\n{\n id: 'a', \n key1: 'key1',\n key2: 'key2'\n}\n```","x":-781,"y":-120,"width":522,"height":280},
{"id":"43ff08d010bfc322","type":"text","text":"```ts\nfor(let i = 0; i < 10; i++){\n emit('count', {\n id: i, \n num: i,\n side_b: true\n })\n}\n``` \n\ncounts to **10**","x":-480,"y":260,"width":379,"height":260},
{"id":"3c938f85c78b130e","type":"text","text":"```ts\nfor(let i = 0; i < 3; i++){\n emit('count', {\n id: i, \n num: i,\n side_a: true\n })\n}\n``` \n\ncounts to **3**","x":-900,"y":260,"width":380,"height":260},
{"id":"f33478014b019051","x":-817,"y":620,"width":595,"height":280,"type":"text","text":"```ts\nconst list = zipOnInput('id').merge()\nconsole.log(list)\n```\nonly 3 zips will come in here because the others will not have a matching invocation on the other side.\n```js\n{ id: 0, num: 0, side_a: true, side_b: true }\n{ id: 1, num: 1, side_a: true, side_b: true }\n{ id: 2, num: 2, side_a: true, side_b: true }\n```\n"}
{"id":"f33478014b019051","type":"text","text":"```ts\nconst list = zipOnInput('id').merge()\nconsole.log(list)\nreturn list\n```\nonly 3 zips will come in here because the others will not have a matching invocation on the other side.\n```js\n{ id: 0, num: 0, side_a: true, side_b: true }\n{ id: 1, num: 1, side_a: true, side_b: true }\n{ id: 2, num: 2, side_a: true, side_b: true }\n```\n","x":-817,"y":620,"width":595,"height":300}
],
"edges":[
{"id":"668293481a34b639","fromNode":"3c795494b7d50d92","fromSide":"bottom","toNode":"f0a8aed013f8b831","toSide":"top"},
Expand Down
Loading