ngp-core
TypeScript icon, indicating that this package has built-in type declarations

0.0.67 • Public • Published

ngp-core

listener

stock all observables, timeout and interval, kill all when component is destroying

methods

name arguments return goal
addSubscription Subscription void add subscription in list will destroying when component destroy
addObservable Observable, Function next, Optional(Function error), Optional(Function complete) void create subscription with observable and add it in list will destroying when component destroy
addTimeout any (id timeout) any (id timeout) add timeout in list will clearing when component destroy
addInterval any (id interval) any (id interval) add interval in list will clearing when component destroy
clearTimeout any (id timeout) void clear and remove of list
clearInterval any (id timeout) void clear and remove of list
appendTimeout Timeout, Function execute any (id timeout) create timeout with time and execute your method
appendInterval Timeout, Function execute any (id interval) create interval with time and execute your method
onDestroy overrideable to execute on destroy void execute when component is destroying

directive

builder template in component, please use readme in other library to know use it

  • ngp-body
  • ngp-event
  • ngp-header
  • ngp-footer
  • ngp-title

type

Color

enum of color bootstrap

  • DARK_BLUE: primary
  • BLUE: info
  • GREY: secondary
  • BLACK: dark
  • WHITE: white
  • GREEN: success
  • RED: danger
  • YELLOW: warning
  • BEIGE: light

TimeoutUnit

  • MILLISECOND
  • SECOND
  • MINUTE
  • HOUR

alias

  • ColorProperty: Color | 'dark_blue' | 'blue' | 'grey' | 'black' | 'white' | 'green' | 'red' | 'yellow' | RGB | string
  • EventType: keyof HTMLElementEventMap
  • BooleanProperty: boolean | 'true' | 'false'
  • NumberProperty: number | string
  • TimeoutUnitProperty: TimeoutUnit | 'ms' | 's' | 'm' | 'h'
  • TimeoutProperty: Timeout | number

model

ngp-event

property type optional contain
name string true id component
type EventType false type event receive
event Event true event catching

RGB

property type optional contain
red number false ratio red
blue number false ratio blue
green number false ratio green
alpha number true default 1 opacity 0 -> 1

timeout

property type optional contain
value number false time
unit TimeoutUnit true default millisecond

function

component

name arguments return goal
propertyToBoolean BooleanProperty/undefined boolean convert multiple type to boolean
propertyToNumber NumberProperty/undefined number/undefined convert multiple type to number
propertyToColor ColorProperty/undefined {color?: Color, custom?: string}/undefined convert multiple type to Color
rgbToColor RGB/undefined string/undefined rgb to rgba syntax css
propertyToTimeoutUnit TimeoutUnitProperty TimeoutUnit convert multiple type to TimeoutUnit
millisecondToUnit time: number; unit: TimeoutUnit number convert millisecond to unit
timeoutToMillisecond Timeout number timeout to millisecond

observable

name arguments return goal
newEmitter any BehaviorSubject
newEmitterNullable BehaviorSubject
emitterToObservable () -> BehaviorSubject Observable create observable with skip default value
emitterToLimitObservable () -> BehaviorSubject; limit: number Observable create obsservable skip default and take limit
observableErrorComplete Observable/undefined; ((error) -> Observable/undefined)/undefined; complete: (() ->void)/undefined Observable/undefined apply error and/or complete to observable
subscribe Observable/undefined; next: (any) => void, ((error) -> Observable/undefined)/undefined; complete: (() ->void)/undefined Subscription/undefined apply next, error and/or complete to observable

enum

name arguments return goal
enumKeyOf {[s: string]: any}; key: string any/undefined find in enum by name
valueOf {[s: string]: any}; value: any any/undefined find in enum by value

Readme

Keywords

Package Sidebar

Install

npm i ngp-core

Weekly Downloads

0

Version

0.0.67

License

MIT

Unpacked Size

374 kB

Total Files

84

Last publish

Collaborators

  • pmeignant