-
Notifications
You must be signed in to change notification settings - Fork 2
simplify main api (closes #155) #154
Conversation
…ict instead of graph + Ps
Query.id remains as optional for debugging
src/graph/index.d.ts
Outdated
@@ -17,7 +17,7 @@ export type QueryArgsNoDeps< | |||
A extends IOTSParams, | |||
P | |||
> = { | |||
id: string, | |||
id?: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it is still used as the name for the caches used in each node, and this can be helpful when debugging with DEBUG=avenger*
: the logs are colored and organized by name of the cache, and the default name if not passed is just "anonymous".
We could make this more explicit and call it "cacheName" maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or debugName
... up to you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
…d nodes (not recursively all "required" nodes)
@veej please take a look at the last 4 commits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
rough list of changes (all breaking!):
import { x } from 'avenger/lib/graph'
->import { x } from 'avenger'
import { x } from 'avenger/lib/cache/strategies'
->import { x } from 'avenger'
make
function: no need to "make" anything...
spread the result ofimport * as queries from 'queries'
before passing it to the context providerquery
,invalidate
,runCommand
,extract/restoreQueryCaches
){ query1, ..., queryN }
dictionary instead ofgraph
+Ps
string idsid
remains as an optional prop inQuery({ id })
just for debugging purposescommits should make sense if reviewed in order