extractRtkHookBindings — `export const { useGetXQuery } = api`.
(&mut self, pattern: Node<'t>, is_exported: bool)
| 966 | |
| 967 | /// extractRtkHookBindings — `export const { useGetXQuery } = api`. |
| 968 | fn extract_rtk_hook_bindings(&mut self, pattern: Node<'t>, is_exported: bool) { |
| 969 | for binding in pattern.named_children(&mut pattern.walk()) { |
| 970 | if binding.kind() != "shorthand_property_identifier_pattern" { |
| 971 | continue; |
| 972 | } |
| 973 | let name = self.text(binding).to_string(); |
| 974 | if !util::rtk_hook_name().is_match(&name) { |
| 975 | continue; |
| 976 | } |
| 977 | self.create_node( |
| 978 | "function", |
| 979 | &name, |
| 980 | binding, |
| 981 | Extra { |
| 982 | is_exported: Some(is_exported), |
| 983 | signature: Some("= RTK Query generated hook".to_string()), |
| 984 | ..Extra::default() |
| 985 | }, |
| 986 | ); |
| 987 | } |
| 988 | } |
| 989 | |
| 990 | // --- a named object literal's data members (#3408) ---------------------------------- |
| 991 |
no test coverage detected