MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / extract_rtk_hook_bindings

Method extract_rtk_hook_bindings

codegraph-kernel/src/tsjs/extractors.rs:434–455  ·  view source on GitHub ↗

extractRtkHookBindings — `export const { useGetXQuery } = api`.

(&mut self, pattern: Node<'t>, is_exported: bool)

Source from the content-addressed store, hash-verified

432
433 /// extractRtkHookBindings — `export const { useGetXQuery } = api`.
434 fn extract_rtk_hook_bindings(&mut self, pattern: Node<'t>, is_exported: bool) {
435 for i in 0..pattern.named_child_count() {
436 let Some(binding) = pattern.named_child(i) else { continue };
437 if binding.kind() != "shorthand_property_identifier_pattern" {
438 continue;
439 }
440 let name = self.text(binding).to_string();
441 if !util::rtk_hook_name().is_match(&name) {
442 continue;
443 }
444 self.create_node(
445 "function",
446 &name,
447 binding,
448 Extra {
449 is_exported: Some(is_exported),
450 signature: Some("= RTK Query generated hook".to_string()),
451 ..Extra::default()
452 },
453 );
454 }
455 }
456
457 // --- object-literal / store helpers -------------------------------------------------
458

Callers 1

extract_variableMethod · 0.80

Calls 2

textMethod · 0.45
create_nodeMethod · 0.45

Tested by

no test coverage detected