Skip to content

Commit

Permalink
fix: push before going to local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
irishcarbomb777 committed May 23, 2024
1 parent 22bd5f2 commit 39eda78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ dist
.npmrc
package-lock.json
**/package-lock.json
**/pnpm-lock.yaml
pnpm-lock.yaml

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
"@tanstack/react-query": "^5.32.0",
"@thinairthings/use-immer": "^0.9.1",
"openai": "^4.38.3",
"uuid": "^9.0.1"
},
"peerDependencies": {
"uuid": "^9.0.1",
"neo4j-driver": "^5.19.0",
"next": "^14.2.0-canary.62",
"zod": "^3.22.5",
"zustand": "^4.5.2",
"zustand": "^4.5.2"
},
"peerDependencies": {
"react": "^18"
},
"devDependencies": {
Expand All @@ -79,4 +79,4 @@
"tsx": "^4.7.2",
"typescript": "^5.4.5"
}
}
}
29 changes: 3 additions & 26 deletions src/layers/ReactCache/defineReactCacheLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NodeDefinition, defineNode } from "@/src/base/defineNode";
import { TypeOf, ZodObject } from "zod";
import { GraphLayer } from "@/src/types/GraphLayer";
import { Ok } from "@/src/types/Result";
import { createStore, useStore } from "zustand";
import { create, createStore, useStore } from "zustand";
import { UixNode } from "@/src/types/UixNode";
import { enableMapSet, Draft, produce } from 'immer'
import { immer } from "zustand/middleware/immer";
Expand Down Expand Up @@ -51,38 +51,15 @@ export const defineReactCacheLayer = <
GraphLayer<N, R, E, UIdx, PreviousLayers | 'ReactCache'>,
'createNode' | 'updateNode'
>
// const nodeStore = createStore<ReactCache>()(
// immer(
// (set) => ({
// nodeMap: new Map(),
// createNode: async (nodeType, initialState) => {
// const createNodeResult = await graph.createNode(nodeType, initialState)
// if (!createNodeResult.ok) return createNodeResult
// const node = createNodeResult.val
// set((state) => {
// state.nodeMap.set(node.nodeId, node)
// })
// return Ok(node)
// },
// updateNode: async (nodeKey, state) => {
// set((state) => {
// state.nodeMap.set(nodeKey.nodeId, {
// ...state.nodeMap.get(nodeKey.nodeId)!,
// ...state
// })
// })
// return await graph.updateNode(nodeKey, state)
// },
// })
// )
// )
// const useNodeStore = create()()
return {
...graph,
useNodeState: (nodeType, node, updater) => {
const [nodeState, updateNodeState] = useImmer(graph.getNodeDefinition(nodeType).stateDefaults.parse(node ?? {}))
useEffect(() => {
return () => {
(async () => {
console.log("RUNNING")
await updater?.(node, nodeState)
})()
}
Expand Down

0 comments on commit 39eda78

Please sign in to comment.