UNPKG

@platform/state

Version:

A small, simple, strongly typed, [rx/observable] state-machine.

10 lines (9 loc) 302 B
export const is = { observable: (input) => hasAll(input, 'subscribe'), stateObject: (input) => hasAll(input, 'change'), }; const hasAll = (input, ...keys) => { return (input !== null && typeof input === 'object' && keys.every((key) => typeof input[key] === 'function')); };