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