Options
All
  • Public
  • Public/Protected
  • All
Menu

Module lib

SolidLabLib.js - Lib

Build status Coverage Status npm version

A library of helper functions for developing Solid apps in TypeScript/JavaScript.

This package is a bundle of all helper functions defined in SolidLabLib. These functions can also be installed separately.

Requirements

Installation

$ npm install @solidlab/lib

or

$ yarn add @solidlab/lib

Usage

Obtain the identity provider

This canonical package of this function is @solidlab/idp

The identity provider of a WebID can be determined as follows:

import { getIdp } from '@solidlab/lib';

await getIdp('https://rubensworks.solidcommunity.net/profile/card#me');

If you have an authenticated Solid session object, you can determine its IDP as follows:

const getIdpWithSession = getIdp.with({ session });

await getIdpWithSession(session.info.webId);

If you want to use a custom query engine instead of the default one, make sure to use the light version of this package, which enables the default query engine to be tree-shaked out during bundling:

import { getIdp } from '@solidlab/lib/light';

const getIdpWithEngine = getIdp.with({ engine: new CustomQueryEngine() });
await getIdpWithEngine('https://rubensworks.solidcommunity.net/profile/card#me');

If you have an authenticated Solid session object, you can determine its IDP as follows:

await getIdp(session.info.webId, defaultSolidUtilContext(session));

License

This code is copyrighted by Ghent University – imec and released under the MIT license.

Index

References

PartialSolidUtilContext

Re-exports PartialSolidUtilContext

QueryContext

Re-exports QueryContext

QueryEngine

Re-exports QueryEngine

SolidUtilContext

Re-exports SolidUtilContext

WithFunction

Re-exports WithFunction

createWithContext

Re-exports createWithContext

defaultQueryEngine

Re-exports defaultQueryEngine

getFirstBindings

Re-exports getFirstBindings

getIdp

Re-exports getIdp

getTermValue

Re-exports getTermValue

isValidContext

Re-exports isValidContext

solidUtilContextFull

Re-exports solidUtilContextFull

solidUtilContextLight

Re-exports solidUtilContextLight

Generated using TypeDoc