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

Method extract_rtk_hook_bindings

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

956
957 /// extractRtkHookBindings — `export const { useGetXQuery } = api`.
958 fn extract_rtk_hook_bindings(&mut self, pattern: Node<'t>, is_exported: bool) {
959 for binding in pattern.named_children(&mut pattern.walk()) {
960 if binding.kind() != "shorthand_property_identifier_pattern" {
961 continue;
962 }
963 let name = self.text(binding).to_string();
964 if !util::rtk_hook_name().is_match(&name) {
965 continue;
966 }
967 self.create_node(
968 "function",
969 &name,
970 binding,
971 Extra {
972 is_exported: Some(is_exported),
973 signature: Some("= RTK Query generated hook".to_string()),
974 ..Extra::default()
975 },
976 );
977 }
978 }
979
980 // --- owned object literals (#2300) ------------------------------------------------
981

Callers 1

extract_variableMethod · 0.80

Calls 3

textMethod · 0.65
walkMethod · 0.45
create_nodeMethod · 0.45

Tested by

no test coverage detected