Lightning Web Runtime :: Shared Utils
This package contains util code to be shared across @lwrjs packages. The code can be used by node modules and by client modules, if it's properly exposed from lwc config.
Observable Util
The observable util is an example of code that can be used both on the client side and on the node server side.
Node Usage
import { createObservable } from '@lwrjs/shared-utils';
const observable = createObservable();
Client Usage
Consuming package lwc config
{
"modules": [
{
"npm": "@lwrjs/shared-utils"
}
]
}
Module code
import { createObservable } from 'lwr/observable';
const observable = createObservable();