MCPcopy
hub / github.com/duke-git/lancet / ExampleNew

Function ExampleNew

promise/promise_example_test.go:11–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9)
10
11func ExampleNew() {
12 p := New(func(resolve func(string), reject func(error)) {
13 resolve("hello")
14 })
15
16 val, err := p.Await()
17 if err != nil {
18 return
19 }
20
21 fmt.Println(val)
22
23 // Output:
24 // hello
25}
26
27func ExampleThen() {
28 p1 := New(func(resolve func(string), reject func(error)) {

Callers

nothing calls this directly

Calls 2

AwaitMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…