{"id":13502894,"url":"https://github.com/tanay-pingalkar/rq","last_synced_at":"2025-07-25T22:32:08.316Z","repository":{"id":217960740,"uuid":"377152291","full_name":"tanay-pingalkar/rq","owner":"tanay-pingalkar","description":"A jquery inspired library for wasm made in rust","archived":false,"fork":false,"pushed_at":"2021-06-16T07:23:56.000Z","size":39,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-31T22:33:07.529Z","etag":null,"topics":["rust","rust-library","rust-wasm","wasm","wasm-bindgen","wasm-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tanay-pingalkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-15T12:18:23.000Z","updated_at":"2023-08-29T13:21:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0575d50-5c3a-42a5-ace1-2f47db5c955c","html_url":"https://github.com/tanay-pingalkar/rq","commit_stats":null,"previous_names":["tanay-pingalkar/rq"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanay-pingalkar%2Frq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanay-pingalkar%2Frq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanay-pingalkar%2Frq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanay-pingalkar%2Frq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tanay-pingalkar","download_url":"https://codeload.github.com/tanay-pingalkar/rq/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227621904,"owners_count":17795021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust","rust-library","rust-wasm","wasm","wasm-bindgen","wasm-library"],"created_at":"2024-07-31T22:02:28.811Z","updated_at":"2024-12-01T20:11:40.265Z","avatar_url":"https://github.com/tanay-pingalkar.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# rq\nA jquery inspired library for wasm made in rust\n\n## rq::I\n`I` stands for id to get element.\nYou can use it like this\n``` rust\nuse req;\nuse web_sys::console;\n\nrq::I::new(\"class-name\")\n  .unwrap()\n  .html(\"manipulating dom from rust\")\n  .on(\"click\",Box::new(move |event| {\n    console::log_2(\u0026\"clicked : \".into(), \u0026event.into())\n  }))\n```\n\n## req::N\n`N` stands for new to create new element.\n``` rust\nuse req;\nuse web_sys::console;\n\nrq::N::new(\"p\") // name of tag\n  .unwrap()\n  .html(\"content of tag\")\n  .on(\"click\",Box::new(move |event| {\n    console::log_2(\u0026\"event : \".into(), \u0026event.into())\n  }))\n  .append(\"id\")\n  .unwrap() \n```\n\n## req::C\n`C` stands for class to get elements by class name.\n``` rust\nuse req;\nuse web_sys::console;\n\nrq::C::new(\"class-name\") // name of tag\n  .unwrap()\n  .html(\"rq looks good\")\n  .on(\"click\",Box::new(move |event| {\n    console::log_2(\u0026\"event : \".into(), \u0026event.into())\n  }))\n```\n\n## html_cj\nhtml_cj takes a closure and return the html, it is important when you have to change the html of element based on previous html\n``` rust\nuse req;\n\nrq::N::new(\"button\")\n  .unwrap()\n  .html(\"0\")\n  .id(\"btn-id\")\n  .on(\"click\",Box::new(move |event| {\n      req::I::new(\"btn-id\")\n         .unwrap() \n         .html_cj(|html| {\n             let html = html.parse::\u003cu32\u003e().unwrap() + 1;\n             html.to_string()\n          });\n  }))\n```\n\n\ncurrently the api is small and i am still learning rust. I will add more features to it so stay tuned.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanay-pingalkar%2Frq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanay-pingalkar%2Frq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanay-pingalkar%2Frq/lists"}