initial commit
This commit is contained in:
		
							
								
								
									
										12
									
								
								store/lockey.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								store/lockey.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| import {http} from "../utils/http"; | ||||
| import {botsRepository} from "../repository/bots"; | ||||
|  | ||||
| export class LockeyStore { | ||||
|     constructor(context) { | ||||
|         this.context = context | ||||
|     } | ||||
|  | ||||
|     createOrder(body) { | ||||
|         return http.post(botsRepository.url.createOrder(), body); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										15
									
								
								store/sample.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								store/sample.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| import {makeAutoObservable} from "mobx"; | ||||
|  | ||||
| export class SampleStore { | ||||
|     testObs = 0; | ||||
|     ctx; | ||||
|  | ||||
|     constructor(ctx) { | ||||
|         makeAutoObservable(this); | ||||
|         this.ctx = ctx; | ||||
|     } | ||||
|  | ||||
|     setTestObs(testObs) { | ||||
|         this.testObs = testObs; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										21
									
								
								store/store.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								store/store.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| import { action, observable, computed, runInAction, makeObservable } from 'mobx' | ||||
| import { enableStaticRendering } from 'mobx-react-lite'; | ||||
| import { useMemo } from 'react' | ||||
| import {Sample, SampleStore} from "./sample"; | ||||
| import {LockeyStore} from "./lockey"; | ||||
| // eslint-disable-next-line react-hooks/rules-of-hooks | ||||
| enableStaticRendering(typeof window === 'undefined') | ||||
|  | ||||
| let store; | ||||
|  | ||||
| export class Store { | ||||
|     sample = new SampleStore(this); | ||||
|     lockey = new LockeyStore(this); | ||||
|  | ||||
|     constructor() { | ||||
|     } | ||||
|  | ||||
|     hydrate = (data) => { | ||||
|         if (!data) return; | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user