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

Method extract_rtk_hook_bindings

codegraph-kernel/src/tsjs/extractors.rs:816–837  ·  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

814
815 /// extractRtkHookBindings — `export const { useGetXQuery } = api`.
816 fn extract_rtk_hook_bindings(&mut self, pattern: Node<'t>, is_exported: bool) {
817 for i in 0..pattern.named_child_count() {
818 let Some(binding) = pattern.named_child(i) else { continue };
819 if binding.kind() != "shorthand_property_identifier_pattern" {
820 continue;
821 }
822 let name = self.text(binding).to_string();
823 if !util::rtk_hook_name().is_match(&name) {
824 continue;
825 }
826 self.create_node(
827 "function",
828 &name,
829 binding,
830 Extra {
831 is_exported: Some(is_exported),
832 signature: Some("= RTK Query generated hook".to_string()),
833 ..Extra::default()
834 },
835 );
836 }
837 }
838
839 // --- owned object literals (#2300) ------------------------------------------------
840

Callers 1

extract_variableMethod · 0.80

Calls 2

textMethod · 0.65
create_nodeMethod · 0.45

Tested by

no test coverage detected