- Callable — Any value that can be invoked with
()
operator- Examples: 0-callable.js
- Function — Callable object, with optional
this
binding or arrow- Examples: Function
- AsyncFunction — Promise-returning
Function
- Examples: AsyncFunction
- Callback — A function passed to another function to be called later. Callback-last-error-first — Callback contract or convention
(error, result)
signature, whereerror
isError | null
, andresult
is returned if no error- Examples: 1-callback.js, Callbacks
- Thenable — Any object with a
.then(fn)
method- Examples: 3-thenable.js, Thenable
- Promise — Thenable with
then
,catch
, andfinally
- Examples: 4-promise.js, Promise
- Iterable — Has
[Symbol.iterator]()
that returns anIterator
- Examples: 5-iterable.js
- AsyncIterable — Has
[Symbol.asyncIterator]()
that returns anAsyncIterator
- Examples: 6-async.js
- Iterator — Has
.next()
returning{ value, done }
structure- Examples: AsyncIterator, Iterator
- Generator — A function producing an
Iterator
(sync or async), supportingnext()
,throw()
,return()
- Examples: 7-generator.js, Generator, AsyncGenerator
- Array-like — Object with indexed keys
0
,1
, ... and numeric.length
, but no array methods- Examples: 8-array-like.js
- Observable — Push-based data sours available for subscription
- Examples: 9-observable.js, Events, Observer
- EventTarget — DOM standard interface with
.addEventListener(event, handler)
- EventEmitter — Node.js style event emitter with
.on(event, handler)
and.emit(event, ...args)
- Examples: EventEmitter,
- Stream — Abstraction for flow (readable/writable/duplex) with backpressure support
- Examples: a-stream.js, Streams
-
Notifications
You must be signed in to change notification settings - Fork 1
JavaScript Native Contracts
License
HowProgrammingWorks/NativeContracts
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
JavaScript Native Contracts