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

Method extract_rtk_hook_bindings

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

966
967 /// extractRtkHookBindings — `export const { useGetXQuery } = api`.
968 fn extract_rtk_hook_bindings(&mut self, pattern: Node<'t>, is_exported: bool) {
969 for binding in pattern.named_children(&mut pattern.walk()) {
970 if binding.kind() != "shorthand_property_identifier_pattern" {
971 continue;
972 }
973 let name = self.text(binding).to_string();
974 if !util::rtk_hook_name().is_match(&name) {
975 continue;
976 }
977 self.create_node(
978 "function",
979 &name,
980 binding,
981 Extra {
982 is_exported: Some(is_exported),
983 signature: Some("= RTK Query generated hook".to_string()),
984 ..Extra::default()
985 },
986 );
987 }
988 }
989
990 // --- a named object literal's data members (#3408) ----------------------------------
991

Callers 1

extract_variableMethod · 0.80

Calls 3

textMethod · 0.65
walkMethod · 0.45
create_nodeMethod · 0.45

Tested by

no test coverage detected