Socket
Socket
Sign inDemoInstall

@coffeekraken/s-feature

Package Overview
Dependencies
635
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @coffeekraken/s-feature

Base class to use to create features like @coffeekraken/s-activate-feature, etc... It handle properties as well as mounting at a certain point time, default properties and more...


Version published
Maintainers
1
Created

Readme

Source

{{#> layout-readme }}

SFeature

This package expose a simple SFeature class that has to be used as base class for your features like SActivateFeature, SFloatingFeature, etc...

Features

  • Support for default props
  • Support SInterface props definition
  • @coffeekraken/s-component-utils availablwe out ob the box
  • Support defered mount using the @coffeekraken/s-conductor package
  • Support responsive props
  • And more...

Usage

Here's how to import and make use of this base feature class:

import __SFeature from '@coffeekraken/s-feature';
export default class MyCoolFeature extends __SFeature {
    constructor(name: string, node: HTMLElement, settings?: any) {
        super(name, node, {
            ...(settings ?? {}),
        });
    }
    mount() {
        // start your feature integration here...
    }
}
export function define(
    props: Partial<ISMyCoolFeatureProps> = {},
    name = 'my-cool-feature',
) {
    __SFeature.defineFeature(name, MyCoolFeature, props);
}
import { define } from './MyCoolFeature';
define({
    // some default props...
});
<div my-cool-feature>
    Hello world
</div>

Properties

{{> interface namespace='@coffeekraken.s-component-utils.js.interface.SComponentUtilsDefaultPropsInterface' }}

API

For more information about the API, please check out the API documentation

{{/ layout-readme }}

FAQs

Last updated on 18 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc