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