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

Method extract_rtk_hook_bindings

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

910
911 /// extractRtkHookBindings — `export const { useGetXQuery } = api`.
912 fn extract_rtk_hook_bindings(&mut self, pattern: Node<'t>, is_exported: bool) {
913 for i in 0..pattern.named_child_count() {
914 let Some(binding) = pattern.named_child(i) else { continue };
915 if binding.kind() != "shorthand_property_identifier_pattern" {
916 continue;
917 }
918 let name = self.text(binding).to_string();
919 if !util::rtk_hook_name().is_match(&name) {
920 continue;
921 }
922 self.create_node(
923 "function",
924 &name,
925 binding,
926 Extra {
927 is_exported: Some(is_exported),
928 signature: Some("= RTK Query generated hook".to_string()),
929 ..Extra::default()
930 },
931 );
932 }
933 }
934
935 // --- owned object literals (#2300) ------------------------------------------------
936

Callers 1

extract_variableMethod · 0.80

Calls 2

textMethod · 0.65
create_nodeMethod · 0.45

Tested by

no test coverage detected