Posts

Showing posts from June, 2024

React Query

Image
https://tanstack.com/query/v4/docs/framework/react/guides/query-keys  https://tanstack.com/query/latest/docs/framework/react/installation https://gorest.co.in/#google_vignette 0 .........................................................................................................................................

learnnewtopics

 https://tanstack.com/query/latest/docs/framework/react/videos https://tanstack.com/router/latest/docs/framework/react/overview https://www.freecodecamp.org/news/swr-library-for-data-fetching-in-react/#:~:text=The%20name%20%E2%80%9CSWR%E2%80%9D%20is%20derived,up%2Dto%2Ddate%20data. https://medium.com/bina-nusantara-it-division/understanding-react-query-11e56960e90c#:~:text=React%20Query%20is%20a%20JavaScript,or%20even%20local%20state%2C%20effortlessly.

functioncurryinginjs

Image
 

cookieforreact

class CookieConstants {       private xtoken : string = "" ;       public get_cookie (){                 this . xtoken = ( document . cookie . split ( ';' ). map ( c => c . trim ()). filter ( c => c . startsWith ( 'csrftoken' + '=' )))[ 0 ]. split ( '=' )[ 1 ]         return this . xtoken ;     }   } export default new CookieConstants () .... import Variables from '../Global.ts' ;   let response = await fetch ( Variables . get_Base_Url () + '/api/hospital-app/ask_corner/admin/logout/' , {           method : 'GET' ,           headers : {             Accept : 'application/json' ,             'Content-Type' : 'application/json' ,             withCredentials : true ,             'X-CSRF...

promises[callback ]

Image
 https://www.youtube.com/watch?v=ap-6PPAuK1Y&t=2090s inversion of control: so this code:----------- const promise=createOrder(cart) promise is in empty object[asynchronous call] {data:undefined}[property untill the value is not there] after some time data will be filled with data...orderdetail ................................................................................................................................................. resolve just once  immutable promise is an object representing the eventual completion of asynchronous operation.

generics in typescript

Image
 Generics: Makes it easier to write functions,ineterfaces and more that work with different types function getValueString(data:string):string[]{     return [data]; } function getValueNumber(data:number):number[]{     return [data]; } const result=getValueString('amit'); const result1=getValueNumber(2); ........................................ :-----//Defination syntax:--- getValueString<TypeToWrap>(value:TypeToWrap):TypeToWrap[]{ } //calling syntax:-- getValue<TypeToWrap>(value); :------------------------------------------------------------------------------------------ function getValueString<TypeToWrap>(value:TypeToWrap):TypeToWrap[]{     return [value]; } const result=getValueString<string>("raj") const result1=getValueString<number>(1) console.log(result) console.log(result1) :---------------------------------------------------- function getValueString<TypeToWrap>(value:TypeToWrap,email:string){     ret...

Redis tutorial

https://stackoverflow.com/questions/70020046/quasar-error-cannot-find-module-ajv-dist-compile-codegen  Redis can be used as a database, cache, streaming engine, message broker, and more.   refresh while loading a query:--- 1 it will be requery 2 respone time will increase 3: waiting time will increase good for computed data like :unread messages... ........................................................................................................................................... open source in memory data store. ...................................................

typescript revise

 interface for object like props:-- name should be start with capital letter interface functionnameProps like this can be written convention

important react work

  Editing CRUD Example - Material React Table V2 Docs (material-react-table.com) https://stackoverflow.com/questions/70020046/quasar-error-cannot-find-module-ajv-dist-compile-codegen

someimportantlinks

how to find url: const url = window.location.href     var regex = /[?&]([^=#]+)=([^&#]*)/g,         params = {},         match;     while (match = regex.exec(url)) {         params[match[1]] = match[2];     }     if (params.key1) {         if((params.key1).length>30){           console.log(params.key1,params.key);           Variables.set_authToken('Token ' + params.key1);           Variables.set_patientSlug(params.key2);                    localStorage.setItem('token', params.key1);         localStorage.setItem('patient_slug', params.key2);         }         else{             localStorage.setItem('token', params.key2);         ...

roadmap for interview

  1:redux 2:javascript revise interview giving start

api

https://newstaging.vidalhealth.com:7743/media/health_tools/nwTHGmwk6N/blob c9492dee63d017eaa6ef28165519bdecc3cb5d28 import CircularProgress from '@mui/material/CircularProgress' ; const [ loading , setLoading ] = useState ( true )   const   wellnessEcardDetailsAsync = async () => {       try {         let response = await fetch ( Variables . get_Base_Url () + '/api/hospital-app/discount_card/wellness_ecard/' , {           method : 'POST' ,           headers : {             Accept : 'application/json' ,             'Content-Type' : 'application/json' ,             Authorization : 'Token ' + localStorage . getItem ( 'token' ),                       },           body :   JSON . stringify ({ "patient...

api call

  axios.post(`https://newstaging.vidalhealth.com:7743/api/hospital-app/save_blood_pressure_data/`, fd,  { headers: { Authorization: 'Token ' + 580db9645bcfe0d515a5de161d4c8e1e34c4c125 } })             .then(response => {                                 let json = response.data;                 console.log(json.SUCCESS)                  })             .catch(error => {                 console.log(error)             })

muliselectdropdown

  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport"           content = "width=device-width, initial-scale=1.0" >     < title > Select All Checkbox </ title >     < script src = "https://code.jquery.com/jquery-3.6.0.min.js" >       </ script >     < style >         .dropdown {                     position : relative ;           display : inline-block ;         }                 .dropdown-content {             display : none ;           position : absolute ;           background-color : #f9f9f9 ;           min-width...