UNPKG

@hydevs/hypb

Version:

<img src="https://github.com/Hydevs-Corp/Hypb/blob/9308ab4c17196e5c0083c983a528326fd2cba867/.github/assets/banner.png" alt="usehooks-ts banner" align="center" />

46 lines (45 loc) 1.56 kB
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import { Hypb } from './functions'; import { useAuthContext, useCollection, useRecordWhere } from './hooks'; import { useAuthData } from './hooks/useAuthData'; useAuthContext; useAuthData; const main = () => __awaiter(void 0, void 0, void 0, function* () { const { invalidate } = useCollection('pouet', { filter: [ { left: 'content', operator: '=', right: 'SALUT LES COPAINS', }, ], queryParams: { '': '', }, }); invalidate({}); useRecordWhere('posts', [ { left: 'BBBBBBBBB', operator: '<', right: 'SALUT LES COPAINS', }, ], { queryParams: {}, }); }); Hypb.pb; Hypb.collection('posts') .getOne('1') .then((red) => { red; }); Hypb.collection('posts').getList(1, 2, {});