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