extractRtkHookBindings — `export const { useGetXQuery } = api`.
(&mut self, pattern: Node<'t>, is_exported: bool)
| 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 |
no test coverage detected